Sometimes yast2 online_update
will tell me to restart the system as quickly as possible after finishing upgraded, even if it doesn’t, needs-restarting
says something running on the system is outdated. Should I restart the system or logout ?
That depends on what it is.
When it is a user process, it could be sufficient to stop the program and start it again (example: Firefox, I sometimes found out that a running Firefox did show problems, stopping/starting helped). Logging out of course gets all of them, but might be a bit overdone.
When it is a system process (mostly root owned, deamons and other services), an individual systemctl restart
will help, but again, a shutdown will remove all of those.
OTOH, in many cases, the robustness of Unix/Linux will allow to let those programs run without any problems. Because “old” files in use for execution will not be deleted as long as in use (while at the same time the “new” files will be available for new executions starting).
Personally, I will do the YOU when either no users present, or users doing almost nothing. When a reboot is suggested I will obey (and then it is also nice that users are in a state that does not interrupt their workflow to much). So plan a regular (for me weekly) maintenance window that all your users know of and do any patching/updating and other maintenance then without stress.
The SUSE/openSUSE Zypper application has magic powers –
# zypper ps -s
A “normal” user –
> LANG=C zypper ps -s
No processes using deleted files found.
No core libraries or services have been updated since the last system boot.
Reboot is probably not necessary.
Note: Not running as root you are limited to searching for files you have permission to examine with the system stat(2) function. The result might be incomplete.
>
An administration user – actually, I’m using the user “root” –
# LANG=C zypper ps -s
No processes using deleted files found.
No core libraries or services have been updated since the last system boot.
Reboot is probably not necessary.
#
Assuming that, you’ve either patched or updated your system, you’ll be presented with a list of all the processes on your system which are using deleted files – either restart the applications using those files or, in the case of systemd services, restart the affected systemd service(s).
- Please note that, I normally reboot if, the systemd service associated with PID 1 has been either patched or updated:
> ps 1
PID TTY STAT TIME COMMAND
1 ? Ss 0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 30
>
And then, there’s this Zypper command:
> LANG=C zypper needs-rebooting
No core libraries or services have been updated since the last system boot.
Reboot is probably not necessary.
>