summaryrefslogtreecommitdiff
path: root/dev-python/twisted/files/twistd.init
blob: b031b0020c6ec59d0538040c3c3333ebca5fd5bf (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
#!/sbin/openrc-run

depend() {
	need net
}

start() {
	if [ -z "${TWISTD_OPTS}" ]; then
		eerror "TWISTD_OPTS is not set!"
		eerror "You need to configure twistd in /etc/conf.d/twistd."
		return 1
	fi
	export PYTHONPATH
	ebegin "Starting twistd"
	start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \
		--exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \
			${TWISTD_OPTS}
	eend $? "Failed to start twistd"
}

stop() {
	ebegin "Stopping twistd"
	start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid 
	eend $? "Failed to stop twistd"
}