Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: How run a daemon as non-root user

by JavaFan (Canon)
on Dec 06, 2008 at 02:26 UTC ( [id://728468]=note: print w/replies, xml ) Need Help??


in reply to Re^4: How run a daemon as non-root user
in thread How run a daemon as non-root user

Well, there are a couple of ways to solve this.
  1. Start the daemon as root, let it create the pid file, then drop the priviledges.
  2. Make /var/run group owned by the group 'daemons' (with group write permission). Start the deamon as a user that belongs to the group 'daemons'.
  3. Use file ACLs to allow the process to write to /var/run.
  4. Make /var/run world writable.
  5. Make a subdirectory in /var/run that's owned by the user running the daemon. Have the daemon use that subdirectory to write the pidfile into. (Any other directory works as well). You might consider putting a symlink from /var/run pointing to the new location.
  6. Create a (permanent) pidfile in /var/run that's owned by the user running the daemon. Let the daemon clear the pidfile when it exists upon removal. And where it currently associates a meaning to the (non-)existance of the pidfile, let it now associate a meaning to it being of (non-)zero size.
  • Comment on Re^5: How run a daemon as non-root user

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://728468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (1)
As of 2026-05-10 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.