svnserve rc.d/init.d start up script for Fedora/RedHat

I forget where I found this at. But again, I figured I would share this since I’m sure others are looking for the same thing.

/etc/rc.d/init.d/svnserve

  1. #!/bin/bash
  2. #
  3. #   /etc/rc.d/init.d/subversion
  4. #
  5. # Starts the Subversion Daemon
  6. #
  7. # chkconfig: 2345 90 10
  8. # description: Subversion Daemon
  9.  
  10. # processname: svnserve
  11.  
  12. . /etc/rc.d/init.d/functions
  13.  
  14. [ -x /usr/bin/svnserve ] || exit 1
  15.  
  16. ### Default variables
  17. . /etc/sysconfig/subversion
  18.  
  19. RETVAL=0
  20. prog="svnserve"
  21. desc="Subversion Daemon"
  22.  
  23. start() {
  24.         echo -n $"Starting $desc ($prog): "
  25.    daemon $prog -d $OPTIONS
  26.    RETVAL=$?
  27.    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
  28.    echo
  29. }
  30.  
  31. stop() {
  32.    echo -n $"Shutting down $desc ($prog): "
  33.    killproc $prog
  34.    RETVAL=$?
  35.    [ $RETVAL -eq 0 ] && success || failure
  36.    echo
  37.    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
  38.    return $RETVAL
  39. }
  40.  
  41. case "$1" in
  42.   start)
  43.    start
  44.    ;;
  45.   stop)
  46.    stop
  47.    ;;
  48.   restart)
  49.    stop
  50.    start
  51.    RETVAL=$?
  52.    ;;
  53.   condrestart)
  54.         [ -e /var/lock/subsys/$prog ] && restart
  55.    RETVAL=$?
  56.    ;;
  57.   *)
  58.    echo $"Usage: $0 {start|stop|restart|condrestart}"
  59.    RETVAL=1
  60. esac
  61.  
  62. exit $RETVAL

/etc/sysconfig/subversion

  1. # Configuration file for the Subversion service
  2. #
  3. # To pass additional options (for instace, -r root of directory to server) to
  4. # the svnserve binary at startup, set OPTIONS here.
  5. #
  6. #OPTIONS=
  7. OPTIONS="–threads –root /svn"

, , , ,

No comments yet.

Leave a Reply