rstudio/shiny-server — pull request #19 by jcheng5 (2013-06-21 01:30:51+00:00)
Title: Don't require superuser to install or run shiny-server

This change is made more complicated by the fact that shiny-server supports several scenarios that actually do require root. We want to allow those (at least for now?) while also supporting non-root scenarios.

Here are the reasons we might have to require root:

1. Multiple users specified using run_as
2. user_apps is being used--need to launch R processes as any user at any time
3. Listen directive uses port 1-1023

Here are some possible situations during runtime:

1. If root is required and we are running as root, great.
2. If root is not required and we are not running as root, great.
3. If root is required and we are not running as root, error out with a detailed log message.
4. If root is not required and we are running as root, warn but continue.

Note also that it is possible for situations 1-4 to change if the config file is reloaded during runtime (I think sending SIGHUP does this). It's possible for config reload to fail if #3 is true.