what user/group are init.d scripts launched as?

2

2

Maybe i got the title wrong so correct me if it is

On system bootup i get the error

spawn-fcgi: opening PID-file '/var/run/php-fastcgi/php-fastcgi.pid' failed: Permission denied

What permission should i set php-fastcgi and what group/user is this being ran as? Would there be a problem if i simply use 777 (i get no errors and php works if i do this)

user3109

Posted 2011-09-27T00:40:30.547

Reputation:

Answers

3

The actual init scripts are run as root. However, they will usually switch to a specific user when executing a daemon.

If you look at the /etc/init.d/php-fastcgi you'll see a start-stop-daemon line in the start() function, which has a --chuid parameter. The parameter says what user the daemon will run as.

It is usually a variable, and so pulled from a config script. If this is ubuntu/debian, this will be /etc/default/php-fastcgi - look in there for a parameter with the same variable name as the chuid parameter. This is the user that needs to have write access to the pid file.

Paul

Posted 2011-09-27T00:40:30.547

Reputation: 52 173