Programs like apache2 and mysql install on various machines throughout the world. How do they ensure they know the uid or gid of the restricted rights user they wish to run as? I want my program to run as a service with a user who has least privileges through init.d. I assume services started in init.d are initially run as root?
Programs like apache2 and mysql install on various machines throughout the world. How do
Share
Usually there’s a configuration file which specifies the user the service is to use. Then the service can use
getpwnam(3)and retrieve the UID.