From 147e3914708b7882eb6d68d16bc0d0c6c4b3845a Mon Sep 17 00:00:00 2001 From: wangqing Date: Tue, 14 May 2024 09:52:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=8E=B7=E5=8F=96=E6=9C=8D=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E5=8F=96=E6=B6=88=E6=AD=A3=E5=88=99=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=EF=BC=8C=E6=8F=90=E4=BE=9B=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- ceres/manages/plugin_manage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceres/manages/plugin_manage.py b/ceres/manages/plugin_manage.py index bb96d6c..3eb3627 100644 --- a/ceres/manages/plugin_manage.py +++ b/ceres/manages/plugin_manage.py @@ -100,9 +100,9 @@ class Plugin: str: dead or running """ - code, stdout, _ = execute_shell_command([f"systemctl status {self.rpm_name}", "grep Active"]) + code, stdout, _ = execute_shell_command([f"systemctl show --property ActiveState --property SubState --value {self.rpm_name}"]) if code == CommandExitCode.SUCCEED: - return re.search(r':.+\(', stdout).group()[1:-1].strip() + return stdout LOGGER.error(f'Failed to get service {self.rpm_name} status!') return "" -- Gitee