Re: Q: Daemons, how to kill & restart remotely
Date: 19 Sep 2004 17:37:33 GMT
James Lehman <james[remove]@akrobiz.com> wrote:
> Let's say I have a daemon process that provides a TCP/IP service.
> I can use this service to do many things on the remote machine,
> including uploading a new set of freshly built executables
> that make a whole working solution.
> How do I upload a new build of the daemon process itself?
> Currently, I use the daemon, we'll call it xxxd, to upload a
> file called xxxd_. then I shell into the system, killall xxxd
> and cp xxxd_ over xxxd and restart the daemon.
> Is there a neat way to cause xxxd to kill itself, perform
> the copy and start again?
Just have your daemon write the new version over the old one, then
have it do an exec() to replace itself by the new version. I just
hope you're doing that in a really secure way...
-- \ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de \__________________________ http://www.toerring.de