Service Restart after Upgrades: Difference between revisions
Jump to navigation
Jump to search
(→Notes) |
(→Notes) |
||
Line 15: | Line 15: | ||
=== Notes === | === Notes === | ||
* Most things can be restarted without creating havoc, in doubt, RTFM. | * Most things can be restarted without creating havoc, in doubt, RTFM. | ||
* If needed <code>systemd</code> itself will have been most likely restarted by post-install package manager hooks/scripts. If you want to force restart the daemon, use <code>sudo systemctl daemon-reexec</code>. However whether or not the daemon was restarted does not mean that <code>systemd</code> related processes do not need to be restarted as well (for instance <code>journald</code>) but these are best restarted via <code>systemctl</code>. | * If needed <code>systemd</code> itself will have been most likely restarted by post-install package manager hooks/scripts. If you want to force restart the daemon, use <code>sudo systemctl daemon-reexec</code>. However whether or not the daemon was restarted does not mean that <code>systemd</code> related processes do not need to be restarted as well (for instance <code>journald</code>) but these are best restarted via <code>systemctl</code>. Just check the output of <code>lsof</code> to see if any of this applies to your situation. | ||
[[Category: System]] | [[Category: System]] |
Revision as of 11:51, 23 January 2019
After updating some software on a Linux machine, some services making use of this software will be restarted to make use of the new version. But most of the time, no. One way to refresh it all is to reboot, but unless there is a kernel update you should not need to do such thing.
Find software that needs to be restarted
You can do that with lsof
and looking for process that have opened files that are now gone. They are still in memory (otherwise said process would be quite unhappy), but they are not the same as they were on disk since the process first opened. That's a sign it has been most likely updated.
sudo lsof | grep lib | grep DEL | awk '{print $1}' | sort | uniq
Restart service
Well, you know... Once you have your list of processes who could do with some refreshing, their name should easily hint at the service you need to restart :)
sudo service whatever restart
Notes
- Most things can be restarted without creating havoc, in doubt, RTFM.
- If needed
systemd
itself will have been most likely restarted by post-install package manager hooks/scripts. If you want to force restart the daemon, usesudo systemctl daemon-reexec
. However whether or not the daemon was restarted does not mean thatsystemd
related processes do not need to be restarted as well (for instancejournald
) but these are best restarted viasystemctl
. Just check the output oflsof
to see if any of this applies to your situation.