along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.100 2001/02/27 16:37:25 guus Exp $
+ $Id: net.c,v 1.35.4.101 2001/03/01 21:32:01 guus Exp $
*/
#include "config.h"
#include "process.h"
#include "protocol.h"
#include "subnet.h"
+#include "process.h"
#include "system.h"
cfg = get_config_val(upstreamcfg, config_connectto); /* Or else we try the next ConnectTo line */
}
- signal(SIGALRM, sigalrm_handler);
- upstreamcfg = config;
- seconds_till_retry = MAXTIMEOUT;
- syslog(LOG_NOTICE, _("Trying to re-establish outgoing connection in %d seconds"), seconds_till_retry);
- alarm(seconds_till_retry);
+ if(do_detach)
+ {
+ signal(SIGALRM, sigalrm_handler);
+ upstreamcfg = config;
+ seconds_till_retry = MAXTIMEOUT;
+ syslog(LOG_NOTICE, _("Trying to re-establish outgoing connection in %d seconds"), seconds_till_retry);
+ alarm(seconds_till_retry);
+ }
+ else
+ return -1;
+
cp
return 0;
}
for(node = connection_tree->head; node; node = node->next)
{
p = (connection_t *)node->data;
+ p->status.outgoing = 0;
p->status.active = 0;
terminate_connection(p);
}
if(read_server_config())
{
syslog(LOG_ERR, _("Unable to reread configuration file, exiting"));
- exit(0);
+ exit(1);
}
sleep(5);
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.20 2001/01/07 17:09:02 guus Exp $
+ $Id: process.c,v 1.1.2.21 2001/03/01 21:32:04 guus Exp $
*/
#include "config.h"
/* No return on success */
if(errno != ENOENT) /* Ignore if the file does not exist */
- exit(-1); /* Some error while trying execl(). */
+ exit(1); /* Some error while trying execl(). */
else
exit(0);
}
{
syslog(LOG_ERR, _("Got another SEGV signal: not restarting"));
cp_trace();
- exit(0);
+ exit(1);
}
RETSIGTYPE
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.h,v 1.1.2.7 2001/01/07 17:09:02 guus Exp $
+ $Id: process.h,v 1.1.2.8 2001/03/01 21:32:04 guus Exp $
*/
#ifndef __TINC_PROCESS_H__
#include "config.h"
+extern int do_detach;
+
extern void setup_signals(void);
extern int execute_script(const char *);
extern int detach(void);
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.44 2001/02/27 16:37:31 guus Exp $
+ $Id: tincd.c,v 1.10.4.45 2001/03/01 21:32:04 guus Exp $
*/
#include "config.h"
/* If nonzero, it will attempt to kill a running tincd and exit. */
static int kill_tincd = 0;
-/* If zero, don't detach from the terminal. */
-extern int do_detach;
-
/* If nonzero, generate public/private keypair for this host/net. */
static int generate_keys = 0;
exit(kill_other());
if(read_server_config())
- return 1;
+ exit(1);
cp
if(detach())
exit(0);
else
{
syslog(LOG_ERR, _("Not restarting."));
- exit(0);
+ exit(1);
}
}
}
-