summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-02-07 15:08:19 +0100
committerRemi Collet <remi@remirepo.net>2019-02-07 15:08:19 +0100
commit62994e689260f361a46b908bb0268ca0fd40ad8c (patch)
tree48f49a80f74c702639d40e2f3ccf1d445012b5e9
parent77b08748cd056c9e6950d7a27016164c8a5671d5 (diff)
check if PID exists before killing it, from upstream
-rw-r--r--unit.logrotate4
1 files changed, 3 insertions, 1 deletions
diff --git a/unit.logrotate b/unit.logrotate
index a8340a9..8fb0019 100644
--- a/unit.logrotate
+++ b/unit.logrotate
@@ -3,6 +3,8 @@
nocreate
notifempty
postrotate
- /bin/kill -SIGUSR1 `cat /var/run/unit/unit.pid`
+ if [ -f /var/run/unit/unit.pid ]; then
+ /bin/kill -SIGUSR1 `cat /var/run/unit/unit.pid`
+ fi
endscript
}