• Bug#1041730: dpkg: Systemd dpkg-db-backup.timer unit should be "Persist

    From Guillem Jover@1:229/2 to Teemu Likonen on Sat Jul 22 19:20:01 2023
    XPost: linux.debian.bugs.dist
    From: guillem@debian.org

    Hi!

    On Sat, 2023-07-22 at 19:36:46 +0300, Teemu Likonen wrote:
    Package: dpkg
    Version: 1.21.22
    Severity: minor
    Tags: patch
    X-Debbugs-Cc: tlikonen@iki.fi

    Dpkg installs systemd timer unit dpkg-db-backup.timer which is supposed
    to run daily:

    # /lib/systemd/system/dpkg-db-backup.timer
    [Unit]
    Description=Daily dpkg database backup timer
    Documentation=man:dpkg(1)

    [Timer]
    OnCalendar=daily

    [Install]
    WantedBy=timers.target

    The "OnCalendar=daily" rule means every night exactly at 00:00:00. The
    timer does not trigger if computer is not turned on exactly at that
    time.

    I think the timer is meant to trigger daily even if the computer is not running at midnight. The attached patch makes the timer trigger
    immediately if the specified time has passed (Persistent=true).

    Ah, indeed, nice catch! Queued the patch for the next push.

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Teemu Likonen@1:229/2 to All on Sat Jul 22 18:40:01 2023
    XPost: linux.debian.bugs.dist
    From: tlikonen@iki.fi

    This is a multi-part MIME message sent by reportbug.


    Package: dpkg
    Version: 1.21.22
    Severity: minor
    Tags: patch
    X-Debbugs-Cc: tlikonen@iki.fi

    Dpkg installs systemd timer unit dpkg-db-backup.timer which is supposed
    to run daily:

    # /lib/systemd/system/dpkg-db-backup.timer
    [Unit]
    Description=Daily dpkg database backup timer
    Documentation=man:dpkg(1)

    [Timer]
    OnCalendar=daily

    [Install]
    WantedBy=timers.target

    The "OnCalendar=daily" rule means every night exactly at 00:00:00. The
    timer does not trigger if computer is not turned on exactly at that
    time.

    I think the timer is meant to trigger daily even if the computer is not
    running at midnight. The attached patch makes the timer trigger
    immediately if the specified time has passed (Persistent=true).


    -- Package-specific info:
    This system uses merged-usr-via-aliased-dirs, going behind dpkg's
    back, breaking its core assumptions. This can cause silent file
    overwrites and disappearances, and its general tools misbehavior.
    See <https://wiki.debian.org/Teams/Dpkg/FAQ#broken-usrmerge>.

    -- System Information:
    Debian Release: 12.0
    APT prefers stable-updates
    APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.1.0-10-amd64 (SMP w/8 CPU threads; PREEMPT)
    Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
    Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8), LANGUAGE=fi Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages dpkg depends on:
    ii libbz2-1.0 1.0.8-5+b1
    ii libc6 2.36-9
    ii liblzma5 5.4.1-0.2
    ii libmd0 1.0.4-2
    ii libselinux1 3.4-1+b6
    ii libzstd1 1.5.4+dfsg2-5
    ii tar 1.34+dfsg-1.2
    ii zlib1g 1:1.2.13.dfsg-1

    dpkg recommends no packages.

    Versions of packages dpkg suggests:
    ii apt 2.6.1
    pn debsig-verify <none>

    -- no debconf information

    --- debian/dpkg.dpkg-db-backup.timer~ 2023-07-22 19:18:00.760386969 +0300
    +++ debian/dpkg.dpkg-db-backup.timer 2023-07-22 19:17:27.881116417 +0300
    @@ -4,6 +4,7 @@

    [Timer]
    OnCalendar=daily
    +Persistent=true

    [Install]
    WantedBy=timers.target

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)