I have a web server which upon restarting fails to render our main site. I think this is to do with updates applied upon rebooting.

Am I able to restart Ubuntu without applying updates?

  • Updates (or reboots) are probably not the sole cause per se. They may trigger something though and you should concentrate on finding what it is. (e.g. an ordering cycle in systemd may cause your OS to start without something the web server needs). You suspect the server will fail, so most likely this has happened before and not just once. So what did you do at these times to fix it? – Kamil Maciorowski Jun 20 '18 at 5:31
  • Updates are applied when you update. Rebooting just does house cleaning. For anything already open when you run the update, the update affects the stored file but not what is active in memory. The next time you open it from disk (can be after rebooting), the updated version is loaded. If updates are causing problems, you could try rebooting in recovery mode to roll it back, depending on what the update changed, but the update is already done before you restart, so you can't restart without applying updates. – fixer1234 Jun 21 '18 at 0:38

After you did apt-get upgrade or something similar and it upgraded some packages, there's no easy way to make the old versions of files survive a reboot. You can play with packages and restore their old versions; this technically doesn't bring back the old files themselves, it creates new files with identical content.

"Applying updates" during a reboot is not what you may think it is.

Linux and inode-based filesystems work in a way that allows replacing any file with its new version, while the old version is still in use. The old version is available to any process that had opened it before the update occurred, until the process closes the file. If no other path (hardlink) leads to the old file, its content will only be kept within the filesystem until it's no longer in use, although the filesystem itself provides no path to the old content anymore (but OS may).

For this reason updates (or, in term of apt-get: upgrades) can be done from within the running system. This is common. Compare to the Windows way, where some files are locked unless the OS is not yet (or no longer) fully running. In Linux there's no need to reboot if you just want to replace a file within a filesystem that is smart enough.

Note "replacing a file within a filesystem" is something different than "making processes use the new file".

Making processes use new files requires them to open descriptors leading to the new versions. I don't know any safe way to forcefully "remap" a descriptor, unless the process cooperates and reopens the file (e.g. it tracks the filename like tail --follow=name, or it reopens on demand). Additionally the executable itself may have been updated.

Usually the best way to "switch" a daemon to new files is to restart it. Some upgrade scripts restart some daemons. On the other hand restarting only some parts of the running OS may be cumbersome or impossible (see How Linux servers update their kernel without rebooting).

That's why you may get "system restart required". Note there's no updating during the reboot. What happens is the old versions become "not in use" during the shutdown phase, the filesystem then knows it can treat them as nonexistent and reuse the space. Restart is just a firm way to ensure everything uses the updated files that are already there.

  • Beautifully explained. In that case I will, as suggested, restart the server sometime when I it's safe to do so and make sure each of the required processes are running. – pcgben Jun 20 '18 at 22:46

In most Ubuntu configurations, updates are not applied by default upon rebooting (as opposed to Windows). Unless you have specifically installed and configured automatic update software, Ubuntu will not automatically update. There is likely some other error with your web server configuration.

  • While well intentioned, you really shouldn’t encourage posts like this. Too vague and too broad to really be helped. And honestly an Ubuntu update should not damage a website like that. – JakeGould Jun 20 '18 at 2:23
  • 1
    Thanks for the feedback! I've just started using this site, so I'm still learning the rules. I would've left a comment asking for clarification but don't have enough reputation. – Wesley Chalmers Jun 20 '18 at 2:31
  • Well, as you know… Earn more rep, leave productive comments like this and post decent answers and questions when you can. – JakeGould Jun 20 '18 at 2:38
  • I appreciate your help -sometimes things can get a little panicky. The question remains "can I restart Ubuntu without applying updates?". I will take a look and see if I can disable automatic updates because upon logging in via SSH, the welcome message includes: 245 packages can be updated *** System restart required *** – pcgben Jun 20 '18 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.