3 # Init file for git daemon
5 # chkconfig: 2345 55 25
6 # description: git server daemon
8 # processname: git-daemon
9 # pidfile: /var/run/git.pid
11 # NOTE. on f14 at least git daemon comes linked with xinetd
12 # however as we had written this for f8, and as I don't feel
13 # comfy with xinetd on top of chkconfig,
14 # I turned off xinetd and still use this one on f14 as well
16 # source function library
17 . /etc/rc.d/init.d/functions
19 # pull in sysconfig settings
20 [ -f /etc/sysconfig/git ] && . /etc/sysconfig/git
25 # Some functions to make the below more readable
26 # previous location (f8)
27 #GIT=/usr/bin/git-daemon
29 GIT=/usr/libexec/git-core/git-daemon
30 PID_FILE=/var/run/git-daemon.pid
32 # override OPTIONS altogether for more flexibility
33 OPTIONS=${OPTIONS:- --pid-file=${PID_FILE} --base-path=${GITDIR} --port=${PORT} ${VERBOSE} ${DETACH} ${SYSLOG} ${EXPORT} ${GITWHITELIST}}
35 runlevel=$(set -- $(runlevel); eval "echo \$$#" )
39 echo -n $"Starting $prog: "
40 $GIT $OPTIONS && success || failure
42 [ "$RETVAL" = 0 ] && touch /var/lock/subsys/git
48 echo -n $"Stopping $prog: "
49 if [ -n "`pidfileofproc $GIT`" ] ; then
52 failure $"Stopping $prog"
55 # if we are in halt or reboot runlevel kill all running sessions
56 # so the TCP connections are closed cleanly
57 if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
58 killall $prog 2>/dev/null
60 [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/git
76 if [ -f /var/lock/subsys/git ] ; then
77 if [ "$RETVAL" = 0 ] ; then
86 status -p $PID_FILE git-daemon
90 echo $"Usage: $0 {start|stop|restart|condrestart|status}"