
8

svn启动脚本-subversion for linux
source link: https://www.liurongxing.com/svn-startup-scripts.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

svn启动脚本-subversion for linux
花了两天多时间才把公司SVN大概的安装完成,哎默认安装完后没有启动脚本,所以在网上找了一下。
1:编写如下脚本”svnd”放到/etc/rc.d/init.d/目录下
vi
/etc/rc
.d
/init
.d
/svnd
#!/bin/bash
# Init file for Svn server daemon
#
# chkconfig: 2345 80 25
# description: SVNserver server daemon
#
# processname: svnd
SVN_HOME=
/usr/bin
SVN_REPOS=
/data/www/svn
if
[ ! -f
"$SVN_HOME/svnserve"
]
then
echo
"svnserver startup: cannot start"
exit
fi
case
"$1"
in
start)
echo
"Starting svnserve..."
$SVN_HOME
/svnserve
-d -r $SVN_REPOS
echo
"Finished!"
;;
stop)
echo
"Stoping svnserve..."
killall svnserve
echo
"Finished!"
;;
restart)
$0 stop
$0 start
;;
*)
echo
"Usage: svn { start | stop | restart } "
exit
1
esac
2:赋予执行权限
chmod
755
/etc/rc
.d
/init
.d
/svnd
3:加入chkconfig,并设置开机启动。
[root@javasboy init.d]
# chkconfig --add svnd
[root@javasboy init.d]
# chkconfig svnd on
[root@javasboy init.d]
# chkconfig --list svnd
svnd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK