K 10 svn:author V 7 trociny K 8 svn:date V 27 2012-02-19T10:20:37.879456Z K 7 svn:log V 554 The pidfile_open(3) is going to be fixed to set close-on-exec in order not to leak the descriptor after exec(3). This raises the issue for daemon(3) of the pidfile lock to be lost when the child process executes. To solve this and also to have the pidfile cleaned up when the program exits, if a pidfile is specified, spawn a child to exec the command and wait in the parent keeping the pidfile locked until the child process exits and remove the file. Reported by: Andrey Zonov Suggested by: pjd Reviewed by: pjd MFC after: 2 weeks END