Skip to contentSkip to conversation

rsyslog: don't call init script in logrotate conf file

PATCH In review [email protected] 2 participants 2 messages Jan 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsyslog: don't call init script in logrotate conf file

From: Jackie Huang <[email protected]>

Send HUP signal instead of calling the reload command of init script in logrotate configure file, so that it also works when the init system is systemd.

---
 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +2 -2
index ba1120a..94ec517 100644
@@ -9,7 +9,7 @@
         delaycompress
         compress
         postrotate
-		/etc/init.d/rsyslog reload 2> /dev/null || true
+		/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
         endscript
 }
 
@@ -34,6 +34,6 @@
         delaycompress
         sharedscripts
         postrotate
-		/etc/init.d/rsyslog reload 2> /dev/null || true
+		/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
         endscript
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 26 lines · On 29/01/15 07:46, [email protected] wrote:

From: Jackie Huang <[email protected]>

Send HUP signal instead of calling the reload command of init script in logrotate configure file, so that it also works when the init system is systemd.

---
 meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +1 -1
index ba1120a..94ec517 100644
@@ -9,7 +9,7 @@
         delaycompress
         compress
         postrotate
-		/etc/init.d/rsyslog reload 2> /dev/null || true
+		/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
         endscript
 }
 

meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate line 39

Quoted 7 lines
meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate +1 -1
@@ -34,6 +34,6 @@
         delaycompress
         sharedscripts
         postrotate
-		/etc/init.d/rsyslog reload 2> /dev/null || true
+		/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
         endscript
 }

This is better than my approach to fixing this as it works with systemd also. I would take this patch in favour of my

[PATCH] rsyslog: init file has been renamed, reflect in logrotate conf file

Ack from me.

Signature · 5 lines
  Jack Mitchell ([email protected])
  Embedded Systems Engineer
  Cambridgeshire, UK
  http://www.embed.me.uk
--