blob: 4416ce4ce45948b7f53889ff070b32b6d30c7333 (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/gitd: start/stop the git daemon
4 #
5
6 REPOS=/var/lib/git
7 USR=git
8
9 SSD=/sbin/start-stop-daemon
10 PROG=/usr/lib/git-core/git-daemon
11 PID=/var/run/gitd.pid
12 OPTS="--export-all --base-path=$REPOS $REPOS"
13
14 case $1 in
15 start)
16 $SSD --start -c $USR -b -m --pidfile $PID --exec $PROG -- $OPTS
17 ;;
18 stop)
19 $SSD --stop --retry 10 --pidfile $PID --remove-pidfile
20 ;;
21 restart)
22 $0 stop
23 $0 start
24 ;;
25 status)
26 $SSD --status --pidfile $PID
27 case $? in
28 0) echo "$PROG is running with pid $(cat $PID)" ;;
29 1) echo "$PROG is not running but the pid file $PID exists" ;;
30 3) echo "$PROG is not running" ;;
31 4) echo "Unable to determine the program status" ;;
32 esac
33 ;;
34 *)
35 echo "usage: $0 [start|stop|restart|status]"
36 ;;
37 esac
38
39 # End of file
|