Operating System - HP-UX
1832182 Members
2924 Online
110038 Solutions
New Discussion

Problem with request script in swask OR swinstall

 
SOLVED
Go to solution
Nagendar
Advisor

Problem with request script in swask OR swinstall

Hi,

To start with, I have a simple request script, which reads a variabe from user. Just to add, my depot is in defaulr dir i.e, /var/spool/sw.

I am getting the following error.


# rw-rw-rw- 106/20 339 Nov 27 19:15 2002 icons/world2.png
bash: rw-rw-rw-: command not found
# swask -s /var/spool/sw \*

======= 12/18/02 14:38:24 MST BEGIN swask SESSION (non-interactive)

* Session started for user "root@lothar".

* Beginning Selection
* Target connection succeeded for "lothar:/".
* 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
* Ask task succeeded.

ERROR: File "/var/tmp/BAAa24520/catalog/IFS/bin/response": No such
file or directory (2). Cannot copy it to file
"/var/spool/sw/catalog/IFS/bin/response".

======= 12/18/02 14:38:27 MST END swask SESSION (non-interactive)


Please help!

With best regards,
Nagendar
14 REPLIES 14
T G Manikandan
Honored Contributor

Re: Problem with request script in swask OR swinstall

check this


#swask -s
-x ask=as_needed \*

as the command can create a response file for you.


Thanks
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi Mani,

The default ask option for swask is true. So, the suggested change will not have any effect. Though I tried it, same error is encountered.

Any other suggetions? Something silly happening I guess.

Any help is highly appreciated, as I am really clueless.

Thanks,
Nagendar
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi friends,

Do anyone have any idea what could be wrong, the way I am using swask? Expecting suggetions.

Thanks,
Nagendar
Vincent Stedema
Esteemed Contributor

Re: Problem with request script in swask OR swinstall

Hi,

Try adding the logdetail=true and loglevel=2 options to the command. Maybe this will provide more info on why it's not working.

Regards,

Vincent
Mateja Bezjak
Respected Contributor
Solution

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

swask probably doesn't succeed because the response file wasn't created. Could you please post the request file.
Here is an example of a simple request script that just asks your name and creates the response file:

echo "Please enter your name:"
read name
echo $name > ${SW_CONTROL_DIRECTORY}response

Regards,
Mateja
Mateja Bezjak
Respected Contributor

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

Here is a link to the Software Distributor's Administartion Guide. I think this might help you with the control scripts:
http://docs.hp.com/hpux/onlinedocs/B2355-90754/B2355-90754.html

Have a look at chapter "Using Control Scripts"

Regards,
Mateja
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi Mateja,

Thanks a lot. It really solved my problem.
Actually, I was thinking that response file gets generated by SW. But, I realized we need to write to it explicitly. That solves the problem!

Just a additional query I have:
When I run the same script through swinstall by ask option,

I get this error:

Please enter the name
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.
-----------------------------------------------


Any idea? But, it's not hard and fast. I can manage through swask too. But, just to know whats wrong.

Thnaks,
Nagendar
Mateja Bezjak
Respected Contributor

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

I am glad your problem is solved.
As for the "GLOBAL_INDEX" error. You get it because you are installing to an alternate root. swinstall is looking for the INDEX file in /home/isswork/nags/var/adm/sw/products/INDEX. But INDEX there 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

I hope this helps. Regards,
Mateja
Mateja Bezjak
Respected Contributor

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

This is weird, because I have no problem reinstalling the product. swinstall asks for response. Have you included "-x ask=true" in the command line?
btw, I am using the sample request script I posted earlier.

Mateja
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi Mateja,

The reason you gave seems to be correct. But, when I reinstall it, the swinstall does not wait for the user response. It just carries on ...

Any pointers?

Thanks,
Nagendar
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi Mateja,

I am sorry!
That was not the case. Some mistake from my side. Sorru for the confusion again.

Now, the last doubt from the finishing.

As I said, I am chaninging the target while SWINSTALL. Everything is fine. Except that it shows a warning in the postinstall.

Here is the log in /home/isswork/nags/var/adm/sw/swagent.log :

* Installing fileset "IFS.library,r=" (2 of 2).
* Running install clean command /usr/lbin/sw/install_clean.
WARNING: Transition links are not created for the filesets installed
at the target. After booting up from the system using
the alternate root at the target, run tlinstall command to
create transition links.
WARNING: The command "/usr/lbin/sw/install_clean" had warnings. The
installation will continue. Check the above output for
details about the warnings.
* Building the software file
"/home/isswork/nags/var/adm/sw/needs_config" to be used for
post-reboot "swconfig" execution. The information in this
file will be used as input to "swconfig" after the system
reboots.

----------------------------------------------

Also, here is my postinstall script. It's pretty simple:
#!/bin/sh
echo "Inside postinstall script!!!!!"
echo "Root dir is: $SW_ROOT_DIRECTORY"
cd $SW_ROOT_DIRECTORY/ifs/bin
ls>output
pwd>>output
echo "======">>output
env>>output

ifsctl_file=$SW_ROOT_DIRECTORY/ifs/bin/ifsctl
IFS_DIR=$SW_ROOT_DIRECTORY/ifs
echo $ifsctl_file
sed -e "s,@IFS@,$IFS_DIR,g" < $ifsctl_file > /tmp/ifsctl_file_mod
cat /tmp/ifsctl_file_mod > $ifsctl_file
rm /tmp/ifsctl_file_mod
exit
----------------------------------------------

I should be happy after getting this answere.

With best regards,
Nagendar
Mateja Bezjak
Respected Contributor

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

The problem is not the postinstall script. If you check /usr/lbin/sw/install_clean script you will see:

if [[ "$SW_ROOT_DIRECTORY" != "/" ]]
then

# exit if the alternate root path is neither /export/shared_roots
# nor /export/private_roots.

test_alt=${SW_ROOT_DIRECTORY#$SHARED_ROOT}

if [[ ${test_alt} = ${SW_ROOT_DIRECTORY} ]]
then
# SW_ROOT_DIRECTORY is not a NFSD shared root

test_alt=${SW_ROOT_DIRECTORY#$PRIVATE_ROOT}
if [[ ${test_alt} = ${SW_ROOT_DIRECTORY} ]]
then
# SW_ROOT_DIRECTORY is not a NFSD private root


echo "WARNING: Transition links are not created for the filesets installed"
echo " at the target. After booting up from the system using"
echo " the alternate root at the target, run tlinstall command to"
echo " create transition links."
exit $WARNING

fi
fi
fi

In your case the alternate root is /home/isswork/nags and therefore, you get the warning messages.
I hope this helps. Regards,
Mateja
Nagendar
Advisor

Re: Problem with request script in swask OR swinstall

Hi Mateja,

I don't know how important is this tlinstall. But, is there a way to avoid this warning? Or running tlinstall for the new target? Or any other suggetion?

Waiting for the reply.
regards,
Nagendar
Mateja Bezjak
Respected Contributor

Re: Problem with request script in swask OR swinstall

Hi Nagendar,

You can ignore this warning. It is just saying that transition links cannot be created because the symbolic links already exist. But if the symbolic links for the particular files already exist there is no need for creating the transition links. These kind of warning messages are common when installing to alternate roots.

regards,
Mateja