cancel
Showing results for 
Search instead for 
Did you mean: 

Shell Script Queries..

 
SOLVED
Go to solution
Highlighted
Frequent Advisor

Shell Script Queries..

Hi
I have written script to install pkgs on multiple machines
#./install vin win min
Here this install script is doing remote installation of pkgs on vin , win & min these machine but one after another only. It is not starting same swinstall command on all machines at a time remotely.
===============================

CODE I have written ::
#!/bin/sh

if [ $# -eq 0 ];then
echo "Atleast one arg as m/c is needed"
fi
# pkg1 pkg2 pkg3 are the packages are going to install..

for i in $*
do
remsh $i -l root "/usr/sbin/swinstall -x autoreboot=true -s pkg1 pkg2 pkg2
done



"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
9 REPLIES 9
Highlighted
Acclaimed Contributor
Solution

Re: Shell Script Queries..

From the remsh man page:

"...remsh normally terminates when the remote command does...".

1) send it to background

2) (better) don't use remsh, but swinstall only (with source and target).

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Highlighted
Acclaimed Contributor

Re: Shell Script Queries..

>on all machines at a time remotely.

Did you mean "at the same time"?
You also may want to use -n so it doesn't eat stdin.

>Torsten: 2) but swinstall only (with source and target).

Don't you need an extra product? HP OpenView Software Distributor
Highlighted
Acclaimed Contributor

Re: Shell Script Queries..

From the swinstall man page examples section:

Install the C and Pascal products to a set of remote hosts:

swinstall -s sw_server cc pascal @ hostA hostB hostC

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Highlighted
Frequent Advisor

Re: Shell Script Queries..


With your cmd from manpage I got below error & pkgs not got installed

======= 05/27/09 17:49:28 IST BEGIN swinstall SESSION
(non-interactive) (jobid=hpslia27-0013)

* Session started for user "root@hpslia27".

* Beginning Selection
ERROR: "vvria05.vxindia.veritas.com:/": You do not have the required
permissions to select this target. Check permissions using
the "swacl" command or see your system administrator for
assistance. Or, to manage applications designed and packaged
for nonprivileged mode, see the "run_as_superuser" option in
the "sd" man page.
* Target connection failed for "vvria05.vxindia.veritas.com:/".
ERROR: More information may be found in the daemon logfile on this
target (default location is
vvria05.vxindia.veritas.com:/var/adm/sw/swagentd.log).
* Selection had errors.



======= 05/27/09 17:49:29 IST END swinstall SESSION (non-interactive)
(jobid=hpslia27-0013)

"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
Highlighted
Honored Contributor

Re: Shell Script Queries..

go to the problem node and restart swagentd, with command

swagentd -r

these swacl errors, unless you are really using the swACL's, generally are misrtepresentation of something that went wrong with the swagentd process and a restart most of the time fixes the issue.

HTH

PS. make sure your client machine has a trust to the depot server.
________________________________
UNIX because I majored in cryptology...
Highlighted
Regular Advisor

Re: Shell Script Queries..

Watch out, there wont be any tty after the script exits, pushing the swinstall job to background, on each node. Use nohup.



Highlighted
Honored Contributor

Re: Shell Script Queries..

Hi,

this issue is related to swacl. To use swinstall remotely you must do the following:

Install the AgentConfig.SD-CONFIG fileset to enable remote operations:

root@client # swinstall -s hpignite:/var/opt/mx/depot AgentConfig.SD-CONFIG

after that check the remote permissions with swacl on the target node:

root@client # swacl -l global_product_template

On the bottom of the output you'll see that the depot server has now full access to install software onto this node.

This is an automated process, all of the above can be made manually with swacl command. Let me know if you made it...

After that, you are finally enabled to swinstall from remote server:

root@ignite # swinstall -x patch_match_target=true -x autoreboot=true -s sw1 sw2 sw3 @ node1 node2 node3
****
Unix operates with beer.
Highlighted
Honored Contributor

Re: Shell Script Queries..

> PS. make sure your client machine has a trust to the depot server.

As Mel wrote it too, it could be a problem with swacl permissions. (Or you must just simply restart the swagentd)

Here is the way you can manually change the swacl permissions:

Allow access to hostA:

hostA # swacl -l hostA -M user:root@hpignite:a

hostA # swacl -l global_product_template -M user:root@hpignite:a
****
Unix operates with beer.
Highlighted
Frequent Advisor

Re: Shell Script Queries..

I got the solutions
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "