On Sat, Aug 23, 2003 at 01:10:04PM -0500, Jake wrote: > Hi, > > Can I stop the server from a client? I wanted to build a POE script that > would accept start and stop arguments. that is I could call it like: > > ./serverd start > > And it would start my server (which I know how to do). > > Then I could call it like: > > ./serverd stop > > Which I figure would have to launch a client process, that would connect to > the server and tell it to "stop". I tried putting into my client code: > > $kernel->post(myaliasd => "shutdown"); > > But then my client hangs and my server doesn't stop
If you use Net::Server::Daemonize, there is a facility for dumping a PID file to disk somewhere. In "stop" mode, serverd can find the PID of the running copy and just kill TERM => $that_pid; If your server isn't handling SIGTERM, it'll shut down after that. Things get interesting if you have any shutdown tasks to perform. -- Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/
