I just -- as a quick hack -- added SB-KERNEL::GC-LOGFILE, which if set
causes per generation statistics to be logged before and after each GC
to that file.
https://github.com/nikodemus/SBCL/tree/gc-logfile
I don't have a nice public API for it, and am unlikely to spend much
time thinking about one right now.
I'm wondering if I should commit it anyways in case someone needs it
-- or just leave it like that at github for now.
Cheers,
-- Nikodemus

Nikodemus Siivola <nikodemus@...> writes:
> * Added options to install handlers in the child for :SIGTERM,
> :SIGABRT, and :SIGINT. (Adding new ones is trivial -- advice on which
> ones to add support for would be good. So would advice if there are
> any built-in handlers that would be good to provide so everyone
> doesn't have to write the same ones...)
SIGHUP comes to mind -- idiomatically, the child should respond by
reloading its configuration (if any), which will obviously be specific
to the app, but a quick way to pass a proc to be called on HUP would be
a win.
--
Jim Wise
jwise@...

2011/5/26 Nikodemus Siivola <nikodemus@...>:
> https://github.com/nikodemus/sb-daemon
I incorporated some excellent advice from Andreas Fuchs, and then
added some feature creep:
* Current directory is always changed to / in the child. Those needing
something else can chdir in the child afterwards.
* Added process reaping for :EXIT-PARENT NIL case. Reaping can be
explicitly disabled if the parents wants to waitpid() on its own.
* Disabled debugger in child by default.
* Made the daemonization interrupt safe-er.
* Added support for :EXIT-HOOK for the :EXIT-PARENT NIL case.
* Added options to install handlers in the child for :SIGTERM,
:SIGABRT, and :SIGINT. (Adding new ones is trivial -- advice on which
ones to add support for would be good. So would advice if there are
any built-in handlers that would be good to provide so everyone
doesn't have to write the same ones...)
Cheers,
-- nikodemus