commit:     43b0f09708ca0ee5fb22bec6f3c5320b26c8b535
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 16 11:34:40 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Feb 16 12:16:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43b0f097

app-emulation/lxd: rework init.d file shutdown logic

Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-emulation/lxd/files/lxd-4.0.0.initd | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/app-emulation/lxd/files/lxd-4.0.0.initd 
b/app-emulation/lxd/files/lxd-4.0.0.initd
index 1cd4da1840b..baec86805c6 100644
--- a/app-emulation/lxd/files/lxd-4.0.0.initd
+++ b/app-emulation/lxd/files/lxd-4.0.0.initd
@@ -29,8 +29,12 @@ start() {
 }
 
 stop() {
-       ebegin "Stopping lxd service (but not containers)."
-       start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
-       rm -f ${PIDFILE}
-       eend ${?}
+       if [[ ${RC_GOINGDOWN} = YES ]] || [[ ${RC_REBOOT} = YES ]]; then
+               "${DAEMON}" shutdown
+               rm -f ${PIDFILE}
+       else
+               ebegin "Stopping lxd service (but not containers)."
+               start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+               eend ${?}
+       fi
 }

Reply via email to