X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=75482357b3d2fdff5c2752da6a03118ed01d3b4c;hp=a06f3fe37fbddad06c53269b854e356e3d637d79;hb=8fa9bc017d89b53798903df3fa98311067d4de90;hpb=52b842f8076d507d3a6ea07045d085ae21d1aa10 diff --git a/src/tincd.c b/src/tincd.c index a06f3fe3..75482357 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: tincd.c,v 1.10.4.15 2000/10/21 11:52:08 guus Exp $ + $Id: tincd.c,v 1.10.4.19 2000/10/29 09:19:27 guus Exp $ */ #include "config.h" @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef HAVE_SYS_IOCTL_H # include @@ -43,10 +44,10 @@ #include #include "conf.h" -#include "encr.h" #include "net.h" #include "netutl.h" #include "protocol.h" +#include "subnet.h" #include "system.h" @@ -118,8 +119,7 @@ parse_options(int argc, char **argv, char **envp) { int r; int option_index = 0; - config_t *p; - + while((r = getopt_long(argc, argv, "c:Ddkn:K::", long_options, &option_index)) != EOF) { switch(r) @@ -251,7 +251,7 @@ int detach(void) if(pid) /* parent process */ { signal(SIGTERM, parent_exit); -// sleep(600); /* wait 10 minutes */ + sleep(600); /* wait 10 minutes */ exit(1); } } @@ -446,7 +446,7 @@ main(int argc, char **argv, char **envp) { main_loop(); cleanup_and_exit(1); - } + } syslog(LOG_ERR, _("Unrecoverable error")); cp_trace(); @@ -458,7 +458,7 @@ main(int argc, char **argv, char **envp) } else { - syslog(LOG_ERR, _("Aieee! Not restarting.")); + syslog(LOG_ERR, _("Not restarting.")); exit(0); } } @@ -469,6 +469,7 @@ sigterm_handler(int a) { if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("Got TERM signal")); + cleanup_and_exit(0); } @@ -504,7 +505,7 @@ sigsegv_handler(int a) } else { - syslog(LOG_NOTICE, _("Aieee! Not restarting.")); + syslog(LOG_NOTICE, _("Not restarting.")); exit(0); } } @@ -513,7 +514,7 @@ RETSIGTYPE sighup_handler(int a) { if(debug_lvl > DEBUG_NOTHING) - syslog(LOG_NOTICE, _("Got HUP signal, rereading configuration and restarting")); + syslog(LOG_NOTICE, _("Got HUP signal")); sighup = 1; } @@ -534,9 +535,10 @@ sigusr1_handler(int a) RETSIGTYPE sigusr2_handler(int a) { - if(debug_lvl > DEBUG_NOTHING) - syslog(LOG_NOTICE, _("Got USR2 signal, forcing new key generation")); + dump_subnet_list(); /* FIXME: reprogram this. + if(debug_lvl > DEBUG_NOTHING) + syslog(LOG_NOTICE, _("Got USR2 signal, forcing new key generation")); regenerate_keys(); */ }