Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up a few PHP Gearman Daemons running on PEAR System_Daemon. I need them to be able to write to the following locations...


What permissions should I set for them? I don't mind creating a different user or what have you, but I am just not the greatest with File Permissions. I want to do this right, not chmod 777 for ease of use and running as root which is never a good idea.

Help this file permission idiot?

share|improve this question
up vote 0 down vote accepted

You can create a user:group for this daemon, and give them the permissions you need.

As root you can always

sudo -u newuser $program
share|improve this answer
What exact chmod should I give them? Obviously init.d will need the most, but I don't want to do a blanket chmod 777... – Urda Feb 8 '10 at 13:36
I'd say 550 should be ok. and of course chown $user:$group – dyasny Feb 8 '10 at 14:26
chmod 550 = Read + Execute for Group and Owner Right? ...wouldn't the log file need to a write flag? – Urda Feb 8 '10 at 14:35
yes, if you're writing, you'll need to have rw access, 660 I guess – dyasny Feb 8 '10 at 14:57
Yes, the System_Daemon method writes an init.d script on first or updated startup, updates log file always, and needs to write the PID file. I'll try this later today / tomorrow and let you know if System_Daemon likes the new settings. Much better than blanket permissions :) – Urda Feb 8 '10 at 15:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.