在/etc/init.d中建立svnboot,内容如下:#!/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: svnboot { start | stop | restart } " exit 1 esac使用如下命令在/etc/rc*.d中生成开机自动启动和关机自动终止链接:sudo update-rc.d svnboot defaults这样,就可以在完成svn开机时自动启动,关机时自动停止了。还可以用如下方式直接调用svnboot: 启动:sudo /etc/init.d/svnboot start 停止:sudo /etc/init.d/svnboot stop 重启:sudo /etc/init.d/svnboot restart