mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
Support for restarting initctl API socket on SIGHUP
This patch adds support for restarting the API socket on SIGHUP, similar to how SysV init and systemd use SIGUSR1 to restart their FIFO or D-Bus. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
b6bd10d960
commit
71ea9e2ea3
2 files changed
+6
-2
No files matched your search
@@ -27,6 +27,8 @@
|
||||
*
|
||||
* SIGHUP
|
||||
* Same effect as init/telinit q, reloads *.conf in /etc/finit.d/
|
||||
* Also restarts API (initctl) socket, like SysV init and systemd
|
||||
* does on USR1 with their FIFO/D-Bus.
|
||||
*
|
||||
* SIGUSR1
|
||||
* Calls shutdown hooks, including HOOK_SHUTDOWN, stops all running
|
||||
@@ -236,6 +238,10 @@ static void sighup_cb(uev_t *w, void *arg, int events)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Restart initctl API domain socket, similar to systemd/SysV init */
|
||||
api_exit();
|
||||
api_init(w->ctx);
|
||||
|
||||
/* INIT_CMD_RELOAD: 'init q', 'initctl reload', and SIGHUP */
|
||||
service_reload_dynamic();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user