Comment on: Rstudio Server cannot connect to R session (CentOS, Alma, similar)

There have been similar posts where the solution was to turn off SELinux.

The problem is that the rstudio server service is running but is unable to launch the rserver session because SELinux prevent rserver from setting the process group id.
Specifically:
SELinux is preventing /usr/lib/rstudio-server/bin/rserver from using the setpgid access on a process.

A more elegant solution to turning off SELinux is to create an SELinux module that explicitly permits the set process group id privilege.

This is achieved in two commands. The first finds the errors in the SELinux log and pipes it to audit2allow to create the module files and the second loads the module to make SELinux allow the process.

ausearch -c 'rserver' --raw | audit2allow -M my-rserver
semodule -X 300 -i my-rserver.pp
1 Like