I am thinking of writing a Rails application for managing servers like cPanel.
The most difficult task is to choose the best way to run commands that require root privileges, for example adduser , or to do what other user privileges require, for example, modify nginx configuration files.
I know only two ways to achieve this:
- I can write a stand-alone daemon that will run as administrator and do all the work, receive commands through IPC or something like that.
- Run the Rail server as the root user and do something from it or run the / bash scripts from it.
Which of these methods is better? Is there any other way of doing this?
source share