ubuntu 添加svn服务

1 添加文件“svn-ctl”到 /etc/init.d/ 目录下,内容如下

{

#! /bin/sh

### BEGIN INIT INFO
# Provides: svn-ctl
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: OpenBSD Secure Shell server
### END INIT INFO

case "$1" in
start)
svnserve -d -r /backup/svn1/repos
;;
restart|reload|force-reload)
;;
stop)
killall svnserve
;;
*)
echo "svn-ctl all"
;;
esac

}

2 添加服务

sudo update-rc.d svn-ctl defaults

3 如果需要删除服务的话,做如下操作

sudo update-rc.d -f svn-ctl remove

删除/etc/init.d/svn-ctl文件

原文地址:https://www.cnblogs.com/bluebbc/p/2587815.html