0822a19f5f9d2fb2ef7594d7bb542c0cac174805
[gentoo.git] / www-apps / trac / files / tracd.initd
1 #!/sbin/runscript
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License, v2 or later
4 # $Id$
5
6 depend() {
7         need net
8 }
9
10 start() {
11         ebegin "Starting tracd"
12         # tracd fails to create pidfile if started as non-root user, thus we are asking
13         # s-s-d to do that. To have correct pid we avoid -d option of tracd and use
14         # --background option of s-s-d.
15         start-stop-daemon --start --user ${TRACD_USER:-tracd} --group ${TRACD_GROUP:-tracd} \
16                 --pidfile /var/run/tracd.pid --make-pidfile --background \
17                 --env PYTHON_EGG_CACHE="/var/lib/trac/egg-cache" \
18                 --exec /usr/bin/tracd -- \
19                 -p ${TRACD_PORT:-8000} ${TRACD_OPTS:---env-parent-dir /var/lib/trac/}
20         eend $?
21 }
22
23 stop() {
24         ebegin "Stopping tracd"
25         start-stop-daemon --stop --quiet --pidfile /var/run/tracd.pid
26         eend $?
27 }