r21739: Make it easy to change the log level for the slapd processes, and have
authorAndrew Bartlett <abartlet@samba.org>
Wed, 7 Mar 2007 05:29:12 +0000 (05:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:49:21 +0000 (14:49 -0500)
the logs go to a file.

Andrew Bartlett
(This used to be commit 9aaa19319718a5a8fcc1df066cbce67eaa3431d8)

source4/script/tests/Samba4.pm
source4/script/tests/mk-fedora-ds.sh
source4/script/tests/mk-openldap.sh

index f81d75ffd39fb7c02ffb4b764503a5a67d4b3b4d..99e329e7b980a7c2e9a55f5a41f442d3831b4d34 100644 (file)
@@ -15,15 +15,15 @@ use POSIX;
 
 sub slapd_start($$)
 {
-       my ($conf, $uri) = @_;
+       my ($conf, $uri, $loglevel) = @_;
        # running slapd in the background means it stays in the same process group, so it can be
        # killed by timelimit
        if (defined($ENV{FEDORA_DS_PREFIX})) {
-               system("$ENV{FEDORA_DS_PREFIX}/sbin/ns-slapd -D $ENV{FEDORA_DS_DIR} -d0 &");
+               system("$ENV{FEDORA_DS_PREFIX}/sbin/ns-slapd -D $ENV{FEDORA_DS_DIR} -d$ENV{FEDORA_DS_LOGLEVEL} > $ENV{LDAPDIR}/logs 2>&1 &");
        } else {
                my $oldpath = $ENV{PATH};
                $ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}";
-               system("slapd -d0 -f $conf -h $uri &");
+               system("slapd -d$ENV{OPENLDAP_LOGLEVEL} -f $conf -h $uri > $ENV{LDAPDIR}/logs 2>&1 &");
                $ENV{PATH} = $oldpath;
        }
        return 1;
index 4c8732971ca0e2312462bf3eece7065f6704c430..a36e7defeef8ef8a6b786704450c0904ff9badd2 100755 (executable)
@@ -1,6 +1,8 @@
 FEDORA_DS_INF=$LDAPDIR/fedorads.inf
 FEDORA_DS_INITIAL_LDIF=$LDAPDIR/fedorads-initial.ldif
 
+echo "FEDORA_DS_LOGLEVEL=0"
+
 #Make the subdirectory be as fedora DS would expect
 FEDORA_DS_DIR=$LDAPDIR/slapd-samba4
 echo FEDORA_DS_DIR=$FEDORA_DS_DIR
index 0533d46a6624d9654246c30c90e180eafc79b643..d58ce7480d2941632dd33d29c53c92fadbfccca9 100755 (executable)
@@ -1,6 +1,8 @@
 SLAPD_CONF=$LDAPDIR/slapd.conf
 export SLAPD_CONF
 
+echo "OPENLDAP_LOGLEVEL=0"
+
 cat >$SLAPD_CONF <<EOF
 loglevel 0