这是设置建议svnserve
服务“the-Debian-way”以专用的方式运行svn
具有正确日志记录的服务帐户。根据FHS https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard,存储库应存储在/srv/
:
mkdir -p /srv/svn/repos; chown svn /srv/svn/repos
一、systemd的服务配置/etc/systemd/system/svnserve.service
:
[Unit]
Description=Subversion protocol daemon
After=syslog.target network.target
[Service]
Type=forking
RuntimeDirectory=svnserve
PIDFile=/run/svnserve/svnserve.pid
EnvironmentFile=/etc/default/svnserve
ExecStart=/usr/bin/svnserve $DAEMON_ARGS
User=svn
Group=svn
KillMode=control-group
Restart=on-failure
[Install]
WantedBy=multi-user.target
二、服务启动选项/etc/default/svnserve
:
# svnserve options
DAEMON_ARGS="--daemon --pid-file /run/svnserve/svnserve.pid --root /srv/svn/repos --log-file /var/log/svnserve/svnserve.log"
为了正常工作,必须使用正确的所有权和 pid 文件的运行位置来创建日志文件的文件夹:
mkdir /var/log/svnserve; chown svn /var/log/svnserve
mkdir -p /run/svnserve; chown svn /run/svnserve
以日志轮换配置结束/etc/logrotate.d/svnserve
:
/var/log/svnserve/*.log {
daily
missingok
rotate 14
compress
notifempty
create 640 svn adm
sharedscripts
postrotate
if /bin/systemctl status svnserve > /dev/null ; then \
/bin/systemctl restart svnserve > /dev/null; \
fi;
endscript
}
希望这可以帮助。