Closed YoruStar closed 1 year ago
If there was any other signal that is by default ignored we could use that to signal the reload. The only such signal is SIGURG which is in POSIX1.2001 only. I assume we could use it as we do not use sockets so it should not be received spuriously.
On the other hand, why do you call restart and reload simultaneously?
Hello, I found something wrong with my crond service
Execute the commands
systemctl restart crond
andsystemctl reload crond
at the same time , The cond service occasionally shows statusActive: deactivating
.When the command
systemctl reload crond
is executed, systemd will send theHUP
to the crond process. Under normal circumstances, the crond process will modify the behavior of theHUP
signal (without interrupting the process, and only record the received signal in the global variable). However, after executing the commandsystemctl restart crond
, the crond process received the HUP signal sent by the commandsystemctl reload crond
before it could modify the HUP signal behavior just after the crond process was started, which caused the crond process to be interrupted, so the crond service status appears asActive: deactivating
.I try to add a dead loop at the beginning of the main function of the crond service to reproduce this situation
Replace process to
/usr/sbin/crond
, Execute the commandssystemctl restart crond
andsystemctl reload crond
successively, the result as followsI also tried to change the
Type
ofcron.service
toforking
, and set thePIDFile
to/var/run/cron.pid
, but this seems to be getting worse