5

When logging into my Ubuntu instance I get the message *** System restart required ***. I am running a server and uptime is very important for me.

How can I know why the restart is required? I have setup automatic security updates and I suspect one of those updates requires a restart. I only want to restart the server if the updated software is relevant to my setup.

1
  • 1
    The list of packages that require a restart can be seen by more /var/run/reboot-required.pkgs.
    – djhurio
    Sep 14, 2017 at 7:14

2 Answers 2

3

Any number of different updates can require you to reboot.

  • Kernel upgrades
  • Some core C/C++ library changes
  • Updates which can only be applied with a reboot to fully close an affected service's code that is part of the core OS
  • Certain undefined library updates which Security Team suggests a reboot to fix (the latest glibc vulnerability for instance, or some SSL library updates)

Unfortunately it is impossible to state what specifically is causing your system to say it needs rebooted, because there's so many potential causes for a reboot to be needed.

3

Inspect the content of /var/log/dpkg.log and see what packages have been installed recently. There have been a lot of kernel and openssl/openssh/etc vulnerabilities patched, and any services that are already running will have loaded copies of the old libraries into ram, and they will stay there continuing to be vulnerable until you either manually restart the affected services, or you simply reboot the host. If the package that was upgraded was a kernel package (linux-image, etc) then a reboot is the only way to get the new kernel runnning.

sudo zgrep -h 'status installed' /var/log/dpkg.log* | sort | tail -n 100

will show you the last 100 packages installed on your host. It's up to you to decide if you want to reboot it or not.

I believe there is a setting you can add to the unattended-upgrades package that will allow it to reboot automatically when the update is complete. If you can set the upgrades to occur at, say, 3am when you know load is light, the impact of such a reboot may be minimal.

Unattended-upgrades does, as I understand, only install packages where there is a security impact, so I wouldn't put off rebooting the server very long if it's exposed to the public internet.

3
  • This does not directly answer the question being asked - the question is "How can I know why the restart is required?" and your question does not really answer this...
    – Thomas Ward
    Mar 3, 2016 at 1:41
  • It exactly answers the question. It's what I do myself. What answer are you expecting, then?
    – user207998
    Mar 4, 2016 at 15:30
  • It's almost always a kernel upgrade requiring a restart. Many of those kernel upgrades from the unattended security upgrade pathway are patching important vulnerabilities or possible issues. You should restart if it says a restart is required. It's up to you to decide if a short downtime is worth the risk of vulnerability.
    – trisweb
    Sep 19, 2017 at 15:36

Not the answer you're looking for? Browse other questions tagged .