Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: make startup/shutdown scripts work when not using --dont-fork
check_start_stop_script_secure() checks that the parent process has not changed while it is doing its checks, so we need to set the pid of the parent process (main_pid) before calling the function. There is a further complication that called getppid() too soon after a fork() with the parent process exiting after the fork means that we don't get the pid of the new parent, so we need to loop until getppid() returns a diffweent pid. Signed-off-by: Quentin Armitage <[email protected]>
- Loading branch information