Perl shutdown of servers

Hello everyone,

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:.

Any help will be very appreciated.

THANK YOU

Minifish

I have the same problem. Can anyone help????????????

ssh root@host /sbin/shutdown

Thanks, I think minifish mentioned shutting down server use perl.
do you know how we can do that? =)

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.

look into the Net::SSH perl module:

Net::SSH - Perl extension for secure shell - search.cpan.org

what does it take to shut down a server?
what does shut down actually mean?

read the manual for whatever machine you are wanting to shutdown.