summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2004-07-21 20:59:33 (UTC)
committer Michael Krelin <hacker@klever.net>2004-07-21 20:59:33 (UTC)
commit4b2d32eca61f62bfd1370fd64254514152ecd23c (patch) (unidiff)
treeab7d32f4b1572a33d1384d3127495feaea3978b4
parent5e437102c59f4544e3803598eabcb643d403272d (diff)
downloaddudki-4b2d32eca61f62bfd1370fd64254514152ecd23c.zip
dudki-4b2d32eca61f62bfd1370fd64254514152ecd23c.tar.gz
dudki-4b2d32eca61f62bfd1370fd64254514152ecd23c.tar.bz2
more civilized restart, bumped up version.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--NEWS3
-rw-r--r--configure.ac2
-rw-r--r--src/dudki.cc5
3 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index efd0c31..b6a3774 100644
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,5 @@
10.1
2 - initgroups() before executing RestartCommand.
3 - more civilized restart.
10.0 40.0
2 - Initial release. 5 - Initial release.
diff --git a/configure.ac b/configure.ac
index 8a2a10b..8521a34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1AC_INIT([dudki], [0.0], [dudki-bugs@klever.net]) 1AC_INIT([dudki], [0.1], [dudki-bugs@klever.net])
2AC_CONFIG_SRCDIR([src/dudki.cc]) 2AC_CONFIG_SRCDIR([src/dudki.cc])
3AC_CONFIG_HEADER([config.h]) 3AC_CONFIG_HEADER([config.h])
4AM_INIT_AUTOMAKE([dist-bzip2]) 4AM_INIT_AUTOMAKE([dist-bzip2])
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
23bool finishing = false; 23bool finishing = false;
24bool restarting = false;
24static char **_argv = NULL; 25static char **_argv = NULL;
25 26
26static void lethal_signal_handler(int signum) { 27static void lethal_signal_handler(int signum) {
@@ -29,7 +30,7 @@ static void lethal_signal_handler(int signum) {
29} 30}
30static void sighup_handler(int signum) { 31static 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
35void check_herd(configuration& config) { 36void 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: