News for hackers. Stuff that matters.
Re:Notqmail: Collaborative open-source successor to qmail by koolba on Sunday July 28, 2019 @09:16PM (#20550780)
Somewhat related, have there any updates or a forked version of daemontools?

https://en.m.wikipedia.org/wiki/Daemontools

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!

Re:Notqmail: Collaborative open-source successor to qmail by death_syn on Sunday July 28, 2019 @10:54PM (#20551186)
Daemontools-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.
Re:Notqmail: Collaborative open-source successor to qmail by jasonjayr on Sunday July 28, 2019 @09:28PM (#20550832)
runit is a modern rewrite folling djb's principals... http://smarden.org/runit/
Re:Notqmail: Collaborative open-source successor to qmail by buildzr on Sunday July 28, 2019 @11:49PM (#20551391)
I 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.
Re:Notqmail: Collaborative open-source successor to qmail by petre on Monday July 29, 2019 @12:08AM (#20551442)
We still use it under systemd to run our services. I don't trust systemd to work reliably.
Re:Notqmail: Collaborative open-source successor to qmail by LargoLasskhyfv on Monday July 29, 2019 @06:47PM (#20560278)
Some 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/

Then there is

[2] 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/

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!

Re:Notqmail: Collaborative open-source successor to qmail by idratherbike on Monday July 29, 2019 @07:14AM (#20553301)
https://skarnet.org/software/s6/ is pretty much original daemontools with a couple additions
Re:Notqmail: Collaborative open-source successor to qmail by stevekemp on Sunday July 28, 2019 @11:49PM (#20551389)
runit is the modern alternative, I guess. But things like this are very simple so I'd be surprised if they needed updates - or rewrites.
Re:Notqmail: Collaborative open-source successor to qmail by arantius on Monday July 29, 2019 @12:41PM (#20556512)
What is it that you want, which you're not getting? I also use and love daemontools. Stability is a feature.
Re:Notqmail: Collaborative open-source successor to qmail by 3xblah on Monday July 29, 2019 @04:58AM (#20552699)

   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 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;
Re:Notqmail: Collaborative open-source successor to qmail by knowsmorsecode on Monday July 29, 2019 @09:31AM (#20554384)
Why killpg?
Re:Notqmail: Collaborative open-source successor to qmail by 693471 on Monday July 29, 2019 @09:51PM (#20561384)
I suspect to kill all children and not rely on the parent you're supervising to clean up.