1、svn自动启动脚本
本脚本房子啊/etc/init.d/ 文件夹下
vi /etc/init.d/svn
svn脚本内容如下:
#!/bin/bash
# chkconfig: - 85 15
# description: svn server
SVN_HOME=/usr/local/svn/sunny
if [ ! -f "/usr/bin/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
start)
echo "Starting svnserve..."
/usr/bin/svnserve -d --listen-port 3690 -r $SVN_HOME
echo "Finished!"
;;
stop)
echo "Stoping svnserve..."
killall svnserve
echo "Finished!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage:svn { start | stop restart } "
exit 1
esac
这里请注意,不要删除# chkconfig: - 85 15和# description: svn server,不然无法使用chkconfig加入服务,会提示service svn does not support chkconfig.
然后执行以下命令:
chmod 755 /etc/init.d/svn
chkconfig --add svn
chkconfig svn on
最后查看下chkconfig --list|grep svn
看svn已经加入到服务中,并已经在2345中为on.
重启
ps -ef | grep svnserve