[Bug 1661611] Re: apt/unattended-upgrades stalls shutdown
Jogarem
1661611 at bugs.launchpad.net
Fri Feb 10 15:33:42 UTC 2017
Well ok that was my first thought,too (boolean) so my first tests were
misleading then. I tested a little bit more and find something maybe
more useful.
When using Ubuntu 16.04.2 fresh installed and I set in
/etc/apt/apt.conf.d/50unattended-upgrades:
Unattended-Upgrade::InstallOnShutdown "true";
it seems to have no effect. Upgrades are there but they do not get installed. I get no plymouth message on shutdown.
Same when set to "True".
When I change /usr/share/unattended-upgrades/unattended-upgrade-
shutdown:
(line 120 again)
# check if we need to run unattended-upgrades on shutdown and if so,
# run it
p = None
apt_pkg.init_config()
before << if apt_pkg.config.find_b("Unattended-Upgrade::InstallOnShutdown", False):
after >> if apt_pkg.config.find_b("Unattended-Upgrade::InstallOnShutdown", False) == True:
env = copy.copy(os.environ)
env["UNATTENDED_UPGRADES_FORCE_INSTALL_ON_SHUTDOWN"] = "1"
Then it seems to work like expected.
Now when i set:
"Unattended-Upgrade::InstallOnShutdown "true";
in /etc/apt/apt.conf.d/50unattended-upgrades it starts upgrading on
shutdown (I see the plymouth message "Unattended Upgrades..."). When I
set it to "false" or just outcomment the whole line it do nothing on
shutdown. So exact the behavior I expect.
Well I'm not a python expert but it seems to me that the <if True> thing
works not as it should or maybe has changed in python3 some how? It may
affect all other statements as well then (like MailOnlyOnError etc) but
I haven't tested them yet...
With the above patch it works for me as it should. At least for the
shutdown setting.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unattended-upgrades in Ubuntu.
https://bugs.launchpad.net/bugs/1661611
Title:
apt/unattended-upgrades stalls shutdown
Status in unattended-upgrades package in Ubuntu:
Incomplete
Bug description:
When unattended-upgrades is installed, 9 out of 10 shutdowns/reboots
hang while "starting unattended upgrades shutdown". This hang stalls
the shutdown process for 5-10 mins.
If I disable unnattended-upgrades via the /etc/apt/apt.conf.d/20auto-
upgrades and/or 50unattended-upgrades, the problems occurs.
If I terminate the service before shutdown/reboot (sudo service
unattended-upgrades stop) the problem still occurs.
If I remove the package (sudo apt remove unattended-upgrades) the
problem no longer occurs.
This occurs on a freshly installed version of Ubuntu Server 16.04.1
(both unattended-upgrades installed via install GUI or manual install
of unattended-upgrades)
Both Kern.log & syslog do not show the shutdown process (I believe
because the filesystems have already unmounted)
Original report: http://askubuntu.com/questions/878630/apt-unattended-
upgrades-stalls-shutdown
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1661611/+subscriptions
More information about the foundations-bugs
mailing list