summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boot <bootc@bootc.net>2018-06-23 19:37:23 +0100
committerChris Boot <bootc@bootc.net>2018-06-23 19:37:23 +0100
commit60d9d31d91b004b966e7e0f25e0796720110d7a5 (patch)
tree0087d9df12adf220c520d7bfff14abcc04298dbf
parentba6832f64bdc85f9e5cdf6362c93642903e0b492 (diff)
d/ulogd2.logrotate: use systemctl when running under systemd
Closes: #805976
-rw-r--r--debian/changelog4
-rw-r--r--debian/ulogd2.logrotate6
2 files changed, 8 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 0a24379..1d3561b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,7 +15,9 @@ ulogd2 (2.0.7-1) UNRELEASED; urgency=medium
- remove upstart configuration file
- d/control: use https:// URL for Homepage field
- d/copyright: use https:// URLs in Format and Source fields
- * d/ulogd2.logrotate: add 'delaycompress' option. (Closes: #894603)
+ * d/ulogd2.logrotate:
+ - add 'delaycompress' option. (Closes: #894603)
+ - use systemctl when running under systemd. (Closes: #805976)
-- Chris Boot <bootc@debian.org> Mon, 14 May 2018 11:41:13 +0100
diff --git a/debian/ulogd2.logrotate b/debian/ulogd2.logrotate
index d27387f..4d03ba9 100644
--- a/debian/ulogd2.logrotate
+++ b/debian/ulogd2.logrotate
@@ -5,6 +5,10 @@
sharedscripts
create 640 ulog adm
postrotate
- invoke-rc.d ulogd2 reload > /dev/null
+ if [ -d /run/systemd/system ] && command systemctl >/dev/null 2>&1 && systemctl is-active --quiet ulogd2.service; then
+ systemctl kill --kill-who main --signal=SIGHUP ulogd2.service
+ else
+ invoke-rc.d ulogd2 reload > /dev/null
+ fi
endscript
}