Under what circumstances is a reboot of an Ubuntu system necessary? I often read in answers that after changes in the system the system is to be restarted, but is that absolutely necessary?
- After kernel panic;
- After partitioning or filesystem modifications (more specifically, resizing root partition; I'd recommend to avoid resizing the hard drive from which you boot in general, regardless of partition; if you are resizing something external, like SD card or USB, no reboots necessary );
- After kernel upgrade and security patches (although that [might not always be necessary];
- After system became unresponsive for whatever reason, and you've no option but to use magic SYSRQ keys or hard reset
- After making changes to some dconf schemas , depending on the way application may have been developed. Related answer
- Your CPU is overheating (you don't wanna keep on roasting those cores, do you ?)
There are generally two situations where a reboot is usually necessary:
- The kernel is upgraded.
glibc) is upgraded.
There is a mechanism for reloading the kernel without restarting (How can I upgrade my server's kernel without rebooting?). With
glibc, the biggest problem is init. It is possible to restart init (see Restarting init without restarting the system).
For the average user, neither is recommended, and restarting is necessary.
Apparently, there exists a third case:
dbushas been upgraded.
dbus-daemonis apparently incapable of restarting (from what I can understand of the discussion on this LWN article). And since a lot of things rely on DBus...
I can't think of any situations of where a reboot is absolutely necessary.
Really, you can leave Ubuntu running indefinitely. It might get malware (because kernel and libc updates aren't applied) and it might panic or crash out... But what are avoiding those actually going to do for you?
Given the complexities of life, it might be more necessary to ignore the constant demands of computers, and sustain yourself in other ways. Like breathing, eating, loving... living.
But even then, are they absolutely necessary? Is your existence on this plane within the absolute definition of necessity? I honestly don't know. Bit of a weird question to ask.
To the two big-fat-joke-spoilers who downvoted this post and those that follow,
This question was incomplete, or at least open-ended. When you throw around words like necessary, you need to give a context.
Many answers already assumed the OP meant highly desirable (in a technical sense), so posted answers that fit contexts like necessary to avoid being hacked or necessary if your computer crashes. They're good answers. Adding another wasn't really warranted.
But they say assumptions are the mother of all muck ups (or something like that anyway) so I peeled it back to absolute necessity. If you insist on using an old copy of 10.10, Time and Space will carry rolling on, as are their wonts.
You'll note I'm not recommending that position.
I actually had a situation earlier today that proves this. Sometimes, there are residual things left over in the system after a change is made. For example, I had a user that was not able to access
/dev/dsp despite having been added to the appropriate groups. There was a lock placed on it by the first user that accessed it. However, even after killing that user, the lock was still in place and the second user could not access it. However, after a reboot, both users were able to simultaneously use
/dev/dsp without any conflict. Doing a reboot releases any residual things that could prevent changes from properly taking effect.
The question should really be closed as primarily opinion based.
The fact is, it depends on what was updated, how exposed your system is to the open Internet, and what system services you have/need running.
Simply installing new versions of a package does not result in the related services and applications being restarted. For example, if you are running Firefox while you install an updated package for it, then you will be notified within the browser when you switch back to it, that it needs to be restarted, after the update was installed. Likewise, the kernel itself needs to be "restarted" when updates are applied for it. Because the kernel is the lowest level above the hardware, you do need to reboot the system, for the new kernel to be loaded. For other services, they can be restarted without rebooting. An update to Unity or underlying libraries used by the services of the environment, will need you to log out and back in, to restart them. For system services, it may be possible to manually restart them after an update is applied, but doing so automatically could be very disruptive if you are trying to use the system.
The only way to know absolutely certain if a certain action is necessary, is to know what the changes are, and what your risk is for not performing that action. Security fixes obviously require more abrupt action than simple changes to other things, that you may never directly encounter. The more directly your computer is connected to the Internet, the more risk there is, as well. You'll have to consider all the variables, and make a decision whether to reboot now, or later, when you install updates.
When is it necessary to reboot an Ubuntu system?
A running machine and strictly when doing an update/upgrade? Probably never (but do read on). The Linux system is set up in such a way that after you updated the system where it would require a reboot to activate the new features (ie. read the kernel got changed; changes to apache, mysql only require a restart of the service) you can always keep working with the current state the system is on.
Now if you want these new features active the easiest method of doing so is rebooting. But for all we care you keep working on this machine and reboot it the next weekend or the weekend after that. Or next christmas. Is it smart? Maybe not. But there is nobody stopping you from doing so. The system is smart enough to not accept the next update if the server has not rebooted yet.
To me the only reasons where a reboot is necessary is after first install or when doing maintenance where single user is required (think things like partitioning, fixing hard disk errors) or when some idiot ran the famous fork bomb (though that one could be fixed from the system itself).
For all other reboots to occur is at the grace of the administrator. And I can not call that "necessary".
First of all, I appreciate this question because it will always be current.
The other answers are correct and very detailed - that is why I go short.
There are scenarios where a reboot is necessary, like after installing a new kernel.
There are scenarios where it is recommended, like after the install of a new desktop.
In most scenarios, like after installing or upgrading software rebooting is not necessary.
Whenever you are in doubt I recommend to perform a restart, so you are on the safe side.
Install the package
sudo apt-get install debian-goodies
and run the command
You will see a list of services and now you have the choice:
- Restart each service
- Reboot your system
$ checkrestart Found 20 processes using old versions of upgraded files (15 distinct programs) (14 distinct packages) Of these, 12 seem to contain init scripts which can be used to restart them: The following packages seem to have init scripts that could be used to restart them: gpm: 3044 /usr/sbin/gpm rpcbind: 2208 /sbin/rpcbind bind9: 8463 /usr/sbin/named openssh-server: 22124 /usr/sbin/sshd ntp: 4078 /usr/sbin/ntpd tftpd-hpa: 3417 /usr/sbin/in.tftpd uptimed: 2704 /usr/sbin/uptimed cron: 3019 /usr/sbin/cron postfix: 22145 /usr/lib/postfix/qmgr 8892 /usr/lib/postfix/master hddtemp: 3174 /usr/sbin/hddtemp autofs: 2792 /usr/sbin/automount openbsd-inetd: 3254 /usr/sbin/inetd These are the init scripts: service gpm restart service rpcbind restart service bind9 restart service ssh restart service ntp restart service tftpd-hpa restart service uptimed restart service cron restart service postfix restart service hddtemp restart service autofs restart service openbsd-inetd restart These processes do not seem to have an associated init script to restart them: isc-dhcp-client: 3775 /sbin/dhclient