Work around service(8) not reloading syslog-ng correctly
authorTollef Fog Heen <tfheen@err.no>
Fri, 2 Jan 2015 17:19:30 +0000 (18:19 +0100)
committerTollef Fog Heen <tfheen@err.no>
Fri, 2 Jan 2015 17:19:30 +0000 (18:19 +0100)
It seems systemd fails to mark syslog-ng as reloadable, which in turn
leads to invoke-rc.d failing.  Just call systemctl directly if we're
running systemd to work around this.

modules/syslog-ng/files/syslog-ng.logrotate

index 2204713..2714307 100644 (file)
    daily
    compress
    postrotate
-      /usr/sbin/invoke-rc.d syslog-ng reload >/dev/null
+      if [ -d /run/systemd/system ]; then
+          /bin/systemctl reload syslog-ng.service >/dev/null
+      else
+          /usr/sbin/invoke-rc.d syslog-ng reload >/dev/null
+      fi
    endscript
 }