General
cancel
Showing results for 
Search instead for 
Did you mean: 

swremove <package name> does not remove Directory structure

 
Highlighted
Occasional Advisor

swremove <package name> does not remove Directory structure

Scripts inside our product's (.depot) packages have long been set up to erase all traces of our product upon package removal (swremove ). Unfortunately, it seems that directories do not disappear after the .depot has been uninstalled.

Also, what is the effect of running swremove as root & alternate root(sudo)
9 REPLIES 9
Highlighted
Exalted Contributor

Re: swremove <package name> does not remove Directory structure

Shalom,

If files unrelated to the application have been created in the structure, user sessions, or file handles are open, swremove could leave behind the directories.

swremove must be run as root.

If you grant sudo privileges to other users they are running swremove as root. You may need to grant other programs in the sudo configuration. Check logs after a test to see how that works out.


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Highlighted
Occasional Advisor

Re: swremove <package name> does not remove Directory structure

bug reported #13389

Directories with no files inside.

-r :(Option) to be useed?


Highlighted
Acclaimed Contributor

Re: swremove <package name> does not remove Directory structure

swremove doesn't remove directories, just the files. You will have to run a postremove control script to remove these directories.
Highlighted
Occasional Advisor

Re: swremove <package name> does not remove Directory structure

To uninstall our packages, we do the following:

swremove $pkgname

where $pkgname is merely the name of the package (vasclnt, vasgp, vasyp, vasproxy, etc.).

As an aside, note that to install or upgrade, we did this:

swinstall -s $hp_pkgpath $pkgname

Highlighted
Advisor

Re: swremove <package name> does not remove Directory structure

As mentioned by Dennis, swremove doesn't remove directories.
If you want product directories to be removed during swremove, you need to add a postinstall script that will take care of cleaning up the directories you own.
Highlighted
Occasional Advisor

Re: swremove <package name> does not remove Directory structure

What is the difference between "postremove control script" & "postinstall script"?
Highlighted
Advisor

Re: swremove <package name> does not remove Directory structure

During swinstall, the files packaged in the depot are placed on the system location specified. Once this is done, the postinstall control script is run. This script can be used to creating any symbolic links if needed.

During swremove, the files are removed from the system location. Once this is completed, the postremove control script is run. It can be used to clean up things after the product removal, like directories.
Highlighted
Occasional Advisor

Re: swremove <package name> does not remove Directory structure

Thanks lot for all your replies.

Regards
Sharan
Highlighted
Acclaimed Contributor

Re: swremove <package name> does not remove Directory structure

>What is the difference between postremove script & postinstall script?

I think Binu just made a typo. A postinstall script wouldn't make sense for swremove.
Otherwise his reply to this question is spot on.
http://docs.hp.com/en/B2355-90754/index.html
http://docs.hp.com/en/B2355-90754/ch11s01.html