plink shutdown

Login or Register to Reply

Thread Tools Search this Thread
# 1  
plink shutdown


I'm testing out this plink script - which will be executed to shutdown multiple LPARs.

This consists from:

plink -i /path/ssh/cert/ root@host shutdown -F
plink -i /path/ssh/cert/ root@host2 shutdown -F

The commands gets executed, however it stops on one host, and does not move on to the second host.

any ideas?
# 2  
Maybe the plink locks up if the remote end shuts down in mid session. Send it to the background?
plink -i /path/ssh/cert/ root@host shutdown -F & pids=$!
plink -i /path/ssh/cert/ root@host2 shutdown -F & pids="$pids $!"
sleep 300 # enough, too much ?
kill -9 $pids

# 3  
hmm, interesting

I will give it a try.

I've tried plink's -batch and -N however no success... but i will try this suggestion.

# 4  
rsh/ssh and probably plink are not nice if you want to spin something off, staying by their children despite most options, and in this case, the children evaporate!
# 6  
Wrapper the remote shutdown in a script to have it kill its parents (daemonize), something like this, so the plink ends immediately and the script runs on nohup background:
plink -i /path/ssh/cert/ root@host nohup ksh -c '"(kill -9 $PPID $$ ; sleep 5 ; shutdown -F )&"'

# 7  
Try running it with an "at" command like this:
plink -i /path/ssh/cert/ root@host "echo \"shutdown -F\" | at now"

This will run in the back ground and go through all your servers without waiting for each one to complete. You'll need to backslash the double-quotes inside the double-quotes so they get sent to the other box as regular double-quotes instead of being interrepted by your local shell.
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Need help on Plink
Hi All, Iam a newbie to the plink and need your assistance. I have referred some posts but it doesn't helps me much. I have two steps to do. 1. I have a config file which has a list of servers,username and password. 2. I have a shell script in windows which accepts arguments and need to...... Shell Programming and Scripting
Shell Programming and Scripting
PLINK help
Hi Plink users, I am very new in GWAS and decided to use PLINK for this. But I am struggling with file formats. I have one exome data with 200000 SNPs in it. But it is in .txt format. But all the necessary fields are there in different columns. Can you please suggest me how I can create the...... Shell Programming and Scripting
Shell Programming and Scripting
Script to force Oracle database shutdown when shutdown immediate does not work
I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and...... UNIX for Dummies Questions & Answers
UNIX for Dummies Questions & Answers
Error with Plink
Hello. I have a TCL script that logs in to a server using SSH. As SSH isn't available in windows,I used Plink to do the job.The script works fine on my PC and 2 of my friend's PC. However, on one PC, I get the following error message: "'D:\scripts\plink.exe' is not a Win32 Console...... Shell Programming and Scripting
Shell Programming and Scripting
How we can use plink?
Hi, How we can use use plink to access unix system using Dos. Could someone send me the commands that can be use in Batch file to call unix system using plink utility. Thanks in advance... Shell Programming and Scripting
Shell Programming and Scripting