Re: daemontools

Charles Cazabon <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
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.

> > 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]

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

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------
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.