summaryrefslogtreecommitdiff
path: root/server/main.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1988-06-25 12:53:05 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1988-06-25 12:53:05 +0000
commita841abe106009d2ac96baaf4344ab1f735f1c968 (patch)
treea5283d2bb1eafcb44abfa18e44a00c0b4efa91ac /server/main.c
parenta9046fb8ca40ed69c505b3aa4e1f8a5daff05d1b (diff)
update version number to 3.0
add reset support
Diffstat (limited to 'server/main.c')
-rw-r--r--server/main.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/server/main.c b/server/main.c
index 66cb2be..d0c837f 100644
--- a/server/main.c
+++ b/server/main.c
@@ -25,9 +25,9 @@ char concurrent[] = "no brain-dump concurrency";
#endif SABER
#endif lint
#ifdef DEBUG
-char version[] = "Zephyr Server (DEBUG) 2.7";
+char version[] = "Zephyr Server (DEBUG) 3.0";
#else
-char version[] = "Zephyr Server 2.7";
+char version[] = "Zephyr Server 3.0";
#endif DEBUG
/*
* Server loop for Zephyr.
@@ -80,12 +80,15 @@ char version[] = "Zephyr Server 2.7";
#define EVER (;;) /* don't stop looping */
static int do_net_setup(), initialize();
-static void usage();
-static int bye(), dbug_on(), dbug_off(), dump_db();
+static void usage(), do_reset();
+static int bye(), dbug_on(), dbug_off(), dump_db(), reset();
#ifndef DEBUG
static void detach();
#endif DEBUG
+static short doreset = 0; /* if it becomes 1, perform
+ reset functions */
+
int srv_socket; /* dgram socket for clients
and other servers */
int bdump_socket = -1; /* brain dump socket fd
@@ -210,10 +213,14 @@ char **argv;
(void) signal(SIGUSR1, dbug_on);
(void) signal(SIGUSR2, dbug_off);
(void) signal(SIGFPE, dump_db);
+ (void) signal(SIGHUP, reset);
/* GO! */
uptime = NOW;
for EVER {
+ if (doreset)
+ do_reset();
+
tvp = &nexthost_tv;
if (nexttimo != 0L) {
nexthost_tv.tv_sec = nexttimo - NOW;
@@ -429,6 +436,24 @@ dump_db()
return(0);
}
+static int
+reset()
+{
+ zdbug((LOG_DEBUG,"reset()"));
+ doreset = 1;
+ return(0);
+}
+
+static void
+do_reset()
+{
+ zdbug((LOG_DEBUG,"do_reset()"));
+ /* reset various things in the server's state */
+ subscr_reset();
+ server_reset();
+ doreset = 0;
+}
+
#ifndef DEBUG
/*
* detach from the terminal