Re: non-root daemon and /var/run/daemon.pid
In article <[🔎] 20618.887730923@eeyore.ibcinc.com>,
Roderick Schertler <roderick@argon.org> wrote:
>In the mon package I want to run the daemon as user daemon since it
>doesn't need to be root, but this prevents it from creating its pid
>file in /var/run. My current solution is to create the pid file in the
>/etc/init.d script and chown it to user daemon, but this is a little
>nasty in that the program can't unlink it when it exits. I've worked
>around that by having the program truncate the file if it can't unlink
>it, but that's even nastier.
>
>Is there a better solution?
You could create a subdirectory in /var/run and use that. At startup
/var/run is cleaned up, but subdirectories are preserved.
Mike.
--
Miquel van Smoorenburg | The dyslexic, agnostic, insomniac lay in his bed
miquels@cistron.nl | awake all night wondering if there is a doG
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: