rsyslog: fix configuration file for logrotate
PATCH 1/2 rsyslog: fix configuration file for logrotate
From: Chen Qi <[email protected]>
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.
--- meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 4 ++-- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +2 -2
@@ -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 }
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +1 -0
@@ -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}"
Signature · 1 line
1.9.1
PATCH 2/2 rsyslog: add PACKAGECONFIG for imjournal
From: Chen Qi <[email protected]>
Add PACKAGECONFIG for imjournal, and add corresponding configuration to /etc/rsyslog.conf when it's enabled. Default to disable it.
--- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 5 +++++ 1 file changed, 5 insertions(+)
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +5 -0
@@ -67,6 +67,7 @@ PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," +PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
@@ -126,6 +127,10 @@ do_install_append() { 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 + + if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then + echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.conf + fi } FILES_${PN} += "${bindir}"
Signature · 1 line
1.9.1
Re: [meta-oe][PATCH 2/2] rsyslog: add PACKAGECONFIG for imjournal
Quoted 24 lines · On Fri, Aug 3, 2018 at 3:03 AM <[email protected]> wrote:
From: Chen Qi <[email protected]>
Add PACKAGECONFIG for imjournal, and add corresponding configuration to
/etc/rsyslog.confwhen it's enabled. Default to disable it.Signed-off-by Chen Qi <[email protected]>--- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 5 +++++ 1 file changed, 5 insertions(+)meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +1
-0@@ -67,6 +67,7 @@ PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," +PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb do_install_append() { · line 133
Quoted 7 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +4
-0@@ -126,6 +127,10 @@ do_install_append() { 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 + + if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then + echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.conf + fi
perhaps its time to add something like
$IncludeConfig /etc/rsyslog.d/*.conf
in main etc/rsyslog.conf and then such fragments can be places as individual config
files inside that directory
Quoted 11 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +0
-1} FILES_${PN} += "${bindir}" --1.9.1
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Re: [meta-oe][PATCH 2/2] rsyslog: add PACKAGECONFIG for imjournal
Quoted 33 lines · Khem Raj
Quoted 23 lines · On Fri, Aug 3, 2018 at 3:03 AM <[email protected]> wrote:
From: Chen Qi <[email protected]>
Add PACKAGECONFIG for imjournal, and add corresponding configuration to
/etc/rsyslog.confwhen it's enabled. Default to disable it.Signed-off-by Chen Qi <[email protected]>--- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 5 +++++ 1 file changed, 5 insertions(+)meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +1
-0@@ -67,6 +67,7 @@ PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," +PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb do_install_append() { · line 133
Quoted 7 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +4
-0@@ -126,6 +127,10 @@ do_install_append() { 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 + + if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then + echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.conf + fiperhaps its time to add something like
Quoted 5 lines
$IncludeConfig
/etc/rsyslog.d/*.confin main
etc/rsyslog.confand then such fragments can be places as individual config
files inside that directory
I agree. I'll send out V2.
Best Regards,
Chen Qi
Quoted 11 lines
Quoted 11 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +0
-1} FILES_${PN} += "${bindir}" --1.9.1
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
is this patch any different from last posted patch ?
https://patchwork.openembedded.org/patch/153125/
If not then there is no need to resend, if yes then please describe the change and mark
patch as v2, v3 and so on. Save some time for reviewers
Quoted 61 lines · On Fri, Aug 3, 2018 at 3:02 AM <[email protected]> wrote:
From: Chen Qi <[email protected]>
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-xxxxinstead of/var/log/messages.We should really use pkill to send HUP signal to rsyslogd to ensure correct behaviour.
Signed-off-by Chen Qi <[email protected]>--- meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 4 ++-- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +2
-2@@ -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 }meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +1
-1@@ -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}" --1.9.1
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Quoted 3 lines · Khem Raj
is this patch any different from last posted patch ?
There's is no difference.
I sent it out again because the second patch also modifies the do_install function and I thought if I send them out together, it will be more convenient.
Best Regards,
Chen Qi
Quoted 64 lines
If not then there is no need to resend, if yes then please describe the change and mark
patch as v2, v3 and so on. Save some time for reviewersQuoted 60 lines · On Fri, Aug 3, 2018 at 3:02 AM <[email protected]> wrote:
From: Chen Qi <[email protected]>
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-xxxxinstead of/var/log/messages.We should really use pkill to send HUP signal to rsyslogd to ensure correct behaviour.
Signed-off-by Chen Qi <[email protected]>--- meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 4 ++-- meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +2
-2@@ -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 }meta-oe/recipes-extended/rsyslog/rsyslog_8.36.0.bb +1
-1@@ -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}" --1.9.1
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel