subversion
#!/bin/bash
#
# Startup script for the Subversion's SVNSERVE
#
# chkconfig: - 85 15
# description: Subversion is an excellent VCS.
# processname: svnserve
# pidfile: /var/run/subversion.pid
# config: /etc/subversion.conf or /etc/subversion/config ?
#
# Author: Dejan Lekic, dejan@nu6.org, http://dejan.lekic.org
# Version: 1.0
# Modification:
# 2005.1.11 by Wan-rong Jih
#
# Source function library.
# . /etc/rc.d/init.d/functions
# This will prevent initlog from swallowing up a pass-phrase prompt.
INITLOG_ARGS=""
# Path to the svnserve binary.
svnserve_prog=/usr/bin/svnserve
svnserve_exec=svnserve
svnserve_pidf=/var/run/subversion.pid
svnserve_user=daemon
svnserve_repo=/Share/svn
RETVAL=0
start() {
echo -n $"Starting $svnserve_exec: "
echo -n $"Executing $svnserve_prog -d -T -r $svnserve_repo"
su -l $svnserve_user -c $"$svnserve_prog -d -T -r $svnserve_repo"
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/subversion
echo `/sbin/pidof svnserve` > $svnserve_pidf
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $svnserve_exec
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/subversion $svnserve_pidf
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $svnserve_exec
;;
restart)
stop
start
;;
reload)
echo -n $"Reloading $svnserve_exec: "
killproc $svnserve_exec -HUP
RETVAL=$?
echo
;;
condrestart)
if [ -f $svnserve_pidf ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
exit 1
esac
exit $RETVAL
0 Comments:
Post a Comment
<< Home