summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Mackdanz <stasibear@gentoo.org>2016-02-28 12:03:18 -0600
committerErik Mackdanz <stasibear@gentoo.org>2016-02-28 12:04:15 -0600
commit1ab37655cd44110d0d910168d9ba7b80115c3759 (patch)
tree15bf0e4b35621efab3637a9ebe7b6e16b9ff3b99 /app-emulation/lxd/files/lxd-2.0.0_beta4.initd
parentwaf-utils.eclass: Ban non-python-r1 uses (diff)
downloadgentoo-1ab37655cd44110d0d910168d9ba7b80115c3759.tar.gz
gentoo-1ab37655cd44110d0d910168d9ba7b80115c3759.tar.bz2
gentoo-1ab37655cd44110d0d910168d9ba7b80115c3759.zip
app-emulation/lxd: Version bump to beta 4
Removes dep on bridge-utils (uses iproute2 instead) Package-Manager: portage-2.2.27
Diffstat (limited to 'app-emulation/lxd/files/lxd-2.0.0_beta4.initd')
-rw-r--r--app-emulation/lxd/files/lxd-2.0.0_beta4.initd50
1 files changed, 50 insertions, 0 deletions
diff --git a/app-emulation/lxd/files/lxd-2.0.0_beta4.initd b/app-emulation/lxd/files/lxd-2.0.0_beta4.initd
new file mode 100644
index 000000000000..ec23258c19d1
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-2.0.0_beta4.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON=/usr/sbin/lxd
+PIDFILE=/run/lxd.pid
+
+extra_commands="stopall"
+
+depend() {
+ need net
+ use lxcfs
+
+ # remove with 2.0 release
+ need cgmanager
+}
+
+start() {
+ ebegin "Starting lxd server"
+
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON} \
+ --background \
+ --make-pidfile \
+ -- \
+ ${LXD_OPTIONS}
+
+ eend $?
+}
+
+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"
+ if "${DAEMON}" shutdown; then
+ /etc/init.d/lxd zap
+ rm -f ${PIDFILE}
+ fi
+ eend $?
+}