1、在/usr/lib/systemd/system/添加svnserve.service文件,文件内容如下:
[Unit]
Description=Subversion protocol daemon
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/svn #一定要写svnserve命令的绝对路径 [Install]
WantedBy=multi-user.target
2、执行
systemctl enable svnserve.service
3、其它、
systemctl start svnserve.service
systemctl enable svnserve.service
systemctl disable svnserve.service
systemctl status svnserve.service
systemctl restart svnserve.service
systemctl list-units --type=service