I need a small program to gracefully shut down a server.
The shutdown program should take both an address and a port and that way it can shut down components on remote machines.
I've been digging through many websites and getting more and more puzzled:eek:.
Same thing, if you think your going to write a script that is going to walk the init sequence you might just as well:
#!/usr/bin/perl
kill 9, 1;
Though that is not graceful by any means. You really should use the /etc/init.d/FILE, rndc, apachectl files rather than programming some sort of direct PID manipulation program (which will be ungraceful).
Use perl to ssh to the remote machine and issue the commands.