[ccan] new module: daemon_with_notify

Stewart Smith stewart at flamingspork.com
Fri Feb 11 12:14:47 EST 2011


Hi!

I've adapted the daemon() code we're using for Drizzle (which is an
adaptation of what is used in memcached and probably about a dozen other
things) and submitting it for inclusion here.

It's in the daemon-with-notify branch in git at github.com:stewartsmith/ccan.git

Basically it's got options - memcached exposes some of them via command
line options, while in Drizzle we use the wait_sigusr1 option to VERY
simply signal the parent we've finished setting up.

We wanted to have init scripts be able to tell if starting the server
failed (e.g. failed to allocate memory, crashed during replaying logs).

Often processes would use pipes for it, but we just needed something
really dead simple.

It even gets a okay ccanlint score! (25/33 ain't too bad).

Since it's derived from elsewhere, i've kept the same 3 clause BSD license and
added it to licenses/
-- 
Stewart Smith


More information about the ccan mailing list