From 68f7cd1724480a9bae36692d19b94e10fb1b9e73 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 Sep 2013 09:35:39 -0700 Subject: samba-tool domain provision: Make ldap_backend_startup.sh +x and take optional arguments Signed-off-by: Andrew Bartlett Reviewed-by: Nadezhda Ivanova --- python/samba/provision/backend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py index f88b0db89c..3fe947fdbe 100644 --- a/python/samba/provision/backend.py +++ b/python/samba/provision/backend.py @@ -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 -- cgit