On Thursday, May 16, 2002, at 12:16 , Matt Simonsen wrote: [..] > I'm guessing this is because I'm not doing it properly... but I'm not sure > exactly what "proper" would be to do this. > > My best guess is I should have the script immediately fork a copy of > itself > then die while the forked copy still runs, but I haven't been able to > figure > out how to make that work. Any suggestions would be helpful, especially a > sample loop like this that just forks a daemon to do something stupid like > print "foo" ; forever.
There are TWO critical problems that you have here: a) starting your daemon b) stopping your daemon since we of course presume that you are coding in perl to avoid the GAGILLIONS of process forkings that it would cost you to do this stuff in /bin/sh - and of course that your daemon itself never 'dies' because of it's elegance, and that all you really need is: http://search.cpan.org/search?dist=Proc-Daemon Since of course you want it to be started in the classical and cannonical way at boot time, and properly shutdown cleanly when the system is shutdown.... I would seriously recommend that you take the time to down load and review what has already been done in the general area of system monitoring at: http://www.kernel.org/software/mon/ I clearly have to get my Daemonology 101 guide back up... ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]