summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonas Niilola <juippis@gentoo.org>2021-02-16 13:34:40 +0200
committerJoonas Niilola <juippis@gentoo.org>2021-02-16 14:16:38 +0200
commit43b0f09708ca0ee5fb22bec6f3c5320b26c8b535 (patch)
tree6813f06c6aeeaffb1382cfdb5a29f1caf8245974 /app-emulation/lxd/files
parentnet-libs/libcork: drop building docs/old (diff)
downloadgentoo-43b0f09708ca0ee5fb22bec6f3c5320b26c8b535.tar.gz
gentoo-43b0f09708ca0ee5fb22bec6f3c5320b26c8b535.tar.bz2
gentoo-43b0f09708ca0ee5fb22bec6f3c5320b26c8b535.zip
app-emulation/lxd: rework init.d file shutdown logic
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-emulation/lxd/files')
-rw-r--r--app-emulation/lxd/files/lxd-4.0.0.initd12
1 files 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 1cd4da1840b0..baec86805c68 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
}