You've pushed a code update to a daemontools service and want to restart it so it picks up the changes. The service itself is simple and has no built-in signal handling. Which way is better?
svc -d; sleep 5; svc -usvc -hI've always done some variation on the first, but somebody pointed out today we could actually do the HUP just as well, and I like that better, but I've been doing it the other way so long I can't remember if there was a reason.
I thought it might be because a process in uninterruptible sleep waiting on I/O ignores signals, but according to wikipedia, "When the process is sleeping uninterruptibly, signals accumulated during the sleep will be noticed when the process returns from the system call or trap."
Anybody have an informed opinion on best practice?
It would appear that option 2 (sending a HUP signal) is somewhat cleaner, but in the end, both will get the job done and neither is inherently superior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With