]> code.citadel.org Git - citadel.git/blobdiff - citadel/server_main.c
* Got Citadel talking to LDAP. Still requires manual creation of schema
[citadel.git] / citadel / server_main.c
index 10b61cf590ed3251e1898e19f7ecd11eff16f7a2..5dcc778fe1863a81969ac674f63e05368475900b 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
+#include <syslog.h>
 
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
@@ -35,7 +36,6 @@
 #include <pwd.h>
 #include <errno.h>
 #include <stdarg.h>
-#include <syslog.h>
 #include <grp.h>
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
@@ -90,6 +90,15 @@ int main(int argc, char **argv)
                        chmod(tracefile, 0600);
                }
 
+               else if (!strncmp(argv[a], "-l", 2)) {
+                       safestrncpy(tracefile, argv[a], sizeof tracefile);
+                       strcpy(tracefile, &tracefile[2]);
+                       syslog_facility = SyslogFacility(tracefile);
+                       if (syslog_facility >= 0) {
+                               openlog("citadel", LOG_PID, syslog_facility);
+                       }
+               }
+
                /* run in the background if -d was specified */
                else if (!strcmp(argv[a], "-d")) {
                        start_daemon( (strlen(tracefile) > 0) ? 0 : 1 ) ;
@@ -119,7 +128,9 @@ int main(int argc, char **argv)
                /* any other parameter makes it crash and burn */
                else {
                        lprintf(1,      "citserver: usage: "
-                                       "citserver [-tTraceFile] [-d] [-f]"
+                                       "citserver [-tTraceFile] "
+                                       "[-lLogFacility] "
+                                       "[-d] [-f]"
                                        " [-xLogLevel] [-hHomeDir]\n");
                        exit(1);
                }
@@ -127,18 +138,18 @@ int main(int argc, char **argv)
        }
 
        /* Tell 'em who's in da house */
-       lprintf(1,
-               "\n\n*** Citadel/UX messaging server engine v%d.%02d ***\n"
-               "Copyright (C) 1987-2003 by the Citadel/UX development team.\n"
-               "This program is distributed under the terms of the GNU "
-               "General Public License.\n\n",
+       lprintf(1, "\n");
+       lprintf(1, "\n");
+       lprintf(1,"*** Citadel/UX messaging server engine v%d.%02d ***\n",
                (REV_LEVEL/100),
-               (REV_LEVEL%100)
-       );
+               (REV_LEVEL%100) );
+       lprintf(1,"Copyright (C) 1987-2003 by the Citadel/UX development team.\n");
+       lprintf(1,"This program is distributed under the terms of the GNU ");
+       lprintf(1,"General Public License.\n");
+       lprintf(1, "\n");
 
        /* Initialize... */
        init_sysdep();
-       openlog("citserver", LOG_PID, LOG_USER);
 
        /* Load site-specific parameters, and set the ipgm secret */
        lprintf(7, "Loading citadel.config\n");