X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=18791cc8b16140c632538845bde3915da92bc969;hp=0b02aad4daef42e92bd62bee3a44f739b96f10d6;hb=394ed3fb174bb629bfb4b441fe58842562f955de;hpb=5d1145f2c4b3b8261ca0aa0e89a2daf321640f0b diff --git a/src/tincd.c b/src/tincd.c index 0b02aad4..18791cc8 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.30 2000/11/16 22:12:23 zarq Exp $ + $Id: tincd.c,v 1.10.4.34 2000/11/22 19:14:09 guus Exp $ */ #include "config.h" @@ -64,6 +64,7 @@ #include "conf.h" #include "net.h" #include "netutl.h" +#include "process.h" #include "protocol.h" #include "subnet.h" @@ -93,11 +94,6 @@ char **g_argv; /* a copy of the cmdline arguments */ char **environment; /* A pointer to the environment on startup */ -void cleanup_and_exit(int); -int kill_other(void); -void make_names(void); -int write_pidfile(void); - static struct option const long_options[] = { { "config", required_argument, NULL, 'c' }, @@ -247,7 +243,7 @@ void make_names(void) if(netname) { if(!pidfilename) - asprintf(&pidfilename, "/var/run/tinc.%s.pid", netname); + asprintf(&pidfilename, LOCALSTATEDIR "/run/tinc.%s.pid", netname); if(!confbase) asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname); else @@ -258,7 +254,7 @@ void make_names(void) else { if(!pidfilename) - pidfilename = "/var/run/tinc.pid"; + pidfilename = LOCALSTATEDIR "/run/tinc.pid"; if(!confbase) asprintf(&confbase, "%s/tinc", CONFDIR); if(!identname) @@ -320,6 +316,8 @@ main(int argc, char **argv, char **envp) if(read_server_config()) return 1; + init_processes(); + if(detach()) exit(0);