My only suggestion is to look at and study the source to other "things" that do similar tasks. ndc (name daemon control) from the bind/dns processes is the one good one I can think of off the top of my head. There are probably many others...
-Scott
Comment on Re: Controllable daemon, threads, and other things