updates
[silc.git] / apps / silcd / silcd.c
index 2c8914cd609eaf521f78eb5b138619a416db6e34..abc53ac7064f3480409b533c8f3347040573863a 100644 (file)
@@ -2,7 +2,7 @@
 
   silcd.c
   
-  Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+  Author: Pekka Riikonen <priikone@silcnet.org>
 
   Copyright (C) 1997 - 2001 Pekka Riikonen
 
@@ -37,8 +37,6 @@ silc_server_create_key_pair(char *pkcs_name, int bits, char *path,
                            SilcPublicKey *ret_pub_key,
                            SilcPrivateKey *ret_prv_key);
 
-SILC_MUTEX_DEFINE(testi);
-
 /* Long command line options */
 static struct option long_opts[] = 
 {
@@ -104,6 +102,7 @@ int main(int argc, char **argv)
   char *config_file = NULL;
   SilcServer silcd;
   struct sigaction sa;
+  char pid[10];
 
   silc_debug = FALSE;
 
@@ -121,7 +120,7 @@ int main(int argc, char **argv)
                 "version %s (base: SILC Toolkit %s)\n",
                  silc_dist_version, silc_version);
          printf("(c) 1997 - 2001 Pekka Riikonen "
-                "<priikone@poseidon.pspt.fi>\n");
+                "<priikone@silcnet.org>\n");
          exit(0);
          break;
        case 'd':
@@ -199,6 +198,12 @@ int main(int argc, char **argv)
     /* Before running the server, fork to background and set
        both user and group no non-root */    
     silc_server_daemonise(silcd);
+
+  /* Set /var/run/silcd.pid */
+  unlink(SILC_SERVER_PID_FILE);
+  memset(pid, 0, sizeof(pid));
+  snprintf(pid, sizeof(pid) - 1, "%d\n", getpid());
+  silc_file_writefile(SILC_SERVER_PID_FILE, pid, strlen(pid));
   
   /* Run the server. When this returns the server has been stopped
      and we will exit. */