summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-auth/elogind/files/elogind.init17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys-auth/elogind/files/elogind.init b/sys-auth/elogind/files/elogind.init
index 019c3af..5ea0be5 100644
--- a/sys-auth/elogind/files/elogind.init
+++ b/sys-auth/elogind/files/elogind.init
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
depend() {
@@ -19,7 +19,18 @@ start() {
}
stop() {
- ebegin "Stopping elogind"
- start-stop-daemon --stop --quiet --pidfile "${ELOGIND_PIDFILE}"
+ local stop_timeout="SIGTERM/10/SIGKILL/3"
+
+ if [ ${RC_CMD} = "restart" ] ; then
+ ebegin "Interrupting elogind"
+ stop_timeout="SIGINT/10/SIGINT/5/${stop_timeout}"
+ else
+ ebegin "Stopping elogind"
+ fi
+
+ start-stop-daemon --stop --quiet \
+ --retry ${stop_timeout} \
+ --pidfile "${ELOGIND_PIDFILE}"
+
eend $?
}