1、将代码存为svn_service
2、复制到 /etc/init.d/ 下
3、mkdir /var/svn
4、确认 /etc/service 中 如下设置:
svn 3690/tcp # Subversion
svn 3690/udp # Subversion
5、ln -s /etc/init.d/svn_service /etc/rc0.d/K10svn_service
6、启动服务
7、cd /var/svn, svnadmin create project
8、
svn 服务器启动代码:
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Subversion service
# subversion options
OPTIONS="-d -r /var/svn"
prog=_subversion
RETVAL=0
_subversion=/usr/bin/svnserve
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
start() {
KIND="SubVersion"
echo -n $"Starting $KIND services: "
daemon $_subversion $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/subversion || \
RETVAL=1
return $RETVAL
}
stop() {
KIND="SubVersion"
echo -n $"Shutting down $KIND services: "
killproc $_subversion
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/subversion
echo ""
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
status)
status $dc_server
RETVAL=$?
;;
condrestart)
[ -f /var/lock/subsys/subversion ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
esac
exit $?
|
阅读(1700) | 评论(0) | 转发(0) |