reported by @stacyharper, this is actually the problem that I was trying to debug in #37. See my comments in that issue for more details.
go's os/exec doesn't consider the parent process to done (even if it crashes) since the stdout/stderr pipes are still open by any child process(es) it forks. One way to solve this is to send an
os.File directly to exec to have service output written to separate files directly, instead of sending a pipe.
this can be reproduced by using the script from #37, and
killing the parent process (the child should stay alive). superd will consider it still running.
I'll probably have to ditch go-cmd (or make a large patch for it...) to support calling Go's
os.File, since that module only gives
io.Writerthing, which causes this whole issue.
I think this problem is due to this behavior in the Go runtime: https://go-review.googlesource.com/c/go/+/401835/11/src/os/exec/exec.go#247
// If WaitDelay is zero (the default), I/O pipes will be read until EOF, // which might not occur until orphaned subprocesses of the command have // also closed their descriptors for the pipes.