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"
#include "conf.h"
#include "net.h"
#include "netutl.h"
+#include "process.h"
#include "protocol.h"
#include "subnet.h"
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' },
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
else
{
if(!pidfilename)
- pidfilename = "/var/run/tinc.pid";
+ pidfilename = LOCALSTATEDIR "/run/tinc.pid";
if(!confbase)
asprintf(&confbase, "%s/tinc", CONFDIR);
if(!identname)
if(read_server_config())
return 1;
+ init_processes();
+
if(detach())
exit(0);