Within CentOS-7 does a change in the options within /etc/systemd/system.conf of systemd require a reboot or will "systemctl daemon-reload" suffice?
3 Answers
No, daemon-reload will reload all unit files, not the configuration for systemd itself. However, # systemctl daemon-reexec will re-execute systemd and cause it to digest its new configuration in the process.
From the systemctl man page:
daemon-reexec
Reexecute the systemd manager. This will serialize the manager
state, reexecute the process and deserialize the state again. This
command is of little use except for debugging and package upgrades.
Sometimes, it might be helpful as a heavy-weight daemon-reload.
While the daemon is being reexecuted, all sockets systemd listening
on behalf of user configuration will stay accessible.
When the man page says daemon-reexec is useful for package upgrades, it in large part means that this command executes whatever new binaries there are and re-processes its configs. HOWEVER, the RPM that we use to upgrade systemd already contains a script to do this, so it is usually never needed in the case of a normal upgrade.
Or you can reboot. Either will do.
- 7,126
Had a good look at getting this working, you need to restart the services as well on the server :(
First the command above:
systemctl daemon-reexec
then:
systemctl system.slice restart
Once done, its done, but am wondering about the overhead of this running all the time.
- 1
-
One would not run this all the time, but only when it is necessary to restart systemd and rebooting is not preferable. – Michael Hampton Sep 16 '20 at 00:31
For me systemctl daemon-reload throwed an error Unknown command verb deamon-realod. because some unit files had windows \r\n linebreaks in them.
Simply using
apt install dos2unix
and
dos2unix myfile.service
on all the files i changed fixed the issue.
- 101
systemctl try-restart. – Michael Hampton Sep 28 '16 at 02:45systemd? – Motivated Feb 03 '19 at 03:31systemctl daemon-reexecandsystemctl try-restart? Additionally, do either result in processes being disrupted if they are in the middle of processing requests? – Motivated Feb 03 '19 at 03:39libcis not a service, rather the GNU C Library, which is linked by almost all linux executable. So, after alibcupgrade, you should restart any running program/process; the easier method is to reboot the machine. – shodanshok Feb 03 '19 at 08:11