[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

implicit linkage



Andrei Popescu:
Why should I write a script? I'm not a programmer.
I can write a (simple) shellscript, but I wouldn't dare write an
initscript or even a daemontools runscript.

You have an incorrect mental model of the relative difficulty of the tasks. A run program for a daemontools-family service is a handful of lines of script, often a one-liner. And many shell constructs are simply unnecessary, to the point that people sometimes don't even write these scripts with a shell as the interpreter at all, using one of the several simpler script interpreters available instead (such as execline). (And there's nothing saying that run programs even have to be interpreted scripts at all.) Gerrit Pape has collected a few run scripts over the years, and one can see what a typical run script looks like. The one for squid is at http://smarden.org/runit/runscripts.html#squid for example. Wayne Marshall also made an annotated collection about 10 years ago, which can be seen at http://thedjbway.b0llix.net/services.html . An /etc/init.d/ script, on the other hand, is lots of shell in comparison and by far the more difficult of the twain to write.

The irony is that your stated ability to write a simple shell script is in fact enough to be able to write a run script for a daemontools-family service.

Andrei Popescu:
I recently needed something to run imapfilter and restart it in case
it might exit, so I had a look at daemontools. I gave up quickly after I
realised the amount of scaffolding required just to get daemontools
itself running (additional top-level directories, are you kidding?).

The service scanner directory used by the daemontools-run package in Debian Linux is /etc/service/, which is not a top-level directory by anyone's measure. You actually have a Debian package with the Debianisms already built in for you. You'd have done much better to have started with it.


Reply to: