Thanks, Bart, your reply makes me realize that my testing was insufficient in that my preexisting directory hadn't been created by IPS and so was unavailable to the reference counter. Apologies for the scream.

So is the best practice to (1) create the dirs from the first package to need them, as opposed to in a parent package, and (2) not do the SVR4 thing of 'declaring' all parent dirs of your new dir?

rgds,  --emk

Bart Smaalders wrote:
Ed McKnight wrote:
  
I have several optional components which install into 
/var/optional-components (names changed to protect the innocent.) My 
user may install zero or one or several.

In SVR4 packages we've been trained to "deliver" all directories in 
trees that we will be installing files into, e.g.
...
# SMF manifests
d none var 0755 root sys
d none var/svc 0755 root sys
d none var/svc/manifest 0755 root sys
d none var/svc/manifest/system 0755 root sys
d none var/svc/manifest/system/cMyDomain 0755 root sys
f manifest var/svc/manifest/system/MyDomain/rpc_Foo.xml 0444 root sys
...

pkgrm does not remove any of these directories if they still contain 
anything.

My experiments with
    # pkg version
    216d2efd0c27
from OpenSolaris 2008.11-RC1, show that if I have a preexisting 
directory, for example, /var/optional-components, with preexisting 
contents, then I install a package made from this manifest:

    dir mode=0755 owner=root group=sys path=var/optional-components
    file ... path=var/optional-components/ComponentOne

that my delivered files appear nicely in the directory. When I then 
remove this package, all of /var/optional-components vanishes. I located 
the preexisting contents in /var/pkg/lost+found/var/optional-components.

OK, so I've just confirmed behavior which might even be documented 
somewhere besides the email archives.

SVR4 practice says deliver your entire tree; I expected at least that I 
have to deliver the directory in each optional component's manifest 
because each one might be the first to be installed. What's the Correct 
Practice here? Am I supposed to deliver the directory only in one 
package that would be guaranteed to be installed prior to any optional 
component and also be removed last?

Note that newbies porting their prototype files to manifest.ips might be 
at risk of some serious surprises, like delivering var then having 
uninstall try to pull /var into /var/pkg. Could be the End Of The Universe.

    

Directories are reference-counted, and are removed when no packages 
refer to them any longer.  IPS is currently _NOT_ designed to install
into directories created by other means.

If you're installing optional software into /var/optional-components
using IPS, that directory will be created when needed or explicitly
declared.  When the last package referencing that directory is
uninstalled, that directory will be deleted (actually the contents
moved into /var/pkg/...).  This is done so that packages can change
directories into symbolic links, etc w/o needing special scripting
or upgrade magic.

For now, don't mix and match, or if you must, put the directories you
want to install under in a separate package, and don't uninstall that.

- Bart



  
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to