non-root process and PID files

[ Available lists | Index of freebsd-hackers | Month of Oct 2003 | Week of 27 Oct 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Dan Langille <dan@langille.org>
Date
27 Oct 2003 07:31:28
Subject
non-root process and PID files
Message-ID
3F9CF3F6.8307.ABC1250@localhost


[ Hide this part ]
If a process starts up and does a setuid, should it be writing the
PID file before or after the setuid?

Two methods exists AFAIK:

1 - write your PID immediately, and the file is chown root:wheel
2 - write your PID to /var/run/myapp/myapp.pid where /var/run/myapp/
is chown myapp:myapp

Of the two, I think #1 is cleaner as it does not require another
directory with special permissions.

Any suggestions?
--
Dan Langille : http://www.langille.org/


Elapsed time: 0.087 seconds