:: Re: [Dng] Why daemontools is so coo…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Steve Litt
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [Dng] Why daemontools is so cool
On Sat, 28 Mar 2015 17:04:39 +0100
poitr pogo <lepoitr@???> wrote:

> s6 advertises itself as init replacement.
> I'm not using s6 or daemontools. I do not need them. Just learned
> about them and I'm bit surprised thy tend to replace init instead of
> being a good helpers for those who need them.
>
> IMHO they came into existence cause more and more applications were
> missing "deamon" part, to make sysadmin/programmer life easier. s6 doe
> not support those which daemonize on its own, anyway :)


Do one thing and do it right. You create a daemon: Perhaps a server,
perhaps something else. Above all else, it's a **program**. It has a
function. At least for debugging purposes, it darn well better be able
to run in the foreground (sorry Apache2 and nginx). Do one thing and do
it right: No need to mix doubleforking and PID tracking on your
program. That should be the duty of whatever daemonizes and manages
your program. You know, like Daemontools or s6.

I got tired of cron on my Wheezy box (long story), so I created my own
cron system in Python. It reads its (almost compatible) crontab file,
checks the current time, and does the called-for commands, then sleeps
for 31 seconds and does it all over again. I can run it in a terminal
and watch everything message through on the screen. Once it was working
properly, I just gave it a daemontools run script, and bang, it was a
genuine daemon. No doublefork in my program. No PID tracking in my
program. Nothing but cron.

That's how life should be. My program takes care of its business and
nothing more, and my program's instance management is up to daemontools,
which was designed from the ground up to do that management.


SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance