4 ms·
Somewhat related, have there any updates or a forked version of daemontools? https://en.m.wikipedia.org/wiki/Daemontools https://en.m.wikipedia.org/wiki/Daemon
by koolba 7y ago
Somewhat related, have there any updates or a forked version of daemontools?
https://en.m.wikipedia.org/wiki/Daemontools https://en.m.wikipedia.org/wiki/Daemontools
http://cr.yp.to/daemontools.html http://cr.yp.to/daemontools.html
I’ve been using parts of it for many many years without issue but it does feel odd that nothing has required an update in nearly 20 years. Maybe the Unix philosophy and DJB is just that good!
- jasonjayr 7y agorunit is a modern rewrite folling djb's principals... http://smarden.org/runit/ http://smarden.org/runit/
- buildzr 7y agoI use runit for pretty much everything now, I love it, no need to worry about if you're running BSD rc, systemd or sysvinit, there's always a runit package available that integrates with it and it handles logging so nicely.
- petre 7y agoWe still use it under systemd to run our services. I don't trust systemd to work reliably.
- stevekemp 7y agorunit is the modern alternative, I guess. But things like this are very simple so I'd be surprised if they needed updates - or rewrites.
- death_syn 7y agoDaemontools-encore is a fork with minor feature updates, and there's also a whole ecosystem of choices like Runit, S6, and nosh to look at if you're really interested.
- 3xblah 7y agodiff -Nur admin.orig/daemontools-0.76/src/supervise.c admin/daemontools-0.76/src/supervise.c --- admin.orig/daemontools-0.76/src/supervise.c 2010-02-19 11:08:15.000000000 +0100 +++ admin/daemontools-0.76/src/supervise.c 2010-02-19 12:53:16.000000000 +0100 @@ -86,6 +86,8 @@ const char *run[2] = { "./run", 0 }; +int flagfailed = 0; + void trystart(void) { int f; @@ -94,6 +96,7 @@ case -1: strerr_warn4(WARNING,"unable to fork for ",dir,", sleeping 60 seconds: ",&strerr_sys); deepsleep(60); + flagfailed = 1; trigger(); return; case 0: @@ -153,6 +156,11 @@ } } + if (flagfailed && flagwant && flagwantup){ + flagfailed = 0; + trystart(); + } + if (read(fdcontrol,&ch,1) == 1) switch(ch) { case 'd': diff -Nur admin.orig/daemontools-0.76/src/supervise.c admin/daemontools-0.76/src/supervise.c --- admin.orig/daemontools-0.76/src/supervise.c 2001-07-12 18:49:49.000000000 +0200 +++ admin/daemontools-0.76/src/supervise.c 2012-12-23 21:54:20.437771704 +0100 @@ -97,6 +97,8 @@ trigger(); return; case 0: + setsid(); + setpgid(0,0); sig_uncatch(sig_child); sig_unblock(sig_child); execve(*run,run,environ); @@ -158,7 +160,7 @@ case 'd': flagwant = 1; flagwantup = 0; - if (pid) { kill(pid,SIGTERM); kill(pid,SIGCONT); flagpaused = 0; } + if (pid) { killpg(pid,SIGTERM); killpg(pid,SIGCONT); flagpaused = 0; } announce(); break; case 'u': @@ -173,29 +175,29 @@ if (!pid) trystart(); break; case 'a': - if (pid) kill(pid,SIGALRM); + if (pid) killpg(pid,SIGALRM); break; case 'h': - if (pid) kill(pid,SIGHUP); + if (pid) killpg(pid,SIGHUP); break; case 'k': - if (pid) kill(pid,SIGKILL); + if (pid) killpg(pid,SIGKILL); break; case 't': - if (pid) kill(pid,SIGTERM); + if (pid) killpg(pid,SIGTERM); break; case 'i': - if (pid) kill(pid,SIGINT); + if (pid) killpg(pid,SIGINT); break; case 'p': flagpaused = 1; announce(); - if (pid) kill(pid,SIGSTOP); + if (pid) killpg(pid,SIGSTOP); break; case 'c': flagpaused = 0; announce(); - if (pid) kill(pid,SIGCONT); + if (pid) killpg(pid,SIGCONT); break; case 'x': flagexit = 1;
- knowsmorsecode 7y agoWhy killpg?
- idratherbike 7y agohttps://skarnet.org/software/s6/ https://skarnet.org/software/s6/ is pretty much original daemontools with a couple additions
- arantius 7y agoWhat is it that you want, which you're not getting? I also use and love daemontools. Stability is a feature.
- LargoLasskhyfv 7y agoSome others already mentioned runit which seems feature complete. There is also s6, s6-rc and its associated tools, done in essentially the same spirit, micromanaged into the smallest possible units. At least it feels like that. Which leads to strange experiences if you lazily try to integrate them into your system, because they are so fast that you almost never see them appear in something like htop, not even as a short blip. Even on some small ARM idling at 200Mhz. One really has to watch the logs, and do it in a systematical way. But i like that. One of the rare pieces of software which don't make me aggressive or want to vomit, like very precise and exact clock work, or very good bicycle gearing. Silent and satisfying! [1] http://skarnet.org/software/ http://skarnet.org/software/ Then there is [2] http://web.obarun.org/software/ http://web.obarun.org/software/ which is an attempt to ease that micromanagement from an archlinux derivative, which uses this instead of systemd. Furthermore there is [3] https://jdebp.eu/Softwares/nosh/ https://jdebp.eu/Softwares/nosh/ with the same goals, looking very impressive on paper, but written in C++? I don't know what to make of that. But probably try it out some time, even if only for the user space virtual terminal from there. So... daemon tooling is far from dead!