Re: daemontools

Volker Wysk <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <5070079.sWPYUcuffP@desktop>
Am Mittwoch, 31. Januar 2018, 09:00:15 CET schrieb Charles Cazabon:
> Volker Wysk <[email protected]> wrote:
> > Am Donnerstag, 25. Januar 2018, 13:43:45 CET schrieb Charles Cazabon:
> > > My favourite way of running getmail - and other utilities that need to run
> > > on a repeating basis - is daemontools' svscan/supervise programs.  I don't
> > > include a service script (known as a "run" script with daemontools) in the
> > > getmail package either, but it's trivial enough that probably no one would
> > > need me to.
> > 
> > I've dug into daemontools. It's very simple and elegant. Guess it would be
> > my favourite too - if I could get logging working.
> 
> There's a trick you probably missed in the daemontools documentation.
> 
> > The log script /etc/service/test/log/run runs only when started directly. It
> > then logs the stdin to /etc/service/test/log/main/current.
> 
> daemontools only automatically starts the logging service if the main service
> directory has the sticky bit set.
> 
> i.e. chmod +t /etc/service/test
> 
> I don't recall if that will take effect immediately.  You may have to cause
> daemontools to stop the service, remove it, and re-add it.

I've read of this sticky bit, somewhere in the documentation. It's said it applies only for some previous version(s) of Daemontools.

However, I've tried it, such as you wrote. No luck here. It doesn't work.

 
> > > Not everything should be "in the box".  The Unix tool philosophy is do one
> > > thing, and do it well, and let the user hook different programs together
> > > as they see fit, with simple, reliable interfaces.  getmail adheres to
> > > that design philosophy.
> > 
> > Sometimes the software should encapsulate the complexity, and hide it from
> > the user. Rather than hand it over to the user. Doesn't Daemontools do that?
> > Systemd does that, AFAIK. 
> 
> A daemontools service run script for getmail would normally be something as
> simple as:
> 
>   #!/bin/sh
>   sleep 900
>   exec getmail [options]

Yes, that much is clear.


> A systemd "unit file" for getmail doesn't seem quite so trivial to write, at
> least to me.

This is the unit file for daemontools, in /lib/systemd/system/daemontools.service :

   [Unit]
   Description=Daemontools service supervision

   [Service]
   ExecStart=/usr/bin/svscanboot /etc/service/
   Restart=always

   [Install]
  WantedBy=multi-user.target

Doesn't look complicated. Perhaps I will try this, when Deamontools couldn't be made to work.


Cheers
Volker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.