在/etc/init.d中建立svnserver.sh,内容如下:
#!/bin/bash
if [ ! -f "/usr/bin/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
start)
echo "Starting svnserve..."
/usr/bin/svnserve -d
echo "Finished!"
;;
stop)
echo "Stoping svnserve..."
killall svnserve
echo "Finished!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: svnserver { start | stop | restart } "
exit 1
esac
[root@SVN etc]# cat /etc/rc.local
/etc/init.d/svnserver.sh start