I have a service that executes users' scripts which in turn spawn more processes. Some of those processes stop on external conditions that might not take place. Since the the parent is gone (e.g. may crash), how can anybody else know PID of the orphaned process to stop it?Is there any reliable way to store PID so that it is not overwritten by mistake?If PID file is the only option, should it be writable by designated per-process user as a convention?Should I ban using shared account so that users can killall their own processes safely?Should I think of policy that will result in killing orphaned processes immediately so that scripts are forced to manage them reliably?
How to manage users' orphaned processes?
services;daemon;process management