users@glassfish.java.net

Re: Setting up updatecenter package for clean removal?

From: Joe Di Pol <joe.dipol_at_oracle.com>
Date: Wed, 10 Aug 2011 12:23:49 -0700

On 08/10/11 11:58 AM, Laird Nelson wrote:
> On Wed, Aug 10, 2011 at 2:54 PM, Snjezana Sevo-Zenzerovic
> <snjezana.sevozenzerovic_at_oracle.com <mailto:snjezana.sevozenzerovic_at_oracle.com>> wrote:
>
> FWIW, the difference between "dirs" and "dirtrees" sections are that "dirs" includes
> only specified directories (without any content) into IPS package and "dirtrees" will
> also include directory content...
>
>
> And just to be clear, if the "dir" in question is really a directory path, then it is
> assumed that the package owns the whole path, from the root to the tail, yes? That
> seems...odd.

Laird

This is a quirk of the pkg(1)/IPS packaging system. Basically if a
directory (and any files in that directory) are not referenced by an
installed package, then that directory is removed (actually moved to
a lost and found directory in $INSTALL_HOME/.org.opensolaris,pkg) when
the last package that has references to files in that directory
is uninstalled.

Since your package is the only package that contains files in "domain1"
that directory is deleted when your package is removed. Yes, this
behavior is non-obvious (some would call abusive) and has been debated on
pkg(1) mailing lists. I'm skeptical that the "preserve" flag that Snjezana
is looking into will help (although I could be wrong). But baking "domain1"
into a package is fragile anyway, since a user may choose to name their
domain something else.

The bottom line here is: don't create a package that installs files
directly into a GlassFish domain. Instead, install the files elsewhere
and require some step that deploys (or whatever) the software into
the domain.

Joe