aboutsummaryrefslogtreecommitdiffstats
path: root/main/kamailio/kamailio.initd
blob: 3d10fe5ab88d7ab713de07fc0702ed76995bcdfe (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
#!/sbin/runscript

daemon=/usr/sbin/kamailio
pidfile=/var/run/kamailio/kamailio.pid

extra_started_commands="reload"

depend() {
	need net
	after firewall
}

start() {
	ebegin "Starting Kamailio"
	checkpath -d -o kamailio:kamailio /var/run/kamailio
	start-stop-daemon --start --quiet --pidfile $pidfile --exec $daemon \
		-- \
		-u ${KAMAILIO_USER:-kamailio} \
		-g ${KAMAILIO_GROUP:-kamailio} \
		-P $pidfile \
		${KAMAILIO_OPTS:-}
	eend $?
}

stop() {
	ebegin "Stopping Kamailio"
	start-stop-daemon --stop --quiet --pidfile $pidfile
	eend $?
}

reload() {
	ebegin "Reloading Kamailio"
	echo mi_dg dp_reload | sercmd 2>/dev/null
	eend $?
}