syslog: if /var/run/legacy_log is being created while syslog-ng is booting, it sometimes leads to crashes/dumps of the latter. make sure the socket exists before asking syslog-ng to start

This commit is contained in:
Ad Schellevis 2020-03-13 15:24:00 +01:00
parent 5d99be7c0c
commit cda4e3561f

View File

@ -674,8 +674,12 @@ EOD;
}
} else {
killbypid('/var/run/syslog.pid', 'TERM', true);
@unlink("/var/run/legacy_log");
mwexecf("/usr/sbin/service syslog-ng stop");
mwexecf("/usr/local/sbin/syslogd -s -c -c -P %s {$syslogd_extra}", '/var/run/syslog.pid');
while (count(glob("/var/run/legacy_log")) == 0) {
sleep(0.1);
}
mwexecf("/usr/sbin/service syslog-ng start");
}