summaryrefslogtreecommitdiff
blob: e4cfe468a0970a23fb29c07e6b2bd235c116b3c2 (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
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need localmount
}

start() {
	if ! [ -d /var/run/smsd ]; then
		ebegin "Creating /var/run/smsd for ${SVCNAME}"
		mkdir /var/run/smsd \
			&& chown smsd:sms /var/run/smsd \
			&& chmod 770 /var/run/smsd
		eend $?
	fi

	chown smsd:sms /var/log/smsd.log
	ebegin "Starting smsd"
	start-stop-daemon -b -u smsd:sms --start --exec /usr/bin/smsd -- \
		-c /etc/smsd.conf -p /var/run/smsd/smsd.pid \
		-i /var/run/smsd/smsd.working
	eend ${?}
}

stop() {
	ebegin "Stopping smsd"
	start-stop-daemon --stop -n smsd
	eend ${?}
}