K 10 svn:author V 7 trociny K 8 svn:date V 27 2012-04-01T20:53:35.579094Z K 7 svn:log V 1483 MFC r229667, r230541, r230869, r231909, r231910, r231911, r231912: r229667, r230541, r230869 (ghelmer): Change the notes about the pidfile to include Doug's preference for pre-creating the pidfile with appropriate owner and permissions. Requested by dougb r231909: 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 r231910: If the supervising process receives SIGTERM, forward it to the spawned process. Normally it will cause the child to exit followed by the termination of the supervisor after removing the pidfile. This looks like desirable behavior, because termination of a supervisor usually supposes termination of its charge. Also it will fix the issue with stale pid files after reboot due to init kills a supervisor before its child exits. r231911: Add -r option to restart the program if it has been terminated. Suggested by: Andrey Zonov r231912: If permitted protect the supervisor against pageout kill. Suggested by: Andrey Zonov END