summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-04-17 03:47:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:50:57 -0500
commitbcf43e1eb05cfe5a304b6ebe92cce56e8d976a5c (patch)
treeeaaefef105879059e18465a8e02d94a84b0080fd /source4/script
parented4df962f46e9d06d90decf9ae1a870fdd38837e (diff)
downloadsamba-bcf43e1eb05cfe5a304b6ebe92cce56e8d976a5c.tar.gz
samba-bcf43e1eb05cfe5a304b6ebe92cce56e8d976a5c.tar.bz2
samba-bcf43e1eb05cfe5a304b6ebe92cce56e8d976a5c.zip
r22292: Start the LDAP server inside the same fifo as smbd, as OpenLDAP (like
smbd, but not Fedora DS yet) will then shut down when it looses stdin. This avoids leaving stray slapd processes around, if we don't finish the script to run the kill. Also set KRB5_CONFIG in the smbd process again, as we do actually need this... Andrew Bartlett (This used to be commit 24ca1e180c9c35f0e87d49c9c8f8b936b4c88572)
Diffstat (limited to 'source4/script')
-rw-r--r--source4/script/tests/Samba4.pm35
1 files changed, 19 insertions, 16 deletions
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm
index 4f8c0877ae..6999e049bb 100644
--- a/source4/script/tests/Samba4.pm
+++ b/source4/script/tests/Samba4.pm
@@ -67,32 +67,35 @@ sub check_or_start($$$)
my ($self, $env_vars, $max_time) = @_;
return 0 if ( -p $env_vars->{SMBD_TEST_FIFO});
- # Start slapd before smbd
- if (defined($self->{ldap})) {
- $self->slapd_start($env_vars) or
- die("couldn't start slapd");
-
- print "LDAP PROVISIONING...";
- $self->provision_ldap($env_vars);
- }
-
- SocketWrapper::set_default_iface(1);
-
unlink($env_vars->{SMBD_TEST_FIFO});
POSIX::mkfifo($env_vars->{SMBD_TEST_FIFO}, 0700);
unlink($env_vars->{SMBD_TEST_LOG});
- my $valgrind = "";
- if (defined($ENV{SMBD_VALGRIND})) {
- $valgrind = $ENV{SMBD_VALGRIND};
- }
-
print "STARTING SMBD... ";
my $pid = fork();
if ($pid == 0) {
open STDIN, $env_vars->{SMBD_TEST_FIFO};
open STDOUT, ">$env_vars->{SMBD_TEST_LOG}";
open STDERR, '>&STDOUT';
+
+ SocketWrapper::set_default_iface(1);
+
+ # Start slapd before smbd, but with the fifo on stdin
+ if (defined($self->{ldap})) {
+ $self->slapd_start($env_vars) or
+ die("couldn't start slapd");
+
+ print "LDAP PROVISIONING...";
+ $self->provision_ldap($env_vars);
+ }
+
+ my $valgrind = "";
+ if (defined($ENV{SMBD_VALGRIND})) {
+ $valgrind = $ENV{SMBD_VALGRIND};
+ }
+
+ $ENV{KRB5_CONFIG} = $env_vars->{KRB5_CONFIG};
+
my $optarg = "";
if (defined($max_time)) {
$optarg = "--maximum-runtime=$max_time ";