]> git.sur5r.net Git - openldap/commitdiff
Add -n serviceName (for loggging purposes)
authorKurt Zeilenga <kurt@openldap.org>
Fri, 26 May 2000 19:52:40 +0000 (19:52 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 26 May 2000 19:52:40 +0000 (19:52 +0000)
doc/man/man8/slapd.8
servers/slapd/main.c

index 4c33418c59f657656d70fe27d61645f712279d06..1e353dd3b59aee48c0b25103aaa6e147dd610605 100644 (file)
@@ -9,7 +9,7 @@ slapd \- Stand-alone LDAP Daemon
 .B [\-f slapd\-config\-file]
 .B [\-h URLs]
 .B [\-d debug\-level]
-.B [\-s syslog\-level] [\-l syslog\-local\-user]
+.B [\-n service\-name] [\-s syslog\-level] [\-l syslog\-local\-user]
 .B [\-u user] [\-g group]
 .B 
 .SH DESCRIPTION
@@ -73,6 +73,10 @@ at what level debugging statements should be logged to the
 .BR syslog (8)
 facility.
 .TP
+.BI \-n " service\-name"
+Specifies the service name for logging and other purposes.  Defaults
+to basename of argv[0], i.e.: "slapd".
+.TP
 .BI \-l " syslog\-local\-user"
 Selects the local user of the
 .BR syslog (8)
index bc50274a1e79bb48698c843afccd3b96904036d7..5e877b57f3c782c57f62fad441907a45da9bf15c 100644 (file)
@@ -112,10 +112,7 @@ usage( char *name )
 #ifdef LOG_LOCAL4
                "\t-l sysloguser\tSyslog User (default: LOCAL4)\n"
 #endif
-#ifdef HAVE_NT_EVENT_LOG
-               "\t-n NTserviceName\tNT service name\n"
-#endif
-
+               "\t-n serviceName\tservice name\n"
                "\t-s level\tSyslog Level\n"
 #ifdef SLAPD_BDB2
                "\t-t\t\tEnable BDB2 timing\n"
@@ -146,15 +143,12 @@ int main( int argc, char **argv )
     int     syslogUser = DEFAULT_SYSLOG_USER;
 #endif
 
-#ifdef HAVE_NT_EVENT_LOG
-       char        *NTservice  = SERVICE_NAME;
-#endif
 #ifdef HAVE_NT_SERVICE_MANAGER
        char            *configfile = ".\\slapd.conf";
 #else
        char            *configfile = SLAPD_DEFAULT_CONFIGFILE;
 #endif
-       char        *serverName;
+       char        *serverName = NULL;
        int         serverMode = SLAP_SERVER_MODE;
 
 #ifdef CSRIMALLOC
@@ -209,7 +203,7 @@ int main( int argc, char **argv )
 #endif
 
        while ( (i = getopt( argc, argv,
-                            "d:f:h:s:"
+                            "d:f:h:s:n:"
 #ifdef HAVE_CHROOT
                                "r:"
 #endif
@@ -224,9 +218,6 @@ int main( int argc, char **argv )
 #endif
 #ifdef LDAP_CONNECTIONLESS
                                 "c"
-#endif
-#ifdef HAVE_NT_EVENT_LOG
-                                "n:"
 #endif
                             )) != EOF ) {
                switch ( i ) {
@@ -294,11 +285,11 @@ int main( int argc, char **argv )
                        break;
 #endif /* SETUID && GETUID */
 
-#ifdef HAVE_NT_EVENT_LOG
                case 'n':  /* NT service name */
-                       NTservice = ch_strdup( optarg );
+                       if( serverName != NULL ) free( serverName );
+                       serverName = ch_strdup( optarg );
                        break;
-#endif
+
                default:
                        usage( argv[0] );
                        rc = 1;
@@ -313,10 +304,12 @@ int main( int argc, char **argv )
 
        Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 );
 
-       if ( (serverName = strrchr( argv[0], *LDAP_DIRSEP )) == NULL ) {
-               serverName = ch_strdup( argv[0] );
-       } else {
-               serverName = ch_strdup( serverName + 1 );
+       if( serverName == NULL ) {
+               if ( (serverName = strrchr( argv[0], *LDAP_DIRSEP )) == NULL ) {
+                       serverName = ch_strdup( argv[0] );
+               } else {
+                       serverName = ch_strdup( serverName + 1 );
+               }
        }
 
 #ifdef LOG_LOCAL4