X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=b82e951f143ef55ab93709bc7573ffbff39dcb94;hp=a5abc9364a559b5fee5bb19ed1c264765967da86;hb=a3cd273751fdcef90a43108a5d2e669877b0bccb;hpb=5900c07fab39d2833ea66429ad652ca49a91a508 diff --git a/src/process.c b/src/process.c index a5abc936..b82e951f 100644 --- a/src/process.c +++ b/src/process.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: process.c,v 1.1.2.76 2003/10/06 16:13:08 guus Exp $ + $Id: process.c,v 1.1.2.78 2003/12/07 14:29:02 guus Exp $ */ #include "system.h" @@ -257,8 +257,10 @@ static bool write_pidfile(void) } /* if it's locked, write-protected, or whatever */ - if(!write_pid(pidfilename)) + if(!write_pid(pidfilename)) { + fprintf(stderr, _("Could write pid file %s: %s\n"), pidfilename, strerror(errno)); return false; + } return true; } @@ -335,8 +337,10 @@ bool detach(void) /* Now UPDATE the pid in the pidfile, because we changed it... */ - if(!write_pid(pidfilename)) + if(!write_pid(pidfilename)) { + fprintf(stderr, _("Could not write pid file %s: %s\n"), pidfilename, strerror(errno)); return false; + } #else if(!statushandle) exit(install_service()); @@ -427,13 +431,19 @@ bool execute_script(const char *name, char **envp) static RETSIGTYPE sigterm_handler(int a) { logger(LOG_NOTICE, _("Got %s signal"), "TERM"); - running = false; + if(running) + running = false; + else + exit(1); } static RETSIGTYPE sigquit_handler(int a) { logger(LOG_NOTICE, _("Got %s signal"), "QUIT"); - running = false; + if(running) + running = false; + else + exit(1); } static RETSIGTYPE fatal_signal_square(int a)