Ludovic Courtès skribis: > This is due to a race condition: the process terminates before its > service goes from ‘starting’ to ‘running’. > > By the time the service controller calls ‘monitor-service-process’, the > process has already terminated, so the process monitor replies 0 to the > 'await request because that process no longer exists. Fixed in 88cc5a43bf04c13b00b15a8d93cb635d9b64713c by introducing an atomic fork + monitor primitive. For the record, I also considered a hacky but less intrusive solution: adding support for “zombies” in the process monitor, whereby it would record the status of terminated processes and give that (instead of 0) when somebody awaits them (patch attached). It’s fragile though because unlike real zombies, we cannot guarantee that the PID won’t be reused in the meantime; it’s just unlikely. (PID FDs would help, but that’s not portable so best if we can avoid it.) Ludo’.