-rw-r--r-- | src/dudki.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dudki.cc b/src/dudki.cc index b769109..b4e95a7 100644 --- a/src/dudki.cc +++ b/src/dudki.cc | |||
@@ -21,6 +21,7 @@ using namespace std; | |||
21 | #define PCOPY "Copyright (c) 2004 Klever Group" | 21 | #define PCOPY "Copyright (c) 2004 Klever Group" |
22 | 22 | ||
23 | bool finishing = false; | 23 | bool finishing = false; |
24 | bool restarting = false; | ||
24 | static char **_argv = NULL; | 25 | static char **_argv = NULL; |
25 | 26 | ||
26 | static void lethal_signal_handler(int signum) { | 27 | static void lethal_signal_handler(int signum) { |
@@ -29,7 +30,7 @@ static void lethal_signal_handler(int signum) { | |||
29 | } | 30 | } |
30 | static void sighup_handler(int signum) { | 31 | static void sighup_handler(int signum) { |
31 | syslog(LOG_NOTICE,"SUGHUP received, reloading."); | 32 | syslog(LOG_NOTICE,"SUGHUP received, reloading."); |
32 | execvp(_argv[0],_argv); | 33 | restarting = finishing = true; |
33 | } | 34 | } |
34 | 35 | ||
35 | void check_herd(configuration& config) { | 36 | void check_herd(configuration& config) { |
@@ -237,6 +238,8 @@ int main(int argc,char **argv) { | |||
237 | check_herd(config); | 238 | check_herd(config); |
238 | sleep(config.check_interval); | 239 | sleep(config.check_interval); |
239 | } | 240 | } |
241 | if(restarting) | ||
242 | execvp(_argv[0],_argv); | ||
240 | } | 243 | } |
241 | break; | 244 | break; |
242 | default: | 245 | default: |