Lines 7-24
Link Here
|
7 |
start() { |
7 |
start() { |
8 |
if [[ -z "${TWISTD_OPTS}" ]]; then |
8 |
if [[ -z "${TWISTD_OPTS}" ]]; then |
9 |
eerror "TWISTD_OPTS is not set!" |
9 |
eerror "TWISTD_OPTS is not set!" |
10 |
eerror "You need to configure twistd in /etc/conf.d/twistd." |
10 |
eerror "You need to configure twistd in /etc/conf.d/${SVCNAME}." |
11 |
return 1 |
11 |
return 1 |
12 |
fi |
12 |
fi |
13 |
ebegin "Starting twistd" |
13 |
ebegin "Starting ${SVCNAME}" |
14 |
start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \ |
14 |
start-stop-daemon --start --quiet --pidfile /var/run/${SVCNAME}.pid \ |
15 |
--exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \ |
15 |
--exec /usr/bin/twistd -- --pidfile /var/run/${SVCNAME}.pid \ |
16 |
${TWISTD_OPTS} |
16 |
${TWISTD_OPTS} |
17 |
eend $? "Failed to start twistd" |
17 |
eend $? "Failed to start twistd" |
18 |
} |
18 |
} |
19 |
|
19 |
|
20 |
stop() { |
20 |
stop() { |
21 |
ebegin "Stopping twistd" |
21 |
ebegin "Stopping ${SVCNAME}" |
22 |
start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid |
22 |
start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid |
23 |
eend $? "Failed to stop twistd" |
23 |
eend $? "Failed to stop twistd" |
24 |
} |
24 |
} |