X-Git-Url: http://git.pld-linux.org/?p=packages%2Fgit-core.git;a=blobdiff_plain;f=git-core.init;h=a9e0469bbbbe2b65c56b32fe3ccd2336391c341b;hp=5dade3c8e31b2928f0cc1c9b2350a0598da3f11e;hb=e5a9986585e50437a3515f155d61ad5da8c96c8b;hpb=7ba2660fbe015a56f1ce5b65e85a06c92f06dae1 diff --git a/git-core.init b/git-core.init index 5dade3c..a9e0469 100644 --- a/git-core.init +++ b/git-core.init @@ -2,7 +2,7 @@ # # git-daemon git-daemon tcp daemon for git # -# chkconfig: 345 90 25 +# chkconfig: 345 90 10 # # description: git-daemon is a simple tcp daemon that serves git repositories # @@ -22,7 +22,7 @@ DAEMON_OPTS="--syslog" # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then - msg_network_down git-daemon + msg_network_down "git-daemon" exit 1 fi else @@ -31,46 +31,50 @@ fi start() { # Check if the service is already running? - if [ ! -f /var/lock/subsys/git-daemon ]; then - msg_starting git-daemon - daemon --fork @libdir@/git-core/git-daemon $DAEMON_OPTS - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/git-daemon - else - msg_already_running git-daemon + if [ -f /var/lock/subsys/git-daemon ]; then + msg_already_running "git-daemon" + return fi + + msg_starting "git-daemon" + daemon --fork @libdir@/git-core/git-daemon $DAEMON_OPTS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/git-daemon } stop() { - if [ -f /var/lock/subsys/git-daemon ]; then - # Stop daemons. - msg_stopping git-daemon - killproc git-daemon - rm -f /var/lock/subsys/git-daemon - else - msg_not_running git-daemon + if [ ! -f /var/lock/subsys/git-daemon ]; then + msg_not_running "git-daemon" + return fi + + # Stop daemons. + msg_stopping "git-daemon" + killproc git-daemon + rm -f /var/lock/subsys/git-daemon } reload() { - if [ -f /var/lock/subsys/git-daemon ]; then - msg_reloading git-daemon - killproc git-daemon -HUP - RETVAL=$? - else - msg_not_running git-daemon + if [ ! -f /var/lock/subsys/git-daemon ]; then + msg_not_running "git-daemon" RETVAL=7 + return fi + + msg_reloading "git-daemon" + killproc git-daemon -HUP + RETVAL=$? } condrestart() { - if [ -f /var/lock/subsys/git-daemon ]; then - stop - start - else - msg_not_running git-daemon + if [ ! -f /var/lock/subsys/git-daemon ]; then + msg_not_running "git-daemon" RETVAL=$1 + return fi + + stop + start } RETVAL=0