-
-
Save Dave-Snigier/d1c6a3f491e06579704f to your computer and use it in GitHub Desktop.
svnserve init script (tested on CentOS/RHEL 5.x)
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 | |
source /etc/rc.d/init.d/functions | |
[ -x /usr/bin/svnserve ] || exit 1 | |
### Default variables | |
SYSCONFIG="/etc/subversion/svnserve.conf" | |
### Read configuration | |
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG" | |
RETVAL=0 | |
prog="svnserve" | |
desc="Subversion Daemon" | |
start() { | |
echo -n $"Starting $desc ($prog): " | |
daemon --user $USER $prog -d --log-file "$LOG_PATH" --root "$ROOT" $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