mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-27 20:07:25 +00:00
rsyslog: fix configuration file for logrotate
The logrotate.rsyslog file uses 'cat /var/run/rsyslogd.pid' to determine the pid of rsyslogd daemon. This is incorrect, because rsyslogd may start in a way that does not create rsyslog.pid file. Failing to send HUP signal to rsyslogd daemon will result in unexpected behaviour. e.g. rsyslogd is writing to /var/log/messages-xxxx instead of /var/log/messages. We should really use pkill to send HUP signal to rsyslogd to ensure correct behaviour. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
delaycompress
|
delaycompress
|
||||||
compress
|
compress
|
||||||
postrotate
|
postrotate
|
||||||
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
|
@BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +34,6 @@
|
|||||||
delaycompress
|
delaycompress
|
||||||
sharedscripts
|
sharedscripts
|
||||||
postrotate
|
postrotate
|
||||||
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
|
@BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ do_install_append() {
|
|||||||
install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
|
install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
|
||||||
install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
|
install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
|
||||||
install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
|
install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
|
||||||
|
sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
|
||||||
}
|
}
|
||||||
|
|
||||||
FILES_${PN} += "${bindir}"
|
FILES_${PN} += "${bindir}"
|
||||||
|
|||||||
Reference in New Issue
Block a user