aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-07-30 18:16:56 +0800
committerKhem Raj <raj.khem@gmail.com>2018-08-02 02:12:15 -0700
commit1993b1f78cc317ce53c3ff46ef14a8744d701537 (patch)
tree4001dec7f05542ffd89a0868d6eb5ea345ab7654
parenta79ca6831128ee99806f4f68a239d17ca6555d88 (diff)
downloadmeta-openembedded-contrib-1993b1f78cc317ce53c3ff46ef14a8744d701537.tar.gz
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>
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate4
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb1
2 files changed, 3 insertions, 2 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
index 94ec517b21..5f8568fce6 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate
@@ -9,7 +9,7 @@
delaycompress
compress
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
}
@@ -34,6 +34,6 @@
delaycompress
sharedscripts
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
}
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb
index 9737892018..d90695a608 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb
@@ -125,6 +125,7 @@ do_install_append() {
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.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
+ sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
}
FILES_${PN} += "${bindir}"