[Bug 1269177] Re: Running 'unattended-upgrades --dry-run' reboots the machine

Brian Murray brian at ubuntu.com
Fri Dec 15 20:04:04 UTC 2017


I was unable to recreate this given the test case you've provided.
Here's the end of my unattended-upgrade dry-run with --verbose:

thunderbird-gnome-support:amd64 thunderbird-locale-en-us:all xserver-common:all xserver-xorg-core:amd64 xul-ext-ubufox:all liblouis-data:all liblouis9:amd64 python3-louis:all
/usr/bin/dpkg --status-fd 73 --configure --pending
All upgrades installed

The last line is a lie.

bdmurray at clean-xenial-amd64:~$ apt-cache policy unattended-upgrades
unattended-upgrades:
  Installed: 0.90ubuntu0.8
  Candidate: 0.90ubuntu0.8
  Version table:
 *** 0.90ubuntu0.8 500
        500 http://192.168.10.7/ubuntu xenial-updates/main amd64 Packages
        500 http://192.168.10.7/ubuntu xenial-updates/main i386 Packages
        100 /var/lib/dpkg/status
     0.90ubuntu0.1 500
        500 http://192.168.10.7/ubuntu xenial-security/main amd64 Packages
        500 http://192.168.10.7/ubuntu xenial-security/main i386 Packages
     0.90 500
        500 http://192.168.10.7/ubuntu xenial/main amd64 Packages
        500 http://192.168.10.7/ubuntu xenial/main i386 Packages
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
bdmurray at clean-xenial-amd64:~$ grep Automatic-Reboot /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Automatic-Reboot "true";
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
bdmurray at clean-xenial-amd64:~$ file /var/run/reboot-required
/var/run/reboot-required: empty

Can you provide any more details about how this happened? Does your
unattended-upgrades log file include information about the reboot?

>From the code:
    # reboot at the specified time
    when = apt_pkg.config.find(
        "Unattended-Upgrade::Automatic-Reboot-Time", "now")
    if shutdown_lock > 0:
        os.close(shutdown_lock)
    logging.warning("Found %s, rebooting" % REBOOT_REQUIRED_FILE)
    subprocess.call(["/sbin/shutdown", "-r", when])

Thanks in advance!

-- 
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/1269177

Title:
  Running 'unattended-upgrades --dry-run' reboots the machine

Status in unattended-upgrades package in Ubuntu:
  Fix Released

Bug description:
  Much to my surprise, when I did a dry-run test of unattended-upgrades
  my server was forcibly rebooted. I must have had the file '/var/run
  /reboot-required' present.

  But needless to say: a --dry-run should NOT perform a reboot of the
  server with zero warning. Seriously.

  Output from /var/log/unattended-upgrades.log

  2014-01-15 11:14:26,474 INFO Initial blacklisted packages: 
  2014-01-15 11:14:26,474 INFO Starting unattended upgrades script
  2014-01-15 11:14:26,475 INFO Allowed origins are: ['o=Ubuntu,a=precise-security']
  2014-01-15 11:14:35,846 INFO Option --dry-run given, *not* performing real actions
  2014-01-15 11:14:35,846 INFO Packages that are upgraded: bind9-host dnsutils libbind9-80 libdns81 libisc83 libisccc80 libisccfg82 liblwres80 libssl1.0.0 linux-generic-pae linux-headers-generic-pae linux-image-generic-pae linux-libc-dev openssl
  2014-01-15 11:14:35,847 INFO Writing dpkg log to '/var/log/unattended-upgrades/unattended-upgrades-dpkg_2014-01-15_11:14:35.846820.log'
  2014-01-15 11:15:10,610 INFO All upgrades installed
  2014-01-15 11:15:10,611 WARNING Found /var/run/reboot-required, rebooting

  Version: 0.76ubuntu1

  As an aside, it makes a lot of sense to me to put the reboot on a
  timer, even if it's only a one minute (i.e. shutdown -r 1). That would
  have at least given me a chance to prevent the reboot if I had seen
  the warning. If that's a configuration setting I don't see it
  anywhere.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1269177/+subscriptions



More information about the foundations-bugs mailing list