1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

samba-tool domain provision: Make ldap_backend_startup.sh +x and take optional arguments

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
This commit is contained in:
Andrew Bartlett 2013-09-16 09:35:39 -07:00 committed by Nadezhda Ivanova
parent ef830f7e71
commit 68f7cd1724

View File

@ -271,12 +271,15 @@ class LDAPBackend(ProvisionBackend):
def start(self):
from samba.provision import ProvisioningError
self.slapd_command_escaped = "\'" + "\' \'".join(self.slapd_command) + "\'"
f = open(os.path.join(self.ldapdir, "ldap_backend_startup.sh"), 'w')
ldap_backend_script = os.path.join(self.ldapdir, "ldap_backend_startup.sh")
f = open(ldap_backend_script, 'w')
try:
f.write("#!/bin/sh\n" + self.slapd_command_escaped + "\n")
f.write("#!/bin/sh\n" + self.slapd_command_escaped + " $@\n")
finally:
f.close()
os.chmod(ldap_backend_script, 0755)
# Now start the slapd, so we can provision onto it. We keep the
# subprocess context around, to kill this off at the successful
# end of the script