From c57528b1ce88c0174674b8cdc8fc1293bc1fe49c Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jan 16 2019 18:08:41 +0000 Subject: Ticket 50169 - lib389 changed hardcoded systemctl path Description: Currently the server is using "/usr/bin/systemctl", but this fails on Debian. There is no need for a path anyway so jsut strip it. https://pagure.io/389-ds-base/issue/50169 Reviewed by: mhonek(Thanks!) --- diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py index bd5e86a..974e218 100644 --- a/src/lib389/lib389/__init__.py +++ b/src/lib389/lib389/__init__.py @@ -1206,9 +1206,9 @@ class DirSrv(SimpleLDAPObject, object): if self.with_systemd() and not self.containerised: # Do systemd things here ... - subprocess.check_call(["/usr/bin/systemctl", - "start", - "dirsrv@%s" % self.serverid]) + subprocess.check_call(["systemctl", + "start", + "dirsrv@%s" % self.serverid]) else: # Start the process. # Wait for it to terminate @@ -1269,9 +1269,9 @@ class DirSrv(SimpleLDAPObject, object): if self.with_systemd() and not self.containerised: # Do systemd things here ... - subprocess.check_call(["/usr/bin/systemctl", - "stop", - "dirsrv@%s" % self.serverid]) + subprocess.check_call(["systemctl", + "stop", + "dirsrv@%s" % self.serverid]) else: # TODO: Make the pid path in the files things # TODO: use the status call instead!!!! @@ -1296,9 +1296,9 @@ class DirSrv(SimpleLDAPObject, object): """ if self.with_systemd() and not self.containerised: # Do systemd things here ... - rc = subprocess.call(["/usr/bin/systemctl", - "is-active", "--quiet", - "dirsrv@%s" % self.serverid]) + rc = subprocess.call(["systemctl", + "is-active", "--quiet", + "dirsrv@%s" % self.serverid]) if rc == 0: return True # This .... probably will mess something up diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py index d8c513e..1e3e891 100644 --- a/src/lib389/lib389/instance/setup.py +++ b/src/lib389/lib389/instance/setup.py @@ -714,9 +714,9 @@ class SetupDs(object): # If we are on the correct platform settings, systemd if general['systemd'] and not self.containerised: # Should create the symlink we need, but without starting it. - subprocess.check_call(["/usr/bin/systemctl", - "enable", - "dirsrv@%s" % slapd['instance_name']]) + subprocess.check_call(["systemctl", + "enable", + "dirsrv@%s" % slapd['instance_name']]) # Setup tmpfiles_d tmpfile_d = ds_paths.tmpfiles_d + "/dirsrv-" + slapd['instance_name'] + ".conf"