Re: Shutting down a service
From: Walt Howard (whoward_at_piv27.cns.ualberta.ca)
Date: 02/19/04
- Next message: Rich Lenihan: "OpenLDAP for 64-bit 11i?"
- Previous message: Nissan 350Z: "Re: lvcreate to use all available space on PV?"
- In reply to: Pn1995: "Shutting down a service"
- Next in thread: Joachim Ring: "Re: Shutting down a service"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Feb 2004 19:28:14 +0000 (UTC)
In article <e9d6d32c.0402190156.1d2b32d2@posting.google.com>,
Pn1995 <pn1995@yahoo.co.uk> wrote:
>When one of our services fails on our HPUNIX box we want to be able to
>send a command to a Windows 2000 server to stop a 2000 service on that
>box. Does anyone know how to do this?
There are really two questions here: 1) Can HP-UX initiate some process
when another process terminates, and 2) Can a Win2000 process be stopped
by an external network-delivered command?
For 1), the answer is not too bad. Write a parent process that will
fork(2) and exec(2) the process that may fail, and have the parent
wait(2) for the failure. When the wait() returns, the parent can
exec() the process that sends a command to Windows. The only kicker
is that the process that may fail should not daemonize itself, otherwise
its parent will lose track of it and the wait() will return early.
For 2), you'll need to have the source for the Win2000 service so you
can insert some code to open a port and periodically poll it for a
message. Make sure the service is very fussy about the source and
structure of the message, lest you make it too easy for bad guys to
shut down your service. If you can't modify the service program,
there still might be a way using something like an sshd service, but
it would be touchy and I won't go there.
- Next message: Rich Lenihan: "OpenLDAP for 64-bit 11i?"
- Previous message: Nissan 350Z: "Re: lvcreate to use all available space on PV?"
- In reply to: Pn1995: "Shutting down a service"
- Next in thread: Joachim Ring: "Re: Shutting down a service"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|