It is such an amazing business-friendly but risk-ignorant pattern to
simply restart software that has failed.

It's like you keep flying a plane that falls out of the sky twice,
rather than cease operation, figure out what is wrong, and fix it before
continuing.

Edd Barrett <e...@theunixzoo.co.uk> wrote:

> Hi all,
> 
> Here's a port of Dinit: a process supervisor.
> 
> I've been using this to run things that I want to run in the background
> as me:
> 
> ---8<---
> $ dinitctl list
> [{+}     ] boot
> [{+}     ] mail-loop (pid: 10728)
> [{+}     ] syncthing (pid: 6734)
> [{+}     ] mpd (pid: 82135)
> $ dinitctl stop mpd
> Service stopped.
> $ dinitctl list    
> [{+}     ] boot
> [{+}     ] mail-loop (pid: 10728)
> [{+}     ] syncthing (pid: 6734)
> [     {-}] mpd
> $ kill 6734  # Pretend syncthing crashed.
> $ dinitctl list
> [{+}     ] boot
> [{+}     ] mail-loop (pid: 10728)
> [{+}     ] syncthing (pid: 96866)
> [     {-}] mpd
> --->8---
> 
> I've supplied a rc script in case anyone wishes to manage system-wide
> services using it. Note that the system-wide instance runs as root so
> that it can start services which need root permissions for whatever
> reason. I've added a note to that effect in the README.
> 
> Comments? OK?
> 
> -- 
> Best Regards
> Edd Barrett
> 
> http://www.theunixzoo.co.uk

Reply via email to