大致如下
[root@service home]# systemctl start svnserve.service
Job for svnserve.service failed because the control process exited with error code. See "systemctl status svnserve.service" and "journalctl -xe" for details.
[root@service home]# systemctl status svnserve.service -l
● svnserve.service - Subversion protocol daemon
Loaded: loaded (/usr/lib/systemd/system/svnserve.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2020-06-09 16:20:25 CST; 23s ago
Process: 22664 ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS (code=exited, status=1/FAILURE)
Jun 09 16:20:25 service systemd[1]: Starting Subversion protocol daemon...
Jun 09 16:20:25 service svnserve[22664]: svnserve: E000013: 无法检查路径 “/home/svn”: 权限不够
Jun 09 16:20:25 service svnserve[22664]: DIGEST-MD5 common mech free
Jun 09 16:20:25 service systemd[1]: svnserve.service: control process exited, code=exited status=1
Jun 09 16:20:25 service systemd[1]: Failed to start Subversion protocol daemon.
Jun 09 16:20:25 service systemd[1]: Unit svnserve.service entered failed state.
Jun 09 16:20:25 service systemd[1]: svnserve.service failed.
[root@service home]# 执行journalctl -xe
listinfo/systemd-devel
--
-- Unit svnserve.service has begun starting up.
Jun 09 16:21:21 service svnserve[22701]: svnserve: E000013: 无法检查路径 “/home/svn”: 权限不够
Jun 09 16:21:21 service svnserve[22701]: DIGEST-MD5 common mech free
Jun 09 16:21:21 service systemd[1]: svnserve.service: control process exited, code=exited status=1
Jun 09 16:21:21 service systemd[1]: Failed to start Subversion protocol daemon.
-- Subject: Unit svnserve.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit svnserve.service has failed.
--
-- The result is failed.
Jun 09 16:21:21 service systemd[1]: Unit svnserve.service entered failed state.
Jun 09 16:21:21 service systemd[1]: svnserve.service failed.
Jun 09 16:21:21 service dbus[9836]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Jun 09 16:21:21 service polkitd[9871]: Unregistered Authentication Agent for unix-process:22695:711745 (system bus name :1.105, object path /org/freedesktop/P
Jun 09 16:21:22 service dbus[9836]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Jun 09 16:21:22 service setroubleshoot[22704]: failed to retrieve rpm info for /home/svn
Jun 09 16:21:22 service setroubleshoot[22704]: SELinux is preventing /usr/bin/svnserve from getattr access on the directory /home/svn. For complete SELinux me
Jun 09 16:21:22 service python[22704]: SELinux is preventing /usr/bin/svnserve from getattr access on the directory /home/svn.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that svnserve should be allowed getattr access on the svn directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'svnserve' --raw | audit2allow -M my-svnserve
# semodule -i my-svnserve.pp
解决方案:
# 执行下面两行命令
ausearch -c 'svnserve' --raw | audit2allow -M my-svnserve
semodule -i my-svnserve.pp
# 在执行svn启动命令
systemctl start svnserve.service
另当使用svn客户端连接仓库的时候也会提示权限不足解决如下
#关闭SELinux,两种方式:
1、临时关闭:setenforce 0
2、修改配置文件(需要重启服务器):
vi /etc/selinux/config
修改SELINUX=enforcing为SELINUX=disabled
重启服务器:
reboot