Removed old defines.
/*
* SHARED DEFINITIONS - things you should change
*/
+#define DEFAULT_DIRSEP "/"
#define DEFAULT_BINDIR "%BINDIR%"
#define DEFAULT_SBINDIR "%SBINDIR%"
#define DEFAULT_DATADIR "%DATADIR%"
#define DEFAULT_SYSCONFDIR "%SYSCONFDIR%"
#define DEFAULT_LIBEXECDIR "%LIBEXECDIR%"
+#define DEFAULT_RUNDIR "%RUNDIR%"
#define DEFAULT_LDAP_CONF_FILE "%SYSCONFDIR%/ldap.conf"
#define DEFAULT_LDAP_USERRC_FILE "ldaprc"
#define SLAPD_DEFAULT_SIZELIMIT 500
/* default timelimit to spend on a search */
#define SLAPD_DEFAULT_TIMELIMIT 3600
- /* location of the slapd pid file */
-#define SLAPD_PIDFILE "%RUNDIR%/slapd.pid"
-#define SLAPD_PIDDIR "%RUNDIR%/"
+ /* extension of the slapd pid file */
#define SLAPD_PIDEXT ".pid"
- /* location of the slapd args file */
-#define SLAPD_ARGSFILE "%RUNDIR%/slapd.args"
-#define SLAPD_ARGSDIR "%RUNDIR%/"
+ /* extension of the slapd args file */
#define SLAPD_ARGSEXT ".args"
/* dn of the special "monitor" entry */
#define SLAPD_MONITOR_DN "cn=monitor"
/*
* SHARED DEFINITIONS - things you should change
*/
-/*
- * SHARED DEFINITIONS - things you should change
- */
+#define DEFAULT_DIRSEP "\\"
#define DEFAULT_BINDIR "C:\\OpenLDAP\\bin"
#define DEFAULT_SBINDIR "C:\\OpenLDAP\\sbin"
#define DEFAULT_DATADIR "C:\\OpenLDAP\\share"
#define SLAPD_DEFAULT_SIZELIMIT 500
/* default timelimit to spend on a search */
#define SLAPD_DEFAULT_TIMELIMIT 3600
- /* location of the slapd pid file */
-#define SLAPD_PIDFILE "C:\\OpenLDAP\\run\\slapd.pid"
- /* location of the slapd args file */
-#define SLAPD_ARGSFILE "C:\\OpenLDAP\\run\\slapd.args"
+ /* extension of the slapd pid file */
+#define SLAPD_PIDEXT ".pid"
+ /* extension of the slapd args file */
+#define SLAPD_ARGSEXT ".args"
/* dn of the special "monitor" entry */
#define SLAPD_MONITOR_DN "cn=monitor"
/* dn of the special "config" entry */
static void do_nothing (int sig);
/* we need the server's name for constructing the pid/args file names */
-#if defined( SLAPD_PIDFILE ) || defined( SLAPD_ARGSFILE )
+#if defined( SLAPD_PIDEXT ) || defined( SLAPD_ARGSEXT )
extern char *serverName;
#define DEFAULT_SERVERNAME "slapd"
#endif
FILE *fp;
int on = 1;
-#ifdef SLAPD_PIDFILE
+#ifdef SLAPD_PIDEXT
char pidFile[BUFSIZ];
#endif
-#ifdef SLAPD_ARGSFILE
+#ifdef SLAPD_ARGSEXT
char argsFile[BUFSIZ];
#endif
Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
-#if defined( SLAPD_PIDFILE ) || defined( SLAPD_ARGSFILE )
+#if defined( SLAPD_PIDEXT ) || defined( SLAPD_ARGSEXT )
if ( !serverName ) serverName = DEFAULT_SERVERNAME;
-#endif
-#ifdef SLAPD_PIDFILE
- sprintf( pidFile, "%s%s%s", SLAPD_PIDDIR, serverName, SLAPD_PIDEXT );
+#ifdef SLAPD_PIDEXT
+ sprintf( pidFile, "%s%s%s%s", DEFAULT_RUNDIR, DEFAULT_DIRSEP,
+ serverName, SLAPD_PIDEXT );
if ( (fp = fopen( pidFile, "w" )) != NULL ) {
fprintf( fp, "%d\n", (int) getpid() );
fclose( fp );
}
#endif
-#ifdef SLAPD_ARGSFILE
- sprintf( argsFile, "%s%s%s", SLAPD_ARGSDIR, serverName, SLAPD_ARGSEXT );
+#ifdef SLAPD_ARGSEXT
+ sprintf( argsFile, "%s%s%s%s", DEFAULT_RUNDIR, DEFAULT_DIRSEP,
+ serverName, SLAPD_ARGSEXT );
if ( (fp = fopen( argsFile, "w" )) != NULL ) {
for ( i = 0; i < g_argc; i++ ) {
fprintf( fp, "%s ", g_argv[i] );
fclose( fp );
}
#endif
+#endif
+
while ( !slapd_shutdown ) {
struct sockaddr_in from;