How to start svnserve.service on Fedora 18

Henrik asked:

I’m trying to start svnserve.service on Fedora 18 using:

systemctl enable svnserve.service
systemctl start svnserve.service

But I get the following error:

Feb 21 22:26:51 svnserve[1606]: svnserve: E000013: Can't check path '/home/henrik/svn': Permission denied
Feb 21 22:26:51 systemd[1]: svnserve.service: control process exited, code=exited status=1
Feb 21 22:26:51 systemd[1]: Failed to start Subversion protocol daemon.
Feb 21 22:26:51 systemd[1]: Unit svnserve.service entered failed state

But when I try to start svnserve from the command prompt it works just fine:

svnserve -d -r /home/henrik/svn

What could be the problem?

I tried to change permissions in the /home/henrik/svn cataloge but no luck…

Output from ls -ld /home/henrik/svn:

[[email protected] henrik]# ls -ld svn
drwxr-xr-x. 7 henrik henrik 4096 Feb 21 21:41 svn


type=AVC msg=audit(1361531583.530:291): avc:  denied  { search } for  pid=954 comm="svnserve" name="home" dev="dm-1" ino=2883585 scontext=system_u:system_r:svnserve_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1361531583.530:291): arch=c000003e syscall=4 success=no exit=-13 a0=7f2fdcd94438 a1=7fff01357bf0 a2=7fff01357bf0 a3=7fff01357980 items=0 ppid=1 pid=954 auid=4294967295 uid=1003 gid=1003 euid=1003 suid=1003 fsuid=1003 egid=1003 sgid=1003 fsgid=1003 ses=4294967295 tty=(none) comm="svnserve" exe="/usr/bin/svnserve" subj=system_u:system_r:svnserve_t:s0 key=(null)
type=SERVICE_START msg=audit(1361531583.668:292): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="svnserve" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'


I followed Michaels advice. SELinux stops complaining about svnserve. Now the problem is that svnserve won’t start anyway, and it doesn’t give me any good fault description:

[[email protected] ~]# systemctl status svnserve.service
svnserve.service - Subversion protocol daemon
          Loaded: loaded (/usr/lib/systemd/system/svnserve.service; enabled)
          Active: failed (Result: exit-code) since Sun 2013-02-24 22:04:35 CET; 2s ago
         Process: 1600 ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/ $OPTIONS (code=exited, status=0/SUCCESS)
        Main PID: 1601 (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/svnserve.service

Feb 24 22:04:35 systemd[1]: Started Subversion protocol daemon.
Feb 24 22:04:35 systemd[1]: svnserve.service: main process exited, code=exited, status=1/FAILURE
Feb 24 22:04:35 systemd[1]: Unit svnserve.service entered failed state

My answer:

We see from the audit log that SELinux denied svnserve access to traverse the /home directory, to descend into child directories. As far as I can tell, svnserve should have permission to traverse /home, so you’re likely looking at a bug. As such, you should report it on the Red Hat bugzilla.

As a workaround, while you wait for a fix, you can have svnserve run unconfined by SELinux (without disabling it system-wide). This is temporary and will be undone by a relabel or package update, so you may have to reapply it if a future update doesn’t resolve the issue.

chcon -t unconfined_exec_t $(which svnserve)

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.