Reload config file, not restart on SIGHUP
KAction opened this issue · 3 comments
Conventionally, unix daemons reload their config files on sighup. Laminar does otherwise -- it terminates.
Any change to get it to follow the convention?
I just stumbled upon it when I got job that refreshes SSL certificates and sighup all daemons on multiple systems. One of them was the system that was running laminar itself. I worked around by excluding Laminar, but having all daemons behave same way would be awesome.
Thank you again for your work!
Conventionally, unix daemons reload their config files on sighup.
While common, this is definitely not universal. Apache, for instance, uses SIGUSR1
to reload config.
Laminar does otherwise -- it terminates.
Of course, this is the default action for SIGHUP
.
sighup all daemons
Out of interest, how do you implement this? How do you know which processes are "daemons", and avoid e.g. sending HUP
to a currently running job (child process) of laminard
? Seems a safer option would be to explicitly list the processes which need to be reloaded when certs are updated....
All that being said, ignoring SIGHUP
is a reasonable thing for a daemon process to do, so laminard
could do that. It does not need a "reload config" action.
sighup all daemons
Out of interest, how do you implement this? How do you know which processes are "daemons", and avoid e.g. sending
HUP
to a currently running job (child process) oflaminard
? Seems a safer option would be to explicitly list the processes which need to be reloaded when certs are updated....
I use runit(8) supervision suite. Every daemon managed by runsvdir(8) has directory in /service, so you can do mass operations with sv hup /service/*
. Or sv hup /service/nginx-*
, using flexibility of shell patterns.
=> http://smarden.org/runit/sv.8.html
All that being said, ignoring
SIGHUP
is a reasonable thing for a daemon process to do, solaminard
could do that. It does not need a "reload config" action.
Fair enough, although I would write 'Laminar don't have config to reload, SIGHUP is ignored' on stderr on sighup. That would have saved me from half-an-hour to hour of debugging today.