summaryrefslogtreecommitdiff
blob: 7d81d298f5844b2bc09e21a89d642b1516503db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
}