linux svn开机自动启动服务
SVN设置开机自动启动
usr/lib/systemd/system/添加svn.service文件
home/sdbdatasvn/svnrepos(换成绝对路径)
如果出现权限问题,请chmod 777 home/sdbdatasvn/svnrepos
#find /usr -name svnserve
#/home/sdbdatasvn/svnrepos Physical Absolute Path
[Unit]
Description=svn protocol
After=syslog.target network.target
[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/svnserve
ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -d -r /home/sdbdatasvn/svnrepos
[Install]
WantedBy=multi-user.target
文件创建后执行如下命令
- systemctl start svn (启动)
- systemctl status svn (查看状态)
- systemctl stop svn (停止)
- systemcl enable svn(加入自动启动列表)
- 服务启动后 如果出现下面错误
Can't create session svn: Unable to connect to a repository at URL 'svn://192.168.30.119/xxx'
Permission denied svn: Can't open file '/home/sdbdatasvn/svnrepos/xxx/format': Permission denied
原因:未关闭selinux
- getenforce Enforcing(标识运行中)
- setenforce 0(0关闭=Permissive 1运行)
- 永久关闭selinux
- vim /etc/selinux/config SELINUX=disabled
- reboot查看svn是否正常