diff options
author | hagbard <vyosdev@derith.de> | 2019-04-25 13:09:20 -0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-05-26 15:14:02 +0200 |
commit | b4b00cb88810ad50d3fc24b0da3a58ef7cf2df9c (patch) | |
tree | 2a3cbb1b46c2a2e9e4fc85388e379b4bd4c68976 /src/conf_mode | |
parent | 4d54708384bf9dc862fef5d35d4bbc4b9200bd86 (diff) | |
download | vyos-1x-b4b00cb88810ad50d3fc24b0da3a58ef7cf2df9c.tar.gz vyos-1x-b4b00cb88810ad50d3fc24b0da3a58ef7cf2df9c.zip |
[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
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/syslog.py | 13 |
1 files changed, 3 insertions, 10 deletions
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() |