summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2020-01-07 13:47:42 -0800
committerhagbard <vyosdev@derith.de>2020-01-07 13:47:42 -0800
commit3863e5dc24a622090f52c13f8aa04e5c9f00341a (patch)
tree7f8a3900fff620c13136d7c5acee954ea1aede91
parentc05063bc831047a0afebaca74508479ee4af278c (diff)
downloadvyos-1x-3863e5dc24a622090f52c13f8aa04e5c9f00341a.tar.gz
vyos-1x-3863e5dc24a622090f52c13f8aa04e5c9f00341a.zip
system-syslog: T1938: Firewall logging not working
-rwxr-xr-xsrc/conf_mode/system-syslog.py13
1 files 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: