Operating System - Linux
1753738 Members
4488 Online
108799 Solutions
New Discussion юеВ

swinstall is stuck because client gets hang

 
SOLVED
Go to solution
Dewa Negara_4
Regular Advisor

swinstall is stuck because client gets hang

Hi All,

Please help. I have a script called sched.sh. This script is for distributing a product to around 200 clients using swinstall command from depot server.

I have an issue when one of the clients get hang, so swinstall will be stuck on that server and can not proceed to the next server. This is causing the script sched.sh will fail.

Is there any way to make the script more intelligent if a client get hang, so the swinstall will skip that client and proceed to the next server?

[root@DEPOT:]
# more secu005_create_acf.sh
.
swinstall -x job_title=${host}_secu_refresh -Q $day,$time -S $swoptionsfile -s$depot $product @ $host 2>&1


Santos
5 REPLIES 5
IT_2007
Honored Contributor

Re: swinstall is stuck because client gets hang

Dewa Negara_4
Regular Advisor

Re: swinstall is stuck because client gets hang

Thanks. But when the client gets hang, swinstall won't give any value for $?.
Santos
IT_2007
Honored Contributor

Re: swinstall is stuck because client gets hang

no it won't. You have to write a script that checks if the client is pingable and running swagentd then run swinstall command.
spex
Honored Contributor
Solution

Re: swinstall is stuck because client gets hang

Hi,

This (untested) script will launch 10 instances of swinstall in the bg, sleep for 10 seconds, and launch 10 more until ${hostlist} is exhausted:

#!/usr/bin/sh
typeset -i batchsize=10
typeset -i zzz=10
#set other vars here
typeset -i i=0
for host in $(cat hostlist)
do
swinstall -x job_title=${host}_secu_refresh -Q ${day},${time} -S ${swoptionsfile} -s${depot} ${product} @ ${host} 2>&1 &
i=$((i + 1))
if [[ ${i} -eq ${batchsize} ]]
then
sleep ${zzz}
i=1
fi
done
exit

PCS
Dewa Negara_4
Regular Advisor

Re: swinstall is stuck because client gets hang

Thanks PCS,

It looks to me that this is a great idea. Hope the script can skip the hang client and proceed with the next. I will test this script. Any other ideas are welcome. Thanks.
Santos