supervise-daemon: multiple fixes
- Harden against dying by handling all signals that would terminate the program and adding --reexec support - factor the supervisor into its own function - fix test for whether we are already running
This commit is contained in:
@ -217,6 +217,18 @@ signal_setup(int sig, void (*handler)(int))
|
||||
return sigaction(sig, &sa, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
signal_setup_restart(int sig, void (*handler)(int))
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
memset(&sa, 0, sizeof (sa));
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_handler = handler;
|
||||
sa.sa_flags = SA_RESTART;
|
||||
return sigaction(sig, &sa, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
svc_lock(const char *applet)
|
||||
{
|
||||
|
Reference in New Issue
Block a user