Another patch for shepherd! This one I'm much less happy about, but I'm sending it for feedback. I'll explain the problem it solves, then the (hacky) way that it solves it for now. I'm sure there's a better way to solve this, but it was annoying me enough for me to do this now. The problem is that shepherd, when run as a user process, can "lose" services which fork away. Shepherd can still kill them, but a SIGCHLD won't be delivered if they die, so shepherd can't restart/disable them. My prime example is emacs, which I run with --daemon. If I then kill emacs, shepherd will still think that it is running. To solve this problem, I have modified shepherd to poll each process that it thinks is running. I think this is approximately every 0.5s, but I don't quite understand guile's behaviour when it comes to socket timeouts. This involves a subtle change in the meaning of the running field in objects. My patch treats any `integer?` as a pid, and if a corresponding process is not found it will attempt to restart the service. I considered creating a new "pid" datatype to make it clear when a number represents a pid, but didn't want to go overboard without further feedback. So, thoughts? Can anyone suggest a better way to solve this problem? I'm also confused by my new test. If I run it myself then it passes fine, but in a guix build container there is something different which means that the processes don't get reaped properly, so the test doesn't terminate. I'll keep trying to work it out, but if anyone else has an idea I'd love to hear it. Carlo