[Bug 2006589] Re: Anacron service and timer disabled after upgrading from 2.3-33
Adrien Nader
2006589 at bugs.launchpad.net
Wed Jul 12 10:46:51 UTC 2023
Sorry, I hadn't yet done the verification step after proposed. Here is
the log for a kinetic LXD which installs anacron and then updates it to
the version in -proposed ((2.3-33ubuntu2) over (2.3-33ubuntu1)).
As can be seen, the service and timer are enabled both before and after
the upgrade. We can also see that the work-around I added is triggered
and points out that the service and timer have been disabled until the
work-around kicks in.
======
RUN lxc launch ubuntu:kinetic anacron-sru
Creating anacron-sru
Starting anacron-sru
RUN at anacron-sru sh -c apt-get -qq update >/dev/null
RUN at anacron-sru apt-get -y -qq -o=Dpkg::Use-Pty=0 upgrade --autoremove
(Reading database ... 34189 files and directories currently installed.)
Removing libfreetype6:amd64 (2.12.1+dfsg-3ubuntu0.1) ...
Processing triggers for libc-bin (2.36-0ubuntu4) ...
RUN at anacron-sru apt-get -y install anacron
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
default-mta | mail-transport-agent
The following NEW packages will be installed:
anacron
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.9 kB of archives.
After this operation, 100 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu kinetic/main amd64 anacron amd64 2.3-33ubuntu1 [25.9 kB]
Fetched 25.9 kB in 0s (274 kB/s)
Selecting previously unselected package anacron.
(Reading database ... 34183 files and directories currently installed.)
Preparing to unpack .../anacron_2.3-33ubuntu1_amd64.deb ...
Unpacking anacron (2.3-33ubuntu1) ...
Setting up anacron (2.3-33ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/anacron.service → /lib/systemd/system/anacron.service.
Created symlink /etc/systemd/system/timers.target.wants/anacron.timer → /lib/systemd/system/anacron.timer.
Processing triggers for man-db (2.10.2-2) ...
Scanning processes...
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
RUN at anacron-sru sh -c echo deb http://fr.archive.ubuntu.com/ubuntu kinetic-proposed main restricted >> /etc/apt/sources.list
RUN at anacron-sru sh -c apt-get -qq update >/dev/null
RUN at anacron-sru apt-get install anacron
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
default-mta | mail-transport-agent
The following packages will be upgraded:
anacron
1 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
Need to get 26.7 kB of archives.
After this operation, 4096 B of additional disk space will be used.
Get:1 http://fr.archive.ubuntu.com/ubuntu kinetic-proposed/main amd64 anacron amd64 2.3-33ubuntu2 [26.7 kB]
Fetched 26.7 kB in 0s (292 kB/s)
(Reading database ... 34202 files and directories currently installed.)
Preparing to unpack .../anacron_2.3-33ubuntu2_amd64.deb ...
Warning: anacron.service will be disabled during the upgrade from anacron 2.3-33ubuntu1; we'll do our best to re-enable it (currently points to `/lib/systemd/system/anacron.service')
Warning: anacron.timer will be disabled during the upgrade from anacron 2.3-33ubuntu1; we'll do our best to re-enable it (currently points to `/lib/systemd/system/anacron.timer')
Unpacking anacron (2.3-33ubuntu2) over (2.3-33ubuntu1) ...
Setting up anacron (2.3-33ubuntu2) ...
Warning: anacron.service was probably disabled moments ago during the upgrade from anacron 2.3-33ubuntu1; re-enabling now (pointing to `/lib/systemd/system/anacron.service'
Warning: anacron.timer was probably disabled moments ago during the upgrade from anacron 2.3-33ubuntu1; re-enabling now (pointing to `/lib/systemd/system/anacron.timer'
Processing triggers for man-db (2.10.2-2) ...
Scanning processes...
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
RUN at anacron-sru systemctl show anacron.service --property=UnitFileState
UnitFileState=enabled
RUN at anacron-sru systemctl show anacron.timer --property=UnitFileState
UnitFileState=enabled
** Tags removed: verification-needed-kinetic
** Tags added: verification-done-kinetic
** Tags removed: verification-needed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to anacron in Ubuntu.
https://bugs.launchpad.net/bugs/2006589
Title:
Anacron service and timer disabled after upgrading from 2.3-33
Status in anacron package in Ubuntu:
Fix Released
Status in anacron source package in Kinetic:
Fix Committed
Bug description:
As hinted by https://lists.debian.org/debian-devel-
announce/2022/11/msg00001.html , anacron 2.3-33's packaging has a bug
which disables both the timer and service when its postrm script is
invoked and that includes upgrades from this package.
We need to work-around this issue since it is the version in kinetic.
=== SRU request below ===
[ Impact ]
* Due to an issue in the postrm script of anacron 2.3-33, upgrades
*from* that version disable the anacron service and timer.
Timeline:
- 2.3-32*: not buggy
- 2.3-33*: buggy
- 2.3-34*: buggy
- 2.3-35*: not buggy, no work-around (Debian decided against further
actions due to the affected versions only hitting unstable)
- 2.3-36: not buggy, no work-around
- 2.3-36ubuntu1: not buggy, no work-around
- 2.3-36ubuntu2: not buggy, work-around added
* We need to make sure that users do not upgrade to any version that is
less than 2.3-36ubuntu2 which contains a work-around for the bug in
2.3-33's postrm. This means that security updates must contain the
fix and the work-around, hence this SRU.
There are two aspects to this SRU:
- fixing the bug introduced in 2.3-33 and removed in 2.3-35
(responsible code was reverted back),
- working around the fact that the bug gets triggered when updating
from 2.3-33.
* The fix has been discussed as part of
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/2006589
The work-around uses 1) preinst to backup the service state before
the buggy postrm script runs, 2) postinst to restore the backup.
[ Test Plan ]
* NB: if you're running Lunar, your anacron.service and anacron.timer
are likely disabled due to this issue.
* Steps to reproduce the issue:
- install anacron-2.3-33* or anacron-2.3-34* (kinetic uses 2.3-33)
- check whether anacron.service (same for anacron.timer) is enabled:
systemctl show anacron.service --property=UnitFileState
- update anacron to any other version before 2.3-36ubuntu2 (including
previous version and including reinstalling the same version);
- check whether anacron.service (same for anacron.timer) is enabled:
systemctl show anacron.service --property=UnitFileState
if the service or timer were enabled before, they will now be
disabled; if they are not disabled, run "systemctl daemon-reload"
and check again
* Steps to test the fix:
- install anacron-2.3-33* or anacron-2.3-34*
- enable anacron.service and anacron.timer:
systemctl enable anacron.service anacron.timer
- update to anacron >= 2.3-36ubuntu2; if you pay attention to the
console output, you will see messages related to the issue
- check that anacron.service and anacron.timer are still enabled:
systemctl show anacron.service --property=UnitFileState
systemctl show anacron.timer --property=UnitFileState
[ Where problems could occur ]
* The fixed version is in lunar and is installed on a number of
machines already with no report so far. Unfortunately there has been
a window of opportunity for people to upgrade to an intermediate and
trigger the issue, therefore preventing the work-around to run. This
is not a specifically a problem with this update but it is a
limitation.
* There is always the possibility that this change breaks anacron.
However, without the work-around, anacron will be disabled silently.
As such, this update cannot make things worse in this regard.
* There is always the possibility of a grave bug that removes
everything on the machine. This is made more likely because the
postinst and postrm scripts are shell scripts and shell script makes
all errors more likely.
The code has however been written defensively, has been reviewed,
has been analyzed with shellcheck and has been tested on several
machines thanks to the update being in lunar. Moreover it does not
use destructive operations like "rm" (the exception is "rmdir
--ignore-fail-on-non-empty" which is zero-risk).
[ Other Info ]
* We should communicate to LL users about this issue once the SRU is
done.
Why wait for the SRU to communicate to users of an unreleased
version? Because it makes the message simpler: "all versions now are
fixed; update and check the service/timer status, you can't stumble
on the issue anymore".
While preparing the SRU, I was also reminded that we've been
including this NEWS file from Debian:
https://salsa.debian.org/debian/anacron/-/raw/0ce23b/debian/NEWS
I've tweaked it but the change isn't present in the lunar package
* Since the only requirement for this SRU is to be present before any
other update of anacron, this should be blocked forever. The bug
report on launchpad has the block-proposed-kinetic tag.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/2006589/+subscriptions
More information about the foundations-bugs
mailing list