diff options
Diffstat (limited to 'base/server/python')
| -rw-r--r-- | base/server/python/pki/server/deployment/pkihelper.py | 30 | ||||
| -rw-r--r-- | base/server/python/pki/server/deployment/pkiparser.py | 4 |
2 files changed, 29 insertions, 5 deletions
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py index a84cd0e7b..67519293b 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -3073,7 +3073,13 @@ class Systemd: service = "pki-tomcatd" + "@" +\ self.master_dict['pki_instance_name'] + "." +\ "service" - command = ["systemctl", "start", service] + + if pki.system.SYSTEM_TYPE == "debian": + command = ["/etc/init.d/pki-tomcatd", "start", + self.master_dict['pki_instance_name']] + else: + command = ["systemctl", "start", service] + # Display this "systemd" execution managment command config.pki_log.info( log.PKIHELPER_SYSTEMD_COMMAND_1, ' '.join(command), @@ -3081,6 +3087,9 @@ class Systemd: # Execute this "systemd" execution management command subprocess.check_call(command) except subprocess.CalledProcessError as exc: + if pki.system.SYSTEM_TYPE == "debian": + if exc.returncode == 6: + return config.pki_log.error(log.PKI_SUBPROCESS_ERROR_1, exc, extra=config.PKI_INDENTATION_LEVEL_2) if critical_failure == True: @@ -3099,7 +3108,13 @@ class Systemd: service = "pki-tomcatd" + "@" +\ self.master_dict['pki_instance_name'] + "." +\ "service" - command = ["systemctl", "stop", service] + + if pki.system.SYSTEM_TYPE == "debian": + command = ["/etc/init.d/pki-tomcatd", "stop", + self.master_dict['pki_instance_name']] + else: + command = ["systemctl", "stop", service] + # Display this "systemd" execution managment command config.pki_log.info( log.PKIHELPER_SYSTEMD_COMMAND_1, ' '.join(command), @@ -3125,7 +3140,13 @@ class Systemd: service = "pki-tomcatd" + "@" +\ self.master_dict['pki_instance_name'] + "." +\ "service" - command = ["systemctl", "restart", service] + + if pki.system.SYSTEM_TYPE == "debian": + command = ["/etc/init.d/pki-tomcatd", "restart", + self.master_dict['pki_instance_name']] + else: + command = ["systemctl", "restart", service] + # Display this "systemd" execution managment command config.pki_log.info( log.PKIHELPER_SYSTEMD_COMMAND_1, ' '.join(command), @@ -3133,6 +3154,9 @@ class Systemd: # Execute this "systemd" execution management command subprocess.check_call(command) except subprocess.CalledProcessError as exc: + if pki.system.SYSTEM_TYPE == "debian": + if exc.returncode == 6: + return config.pki_log.error(log.PKI_SUBPROCESS_ERROR_1, exc, extra=config.PKI_INDENTATION_LEVEL_2) if critical_failure == True: diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py index dba1f50f1..9bce634f9 100644 --- a/base/server/python/pki/server/deployment/pkiparser.py +++ b/base/server/python/pki/server/deployment/pkiparser.py @@ -163,14 +163,14 @@ class PKIConfigParser: # RESTEasy resteasy_lib = subprocess.check_output( - 'source /etc/pki/pki.conf && echo $RESTEASY_LIB', + '. /etc/pki/pki.conf && echo $RESTEASY_LIB', shell=True) # workaround for pylint error E1103 resteasy_lib = str(resteasy_lib).strip() # JNI jar location jni_jar_dir = subprocess.check_output( - 'source /usr/share/pki/etc/pki.conf && echo $JNI_JAR_DIR', + '. /usr/share/pki/etc/pki.conf && echo $JNI_JAR_DIR', shell=True) # workaround for pylint error E1103 jni_jar_dir = str(jni_jar_dir).strip() |
