Hacker News new | past | comments | ask | show | jobs | submit | more skarnet's comments login

Yes, that was exactly the idea behind s6-fdholder-daemon: set up a central server to keep fds open when you need to restart a process. The old process stores the fd into the fdholder, then dies; the supervisor starts the new process, that retrieves the fd from the fdholder, and starts serving.

And if you don't want to use a supervisor or a fdholder, you don't even need to coordinate, and you never need to fork: simply re-exec your executable with your serving socket in a conventional place (stdin is good). Daemons should be able to take a preopened listening socket and serve on it; hot-restarting is then a simple matter of one execve(). There's really no reason to make it more complicated.


Note that: - You do not have to follow the slashpackage convention to use or build s6. You can configure it out. - You do not have to write your init scripts in execline. Any scripting language, including the shell, will do; I use execline because it allows me to do things /bin/sh does not, or not easily. - There is a mailing-list, supervision@list.skarnet.org, dedicated to software like s6 and runit. If you have trouble building, installing or using such software, please subscribe and ask for help. I'm absolutely willing to make s6 easier to use, but I need the feedback.

Thanks for giving s6 a chance! You won't be disappointed - and if you are, make sure to let me know why.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: