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

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)

1 Answer

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like