Skip to content

Commit

Permalink
app-emulation/lxd: don't shutdown all cluster instances with service
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/770511
Signed-off-by: Joonas Niilola <[email protected]>
  • Loading branch information
juippis committed Feb 16, 2021
1 parent 5af3fe1 commit 9f88706
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions app-emulation/lxd/files/lxd-4.0.0.initd
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

DAEMON=/usr/sbin/lxd
PIDFILE=/run/lxd.pid
TIMEOUT=10

extra_commands="stopall"

depend() {
need net
need lxcfs
Expand All @@ -31,24 +29,7 @@ start() {
}

stop() {
if [[ ${RC_GOINGDOWN} = YES ]] || [[ ${RC_REBOOT} = YES ]]; then
stopall
else
ebegin "Stopping lxd service (but not containers)."
start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
eend ${?}
fi
}

stopall() {
ebegin "Stopping lxd service and containers."
lxc stop --all --timeout $TIMEOUT >/dev/null 2>&1
if [[ ${?} -ne 0 ]]; then
lxc stop --all --force || eerror "Could not stop all containers."
fi
if "${DAEMON}" shutdown; then
rm -f ${PIDFILE}
eend 0
fi
ebegin "Stopping lxd service (but not containers)."
start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
eend ${?}
}
File renamed without changes.

0 comments on commit 9f88706

Please sign in to comment.