-
-
Save vittee/4648332 to your computer and use it in GitHub Desktop.
svnserve, wrapper for svn daemon, tested with CentOS 6.3
edited to support custom installation prefix (default: /usr/local)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/init.d/subversion | |
# | |
# Starts the Subversion Daemon | |
# | |
# chkconfig: 2345 90 10 | |
# description: Subversion Daemon | |
# copied from http://www.svnforum.org/threads/31170-init.d-script-for-fedora-redhat | |
# processname: svnserve | |
source /etc/rc.d/init.d/functions | |
prefix="/usr/local" | |
[ -x "$prefix/bin/svnserve" ] || exit 1 | |
### Default variables | |
SYSCONFIG="/etc/sysconfig/subversion" | |
### Read configuration | |
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG" | |
RETVAL=0 | |
prog="svnserve" | |
desc="Subversion Daemon" | |
start() { | |
echo -n $"Starting $desc ($prog): " | |
daemon --user ${RUNAS:-$USER} $prefix/bin/$prog -d $OPTIONS | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog | |
echo | |
} | |
stop() { | |
echo -n $"Shutting down $desc ($prog): " | |
killproc $prog | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && success || failure | |
echo | |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog | |
return $RETVAL | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
RETVAL=$? | |
;; | |
condrestart) | |
[ -e /var/lock/subsys/$prog ] && restart | |
RETVAL=$? | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart|condrestart}" | |
RETVAL=1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment