What's the best way to restart the daemontools service?
You have added a code update to the daemontools service and you want to restart it so it picks up the changes. The service itself is simple and does not have built-in signal processing. Which is the best way?
svc -d; sleep 5; svc -u
Sends TERM followed by CONT. Waits for the service to actually exit and then restart it.
Sends a HUP signal. The process will die on receiving a signal, and daemontools will restart it.
I always made some changes in the first one, but someone pointed out that today we can really do HUP just as well and I like it better, but I have been doing it differently for so long, Can't remember if there was a reason.
I thought it might be because a process in uninterrupted sleep waiting for I / O ignores signals, but according to wikipedia , "When a process crashes smoothly, signals accumulated during sleep will be seen when the process returns from a system call. or traps. "
Does anyone have an informed opinion on best practice?
source to share