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.
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: :InstallOnShutd own "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, pkg.init_ config( ) config. find_b( "Unattended- Upgrade: :InstallOnShutd own", False): config. find_b( "Unattended- Upgrade: :InstallOnShutd own", False) == True: os.environ)
env["UNATTENDE D_UPGRADES_ FORCE_INSTALL_ ON_SHUTDOWN" ] = "1"
# run it
p = None
apt_
before << if apt_pkg.
after >> if apt_pkg.
env = copy.copy(
Then it seems to work like expected.
Now when i set:
"Unattended- Upgrade: :InstallOnShutd own "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.