updates.
[silc.git] / apps / silcd / silcd.c
index ed64407f3b5762a27df78aba40c04b8e7982656d..7b0122c448ffc6f276d05ed7ddb7aa0b4125cc70 100644 (file)
@@ -41,7 +41,7 @@ silc_server_create_key_pair(char *pkcs_name, int bits, char *path,
 static struct option long_opts[] = 
 {
   { "config-file", 1, NULL, 'f' },
-  { "debug", 0, NULL, 'd' },
+  { "debug", 1, NULL, 'd' },
   { "help", 0, NULL, 'h' },
   { "version", 0, NULL,'V' },
 
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
 
   /* Parse command line arguments */
   if (argc > 1) {
-    while ((opt = getopt_long(argc, argv, "cf:dhVC:",
+    while ((opt = getopt_long(argc, argv, "cf:d:hVC:",
                              long_opts, &option_index)) != EOF) {
       switch(opt) 
        {
@@ -125,6 +125,7 @@ int main(int argc, char **argv)
          break;
        case 'd':
          silc_debug = TRUE;
+         silc_log_set_debug_string(optarg);
          break;
        case 'f':
          config_file = strdup(optarg);
@@ -200,10 +201,10 @@ int main(int argc, char **argv)
     silc_server_daemonise(silcd);
 
   /* Set /var/run/silcd.pid */
-  unlink("/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("/var/run/silcd.pid", pid, strlen(pid));
+  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. */