/*
- * $Id: comm.cc,v 1.77 1996/09/20 20:27:33 wessels Exp $
+ * $Id: comm.cc,v 1.78 1996/09/24 19:50:07 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
ftpServerClose();
dnsShutdownServers();
redirectShutdownServers();
- setSocketShutdownLifetimes();
+ if (shutdown_pending > 0)
+ setSocketShutdownLifetimes(Config.lifetimeShutdown);
+ else
+ setSocketShutdownLifetimes(0);
}
nfds = 0;
maxfd = fdstat_biggest_fd() + 1;
/*
- * $Id: main.cc,v 1.85 1996/09/20 23:26:57 wessels Exp $
+ * $Id: main.cc,v 1.86 1996/09/24 19:50:08 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
%s\n\
-h Print help message.\n\
-i Disable IP caching.\n\
- -k reconfigure|rotate|shutdown|kill|debug|check\n\
+ -k reconfigure|rotate|shutdown|interrupt|kill|debug|check\n\
Send signal to running copy and exit.\n\
-s Enable logging to syslog.\n\
-u port Specify ICP port number (default: %d), disable with 0.\n\
opt_send_signal = SIGUSR2;
else if (!strncmp(optarg, "shutdown", strlen(optarg)))
opt_send_signal = SIGTERM;
+ else if (!strncmp(optarg, "interrupt", strlen(optarg)))
+ opt_send_signal = SIGINT;
else if (!strncmp(optarg, "kill", strlen(optarg)))
opt_send_signal = SIGKILL;
else if (!strncmp(optarg, "check", strlen(optarg)))
void
shut_down(int sig)
{
+ shutdown_pending = sig == SIGINT ? -1 : 1;
debug(21, 1, "Preparing for shutdown after %d connections\n",
ntcpconn + nudpconn);
debug(21, 1, "Waiting %d seconds for active connections to finish\n",
- Config.lifetimeShutdown);
- shutdown_pending = 1;
+ shutdown_pending > 0 ? Config.lifetimeShutdown : 0);
#if SA_RESETHAND == 0
signal(SIGTERM, SIG_DFL);
signal(SIGINT, SIG_DFL);
/*
- * $Id: tools.cc,v 1.63 1996/09/20 23:27:01 wessels Exp $
+ * $Id: tools.cc,v 1.64 1996/09/24 19:50:10 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
}
void
-setSocketShutdownLifetimes(void)
+setSocketShutdownLifetimes(int lft)
{
FD_ENTRY *f = NULL;
- int lft = Config.lifetimeShutdown;
int cur;
int i;
for (i = fdstat_biggest_fd(); i >= 0; i--) {