3 # git-daemon git-daemon tcp daemon for git
7 # description: git-daemon is a simple tcp daemon that serves git repositories
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 DAEMON_OPTS="--syslog"
19 # Get service config - may override defaults
20 [ -f /etc/sysconfig/git-daemon ] && . /etc/sysconfig/git-daemon
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down "git-daemon"
33 # Check if the service is already running?
34 if [ -f /var/lock/subsys/git-daemon ]; then
35 msg_already_running "git-daemon"
39 msg_starting "git-daemon"
40 daemon --fork @libdir@/git-core/git-daemon $DAEMON_OPTS
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/git-daemon
46 if [ ! -f /var/lock/subsys/git-daemon ]; then
47 msg_not_running "git-daemon"
52 msg_stopping "git-daemon"
54 rm -f /var/lock/subsys/git-daemon
58 if [ ! -f /var/lock/subsys/git-daemon ]; then
59 msg_not_running "git-daemon"
64 msg_reloading "git-daemon"
65 killproc git-daemon -HUP
70 if [ ! -f /var/lock/subsys/git-daemon ]; then
71 msg_not_running "git-daemon"
81 # See how we were called.
104 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"