svn 把目錄放在/home/svn 提示權限不足


大致如下

[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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM