From dcb9f521f9f6dbb98df8f644009c05342f596b5a Mon Sep 17 00:00:00 2001 From: hagbard Date: Thu, 25 Apr 2019 13:09:20 -0700 Subject: [rsyslogd] T1355 - rsyslog stopped after reboot or clean start - rsyslog appears now to be started via systemd automatically, checking for the pid to avoid restart race condition between systemd vyos conf script --- src/conf_mode/syslog.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/syslog.py b/src/conf_mode/syslog.py index d600146f3..c8541a4a0 100755 --- a/src/conf_mode/syslog.py +++ b/src/conf_mode/syslog.py @@ -279,19 +279,12 @@ def verify(c): raise ConfigError('Invalid logging level ' + s + ' set in '+ conf + ' ' + item) def apply(c): - ### vyatta-log.conf is being generated somewhere - ### this is just a quick hack to remove the old configfile - - if c == None: - ### systemd restarts it, using kill - #os.system("sudo systemctl stop rsyslog >/dev/null 2>&1") - print ("systemd sends messages to rsyslog, rsyslog won't be stopped") + if not os.path.exits('/var/run/rsyslogd.pid'): + os.system("sudo systemctl start rsyslog >/dev/null") else: - if os.path.exists('/etc/rsyslog.d/vyatta-log.conf'): - os.remove('/etc/rsyslog.d/vyatta-log.conf') - os.system("sudo systemctl restart rsyslog >/dev/null") + if __name__ == '__main__': try: c = get_config() -- cgit v1.2.3