Operating System - HP-UX
1752567 Members
5190 Online
108788 Solutions
New Discussion юеВ

Re: silent install with swinstall

 
Bill Hassell
Honored Contributor

Re: silent install with swinstall

> it only remove some file ,not all file

This is part of the depot package. A well written package will remove all the necessary files -- but config files and custom files (typically in /var/opt or similar temp directories) are usually not part of the package.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: silent install with swinstall

>Anoop: Any directory you created will not automatically be removed. You'll have to remove it.

Right. This can be done in a postremove control script.
alert0919
Advisor

Re: silent install with swinstall

Right. This can be done in a postremove control script.

I write a script add to postremove

scripts content is
each "test"

but it can't work when I use swremove
does i have something to do that it can work
thanks
Dennis Handly
Acclaimed Contributor

Re: silent install with swinstall

>I write a script add to postremove. scripts content is: each "test"

How is that a valid script?

>but it can't work when I use swremove

Does your script get executed?
The script should look something like this:
#!/sbin/sh
# Lots of comments ... :-)
exitval=0 # Anticipate success : 1 = failure 2 = warning

UTILS="/usr/lbin/sw/control_utils"
if [ ! -f $UTILS ]; then
echo "ERROR: Can't find $UTILS"
exit 1
fi

. $UTILS

#================================================
rm -rf ${SW_ROOT_DIRECTORY}your-directory 2> /dev/null
exit $exitval
alert0919
Advisor

Re: silent install with swinstall

Do i write any control script in swremove
or just write postremove /fullpath/xxx.sh
in my psf file

if I excute swremove command ,the postremove can work autmatically,or it need write something in my psf file to trigger xxx.sh

thanks
Dennis Handly
Acclaimed Contributor

Re: silent install with swinstall

>Do I write any control script in swremove
or just write postremove /fullpath/xxx.sh
in my psf file

The latter. Check the documentation.
http://docs.hp.com/en/5992-5875/ch10s03.html

>if I execute swremove command, the postremove can work automatically, or it need write something in my psf file to trigger xxx.sh

You need to name the file postremove and package it in your PSF.
alert0919
Advisor

Re: silent install with swinstall

my rough psf like this

# vi my.psf
distribution
layout_version 1.0

#Vendor info:
vendor
tag My_Vendor
title My_Vendor_Title
end

#Product definition: --this is what shows up with swlist
product
tag MY_PRODUCT
title My_custom_product
revision 1.0 #(or whatever it is)
fileset
tag fileset1
title My fileset
directory /source_dir/dir1=/destination_dir

# Control scripts:
postremove /my_script

#list all of the files that you wish to put in the bundle.
file filename1
file filename2

#set file permissions if desired
file -m 644 -o root -g users filename1
file -m 644 -o root -g users filename2
end #end fileset definitions
end #end product definition

in control script
# vi /my_script
echo ├в running my_script for postinstall script├в

but it don't run this script

any place that i need to add in my psf file that my postremove script work

thanks




Dennis Handly
Acclaimed Contributor

Re: silent install with swinstall

>any place that I need to add in my psf file that my postremove script work

You seem to have it right. But instead of an echo, you should echo to a logfile so you can look at it.

Does "swlist -l fileset -v -s $PWD/depot" show you your postremove script?

Also see how to check postremove:
http://docs.hp.com/en/5992-5875/ch11.html
http://docs.hp.com/en/5992-5875/ch11s09.html#v2215809

>file -m 644

In general, these files should be read only, 444.
alert0919
Advisor

Re: silent install with swinstall

You need to add \* or the product to the end:
swinstall -s with-fullpath \*

what is the \* means

thanks
Anoop P_2
Regular Advisor

Re: silent install with swinstall

\* means all products available in the depot.

NB: Quite a few of us have responded to your queries, so you are requested to assign points to those that might have helped you or hinted of a solution as the case may be.