From 028394b8a5c6745bbf3ee34ba71d148bca75d247 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 25 Mar 2019 17:16:34 +0100 Subject: Add service configuration reloading This commit add the ability to initd to reload the service configuration while running. The new configuration is merged with the existing one as follows: For each target: - If the existing service list is not NULL, we have not started that target yet. Simply replace it with the new list. - If it is NULL, the services have already been started. - First, remove all entries for services in that target that no loner exist (except from the 'running' list). - Second, add new services that we don't have yet. Treat them as recently diseased and let the user start them manualy. Signed-off-by: David Oberhollenzer --- initd/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'initd/main.c') diff --git a/initd/main.c b/initd/main.c index 2b1a1cc..9cccdc5 100644 --- a/initd/main.c +++ b/initd/main.c @@ -30,6 +30,9 @@ static void handle_signal(void) case SIGINT: supervisor_set_target(TGT_REBOOT); break; + case SIGHUP: + supervisor_reload_config(); + break; case SIGUSR1: if (sockfd >= 0) { close(sockfd); -- cgit v1.2.3