Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue halt remotely 2

Status
Not open for further replies.

wasserl

Programmer
Jul 2, 2001
15
0
0
US
Hi,

I have a GUI running on a diskless Linux machine that boots off of another. The GUI has a button that a user can press to shutdown the entire system. In other words, I need to issue a halt command to the box with the disk across the network.

Any ideas on how to do this?

Thanks,
 

mmm... If it's a diskless X-station it should be "across the network". Anything you run on the client should be on the server you want to reboot.
A simple 'halt' will do.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
It's actually not a diskless X-station. It boots from a floppy disk and mounts the box with the disk. Issuing a halt on the diskless box only shuts down that box.

Any other ideas?
 

rsh to-other-box halt

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
My problem is that I need a script or a program to do this. (Login, halt, logout). Do you think writing a C program using rcmd will work?
 

Whatsa Sea programme??

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
You can try putting this in a script:

# Start of script
ssh root:password@yourotherbox
shutdown -h now
#end of script


Of course replace the word password with your root password and yourotherbox with the IP/Hostname of other box


Visit
 
Use an "Expect" script to ssh into the server and issue halt command.

spawn ssh "user@server"
expect {
"password:" { send "yourpassword\n" }
"Are you sure you want to continue connecting (yes/no)?"
{ send "yes\n"
expect "password:"
send "password\n"
}
}
expect "sh-2.04"
send "su - \n"
expect "Password:"
send "yourpassword \n"
expect "sh-2.04"
send "shutdown -h now"
exit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top