Operating System - HP-UX
1832864 Members
2874 Online
110048 Solutions
New Discussion

Re: Change the target from command line

 
Nagendar
Advisor

Change the target from command line

Hello,

I am facing a problem with chainging the target while installing using "swinstall". It works with the GUI in Actions->Change Target.
Also, through GUI the SW_ROOT_DIRECTORY environment variable gives the changed target. This could be used in postinstall scripts or so.

I want to perform same thing through command line. I tried -r and other options. Facing problems.

Please help.
Note: I am on HP-UX 11.00.
12 REPLIES 12
Robert-Jan Goossens
Honored Contributor

Re: Change the target from command line

Hi,

How about

# swinstall -s /target_dir/target.depot

Hope it helps,

Robert-Jan.
Nagendar
Advisor

Re: Change the target from command line

Hi Robert,

No.. that is for source selection. Not the target. Thanks anyway.

Expecting a working solution eagerly.

Regards,
Nagendar
Marco Santerre
Honored Contributor

Re: Change the target from command line

I'm not sure I understand fully what you're trying to do here but I would try using the @ at the end of you rcommand line to specify the target selection. And in your target selection you can even specify a host if you want.
Cooperation is doing with a smile what you have to do anyhow.
Vincent Stedema
Esteemed Contributor

Re: Change the target from command line

Hi,

Could you pls post an example of the command you're trying to execute? Especially when you specify the -r option.

Regards,

Vincent
Nagendar
Advisor

Re: Change the target from command line

Hi,

When I tried to use @ at the end of the command to specify target(Hers is the command: swinstall -x match_target=true -s /var/spool/sw/ @ /home/isswork/nags),

I get the following error.


======= 12/17/02 17:10:22 MST BEGIN swinstall SESSION
(non-interactive)

* Session started for user "root@lothar".

* Beginning Selection
* "lothar:/home/isswork/nags": This target does not exist and
will be created.
* Source connection succeeded for "lothar:/var/spool/sw/".
ERROR: Could not access remote file "GLOBAL_INDEX" in software item
"". The file could not be found on the remote system.
ERROR: There is currently no installed software on host "lothar" at
location "/home/isswork/nags". (Note that you need to use
"swcopy" to manage depot software).
* Source selection failed for "lothar:/home/isswork/nags".
ERROR: Error code -1 returned from procedure IC_TargetSoftwareGet().
NOTE: Cannot continue the "swinstall" task.


Nagendar
Advisor

Re: Change the target from command line

Hi Vincent,

Here is what I tried with -r option and the error I get.

I wish this helps you to point out the error.

Thanks,
Nagendar
--------------------------------------------
# swinstall -x match_target=true -s /var/spool/sw/ -r /home/isswork/nags

======= 12/17/02 17:13:56 MST BEGIN swinstall SESSION
(non-interactive)

* Session started for user "root@lothar".

* Beginning Selection
* "lothar:/export/shared_roots/OS_700": This target does not
exist and will be created.
* Source connection succeeded for "lothar:/var/spool/sw/".
ERROR: Could not apply the software selection "/home/isswork/nags";
it is not available from depot or root
"lothar:/var/spool/sw/".
* Software selection failed for "lothar:/var/spool/sw/".
ERROR: Could not access remote file "GLOBAL_INDEX" in software item
"". The file could not be found on the remote system.
ERROR: There is currently no installed software on host "lothar" at
location "/export/shared_roots/OS_700". (Note that you need
to use "swcopy" to manage depot software).
* Source selection failed for
"lothar:/export/shared_roots/OS_700".
ERROR: Error code -1 returned from procedure IC_TargetSoftwareGet().
ERROR: No software has been selected.
NOTE: Cannot continue the "swinstall" task.

Mateja Bezjak
Respected Contributor

Re: Change the target from command line

Hi,

If you leave out -x match_target, the swinstall will work.

Regards,
Mateja
Vincent Stedema
Esteemed Contributor

Re: Change the target from command line

Hi,

I'm not sure if this will work, but I think it's the correct syntax:

#swinstall -s /var/spool/sw -r @ /home/isswork/nags


HTH

Regards,

Vincent
Nagendar
Advisor

Re: Change the target from command line

Hi Mateja,

No that option (match_target) is to dosallow the GUI.

Let me simply my question.

I want to change the target while installation through swinstall.

Any help is highly appreciated.

With Best Regards,
Nagendar
Mateja Bezjak
Respected Contributor

Re: Change the target from command line

Hi,

The command you are trying to use work for the remote targets, but you are trying to run swinstall on alternate root. You should:

1. swinstall -x match_target @ target_name (for remote targets)
2. swinstall @ /home/isswork/nags (for alternate root)

Note that you don't have to specify "-s /var/spool/sw" since SD uses this source by default (unless otherwise specified in /var/adm/sw/defaults)

I hope this helps. Regards,
Mateja
Nagendar
Advisor

Re: Change the target from command line

Hi Mateja,

Thanks alot! That cleared all the doubts.
I am facing one more problem.

If I try to execute my request script,

I get following error:

# swinstall -x ask=true IFS @ /home/isswork/nags

======= 12/18/02 11:18:49 MST BEGIN swinstall SESSION
(non-interactive)

* Session started for user "root@lothar".

* Beginning Selection
* "lothar:/home/isswork/nags": This target does not exist and
will be created.
* Source connection succeeded for "lothar:/var/spool/sw".
* Software bin has a "request" script. It will be executed and
corresponding "response" file will be generated.

Inside request script ... ... ...
Please enter the name
test
test
* Ask task succeeded.

* Source: /var/spool/sw
* Targets: lothar:/home/isswork/nags
* Software selections:
IFS.bin
IFS.library
* Selection succeeded.


* Beginning Analysis
* Session selections have been saved in the file
"/var/adm/sw/sessions/swinstall.last".
ERROR: Could not access remote file "GLOBAL_INDEX" in software item
"". The file could not be found on the remote system.
ERROR: There is currently no installed software on host "lothar" at
location "/home/isswork/nags". (Note that you need to use
"swcopy" to manage depot software).
* Analysis had errors.


NOTE: More information may be found in the agent logfile (location
is lothar:/home/isswork/nags/var/adm/sw/swagent.log).

======= 12/18/02 11:18:57 MST END swinstall SESSION (non-interactive)




===============================================

The script is a simple shell script, it just reads a variable. Any pointers?

Mateja Bezjak
Respected Contributor

Re: Change the target from command line

Hi,

This operation fails, because swinstall is looking for the INDEX file in /home/isswork/nags/var/adm/sw/products/INDEX. But INDEX doesn't exist. You could run the same command without "-x ask=true" first to install the product (this will create an INDEX file at the above mentioned location) and then rerun swinstall:
swinstall -x reinstall=true -x ask=true IFS @ /home/isswork/nags

Regards,
Mateja