From 3863e5dc24a622090f52c13f8aa04e5c9f00341a Mon Sep 17 00:00:00 2001 From: hagbard Date: Tue, 7 Jan 2020 13:47:42 -0800 Subject: system-syslog: T1938: Firewall logging not working --- src/conf_mode/system-syslog.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/conf_mode/system-syslog.py b/src/conf_mode/system-syslog.py index 15533afab..2d47cc061 100755 --- a/src/conf_mode/system-syslog.py +++ b/src/conf_mode/system-syslog.py @@ -19,6 +19,7 @@ import sys import os import re +import subprocess import jinja2 from vyos.config import Config @@ -313,15 +314,11 @@ def verify(c): def apply(c): - if not c and os.path.exists('/var/run/rsyslogd.pid'): - os.system("sudo systemctl stop syslog.socket") - os.system("sudo systemctl stop rsyslog") - else: - if not os.path.exists('/var/run/rsyslogd.pid'): - os.system("sudo systemctl start rsyslog >/dev/null") - else: - os.system("sudo systemctl restart rsyslog >/dev/null") + if not c: + subprocess.call(['sudo', 'systemctl', 'stop', 'syslog']) + return 0 + subprocess.call(['sudo', 'systemctl', 'restart', 'syslog']) if __name__ == '__main__': try: -- cgit v1.2.3