Operating System - HP-UX
1752805 Members
5571 Online
108789 Solutions
New Discussion юеВ

swremove <package name> does not remove Directory structure

 
AllianceOneDevS
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
Steven E. Protter
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
AllianceOneDevS
Occasional Advisor

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

bug reported #13389

Directories with no files inside.

-r :(Option) to be useed?


Dennis Handly
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.
AllianceOneDevS
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

Binu George
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.
AllianceOneDevS
Occasional Advisor

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

What is the difference between "postremove control script" & "postinstall script"?
Binu George
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.
AllianceOneDevS
Occasional Advisor

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

Thanks lot for all your replies.

Regards
Sharan
Dennis Handly
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