Search code examples
rselinuxrstudio-server

How to run RStudio Server with SELinux enabled?


RStudio Server is failing to log in user when SELinux is enforcing. There is a long list of SELinux errors, starting with:

AVC avc: denied { setpgid } for pid=32444 comm="rserver" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0

RStudio Server runs fine when SELinux is in permissive mode, albeit with a lot of alerts:

enter image description here

RStudio maintainers don't consider this a bug and closed the issue. Meanwhile, given how niche RStudio Server is, it might be a while before Fedora implements SELinux policy for it, though they have not rejected the request.

Is anyone running RStudio Server successfully with SELinux enabled?


Solution

  • sudo chcon -R -t bin_t /usr/lib/rstudio-server/bin/
    

    This gives the binaries the right context, since they are for some reason in a directory for libraries.

    However, this solution lets RStudio Server run unconstrained since no targeted policy exists for it yet.