aboutsummaryrefslogtreecommitdiffstats
path: root/community/atheme-iris/atheme-iris.initd
blob: dd8a24dbe358508639f03762aa4e3b758380e289 (plain) (blame)
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
38
39
#!/sbin/openrc-run
# Copyright 2013 Alpine Linux 
# Distributed under the terms of the GNU General Public License v2

extra_stopped_commands="compile"

: ${SVCHOME:=/var/lib/$SVCNAME}
: ${pidfile:=/var/run/${SVCNAME%%.*}/${SVCNAME#*.}.pid}

depend() {
	use net
	need localmount
}
compile() {
	ebegin "Compiling configuration for ${SVCNAME}"
	cd ${SVCHOME}
	./clean.py
	./compile.py
	eend $?
}

start() {
	compile || return 1
	checkpath --directory --owner iris ${pidfile%/*}
	ebegin "Starting ${SVCNAME}"
	start-stop-daemon --exec ${SVCHOME}/run.py \
		--pidfile $pidfile \
		--chdir $SVCHOME \
		--user iris:iris \
		--background \
		--stdout /dev/null \
		--stderr /dev/null \
		--wait 500 \
		-- \
		-P $pidfile \
		$ARGS

	eend $?
}