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 # source function library
12 . /etc/rc.d/init.d/functions
14 # pull in sysconfig settings
15 [ -f /etc/sysconfig/git ] && . /etc/sysconfig/git
20 # Some functions to make the below more readable
21 GIT=/usr/bin/git-daemon
22 PID_FILE=/var/run/git-daemon.pid
24 # override OPTIONS altogether for more flexibility
25 OPTIONS=${OPTIONS:- --pid-file=${PID_FILE} --base-path=${GITDIR} --port=${PORT} ${VERBOSE} ${DETACH} ${SYSLOG} ${EXPORT} ${GITWHITELIST}}
27 runlevel=$(set -- $(runlevel); eval "echo \$$#" )
31 echo -n $"Starting $prog: "
32 $GIT $OPTIONS && success || failure
34 [ "$RETVAL" = 0 ] && touch /var/lock/subsys/git
40 echo -n $"Stopping $prog: "
41 if [ -n "`pidfileofproc $GIT`" ] ; then
44 failure $"Stopping $prog"
47 # if we are in halt or reboot runlevel kill all running sessions
48 # so the TCP connections are closed cleanly
49 if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
50 killall $prog 2>/dev/null
52 [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/git
68 if [ -f /var/lock/subsys/git ] ; then
69 if [ "$RETVAL" = 0 ] ; then
78 status -p $PID_FILE git-daemon
82 echo $"Usage: $0 {start|stop|restart|condrestart|status}"