Can I update Ubuntu with active users logged in? [closed]

Posted on

Can I update Ubuntu with active users logged in? [closed] – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, ubuntu-10.04, apt, update, patch-management.

I would like to run apt-get dist-upgrade, but I don’t know how this will affect the currently logged in users. How can I find out:
1. will a restart be required
2. will the system be stable/functional until the restart if required (this page implies that there are times when the server will become non-functional until the restart)
3. will users have to log out before I run apt for updates to succeed

Solution :

In Linux, like I think in all Unixes, when a process has an open file, it can continue to access it even if you delete it. After deletion the file is unreachable by other processes (there is no directory entry for it), but processes that had opened it before deletion can continue to access it using the handle the kernel gave them when they had opened it. The kernel only goes on to really free up the disk space when the file is closed by all processes that use it.

So, when you run a small upgrade, such as apt-get upgrade, this usually does not affect the system much. Suppose, for example, that apt upgrades glibc by deleting /lib/x86_64-linux-gnu/libc-2.13.so and putting /lib/x86_64-linux-gnu/libc-2.14.so in its place. This is an important update because practically everything uses the glibc library. However, there will probably not be any glitches, because already running processes will continue to use the old, deleted file. New processes will use the new file. This is why, when there is a glibc security update, we must restart all services after the update, but it’s usually not necessary to restart the system.

There may be glitches, however, if a running process opens new files while it is running. A process might have the old version of file A already open, and it might attempt to open the new version of file B, and the new B could be incompatible with the old A. Or a program that had already been running before the update might try to open some libraries, and it might be incompatible with these. Or a program might try to access a library that used to be in some specific location, and now it might have been moved elsewhere. In my experience, such glitches happen mostly with big graphical applications. If I upgrade my system while working, at some point firefox stops responding or starts to behave strangely. Applications that run in terminals are less likely to be affected, but in major upgrades it’s unlikely there won’t be any glitch at all.

In addition, during the upgrades some services are turned down for some amount of time. And, also, things frequently go wrong in upgrades, resulting in crippled systems, which you then have to fix and it may take some time.

Bottom line: The extent to which your users will be affected depends on what they’re doing and largely on chance. It is not unusual for them to not notice anything, but it would be unwise to bet your life on it.

As for the restart, apt-get dist-upgrade will probably install a new kernel, but it will not uninstall the already running kernel. If you don’t mind the fact you will still be running the old kernel, you can skip restarting. I believe that in theory you can fix almost any glitch without restarting the system (just by restarting services), but it’s usually easier to restart the entire machine after big upgrades.

  1. will a restart be required
  2. will the system be stable/functional until the restart if required
  3. will users have to log out before I run apt for updates to succeed
  • You should probably restart if this includes glibc and kernel updates.
  • The system will likely function until you can restart, but if that’s a concern, you should schedule a maintenance window and take care of your updates and downtime at the same time.
  • You users should not need to log out, but again, coordinate your maintenance window with the users and the business.

This is a situation where you (as sysadmin?) have to manage user expectations. If you have a set of updates important enough to consider running them outside of a maintenance window, I think you can make the business case to get real downtime and do the work properly.

Leave a Reply

Your email address will not be published.