diff options
Diffstat (limited to 'app-containers/incus/files/incus-user-0.4.initd')
-rw-r--r-- | app-containers/incus/files/incus-user-0.4.initd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app-containers/incus/files/incus-user-0.4.initd b/app-containers/incus/files/incus-user-0.4.initd new file mode 100644 index 000000000000..7d81d298f584 --- /dev/null +++ b/app-containers/incus/files/incus-user-0.4.initd @@ -0,0 +1,37 @@ +#!/sbin/openrc-run +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="incus-user socket daemon" +description="incus-user socket daemon" + +DAEMON=/usr/sbin/incus-user +PIDFILE=/run/incus-user.pid + +depend() { + need incus + need net +} + +start() { + ebegin "Starting incus-user socket daemon" + + start-stop-daemon --start \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} \ + --background \ + --make-pidfile \ + -- \ + --group incus + eend ${?} +} + +stop() { + if [ "${RC_CMD}" = restart ]; then + start-stop-daemon --stop --quiet -p "${PIDFILE}" + eend ${?} + else + start-stop-daemon --stop --quiet -p "${PIDFILE}" + eend ${?} + fi +} |