aboutsummaryrefslogtreecommitdiffstats
path: root/testing/janus-gateway/janus-gateway.initd
blob: 6806daab6742a5546f43b915d502b49eae015ea4 (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
#!/sbin/openrc-run

PIDFILE=/var/run/janus.pid

depend() {
	need net
}

start_pre() {
	checkpath -f -o $JANUS_USER:$JANUS_GROUP -m644 /var/log/janus.log
	if [ ! -f /etc/janus/janus.jcfg ] ; then
		eerror "/etc/janus/janus.jcfg file doesn't exists!"
		return 1
	fi

}

start() {
	ebegin "Starting Janus gateway server"
	start-stop-daemon --start --make-pidfile --exec /usr/bin/janus \
		--pidfile "${PIDFILE}" --background --quiet \
		--user "${JANUS_USER}" \
		-- ${JANUS_OPTS} -L /var/log/janus.log 
	eend $?
}

stop() {
	ebegin "Stopping Janus gateway server"
	start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
	eend $?
}