diff options
Diffstat (limited to 'app-emulation/lxd/files')
-rw-r--r-- | app-emulation/lxd/files/lxd-dont-go-get.patch | 16 | ||||
-rw-r--r-- | app-emulation/lxd/files/lxd.confd | 7 | ||||
-rw-r--r-- | app-emulation/lxd/files/lxd.confd.1 | 24 | ||||
-rw-r--r-- | app-emulation/lxd/files/lxd.initd.1 | 47 |
4 files changed, 49 insertions, 45 deletions
diff --git a/app-emulation/lxd/files/lxd-dont-go-get.patch b/app-emulation/lxd/files/lxd-dont-go-get.patch deleted file mode 100644 index a6e25e325b95..000000000000 --- a/app-emulation/lxd/files/lxd-dont-go-get.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- /src/github.com/lxc/lxd/Makefile.orig 2016-07-11 23:34:40.299664675 +0000 -+++ /src/github.com/lxc/lxd/Makefile 2016-07-11 23:37:00.816018727 +0000 -@@ -13,13 +13,11 @@ - - .PHONY: default - default: -- go get -t -v -d ./... - go install -v $(TAGS) $(DEBUG) ./... - @echo "LXD built successfully" - - .PHONY: client - client: -- go get -t -v -d ./... - go install -v $(TAGS) $(DEBUG) ./lxc - @echo "LXD client built successfully" - diff --git a/app-emulation/lxd/files/lxd.confd b/app-emulation/lxd/files/lxd.confd index 3d553276a5e3..8e342cc62d16 100644 --- a/app-emulation/lxd/files/lxd.confd +++ b/app-emulation/lxd/files/lxd.confd @@ -15,13 +15,10 @@ LXD_OPTIONS+=" --group lxd" #LXD_OPTIONS+=" --debug" # For debugging, print a complete stack trace every n seconds -#LXD_OPTIONS+=" --print-goroutines-every 5" +#LXD_OPTIONS+=" --print-goroutines 5" # Enables verbose mode -#LXD_OPTIONS+=" -v" +#LXD_OPTIONS+=" --verbose" # Logfile to log to #LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" - -# Enables syslog logging -#LXD_OPTIONS+=" --syslog" diff --git a/app-emulation/lxd/files/lxd.confd.1 b/app-emulation/lxd/files/lxd.confd.1 deleted file mode 100644 index 8e342cc62d16..000000000000 --- a/app-emulation/lxd/files/lxd.confd.1 +++ /dev/null @@ -1,24 +0,0 @@ -# Group which owns the shared socket -LXD_OPTIONS+=" --group lxd" - - - -# Enable cpu profiling into the specified file -#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile" - -# Enable memory profiling into the specified file -#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile" - - - -# Enables debug mode -#LXD_OPTIONS+=" --debug" - -# For debugging, print a complete stack trace every n seconds -#LXD_OPTIONS+=" --print-goroutines 5" - -# Enables verbose mode -#LXD_OPTIONS+=" --verbose" - -# Logfile to log to -#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" diff --git a/app-emulation/lxd/files/lxd.initd.1 b/app-emulation/lxd/files/lxd.initd.1 new file mode 100644 index 000000000000..b6d3cd4eb264 --- /dev/null +++ b/app-emulation/lxd/files/lxd.initd.1 @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DAEMON=/usr/sbin/lxd +PIDFILE=/run/lxd.pid + +extra_commands="stopall" + +depend() { + need net + use lxcfs +} + +start() { + ebegin "Starting lxd service" + + start-stop-daemon --start \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} \ + --background \ + --make-pidfile \ + --env LD_LIBRARY_PATH="/usr/lib/lxd" \ + -- \ + ${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 $? +} |