The ARMOR project delivers seven roles.  Since IPS does not have the ability
to deliver and populate the home directories in /export/home (ZFS datasets)
for these roles, I'm using the usual mechanism of defining a transient service
to perform this part of the installation.

However, I'm uncertain how to remove the datasets if the package is removed.
I've observed that the stop method of the service will be invoked whenever the
service is disabled, which also occurs when the package is removed.  In this
latter circumstance however, the service method script has already been removed.

This leads me to consider the following means of having a script run at
pkg uninstall.  I'd have the start method script copy itself to a project
location, and have the stop method of the service use this copy.  If the
copy finds the start method script present, it can assume the package
remains installs and simply returns successfully.  When the copy discovers
the start method script is missing, it can assume the package has been
uninstalled, proceed to remove the role home directory datasets, and finish
by removing itself.

Is this a reasonable approach?
Is there a race between the removal of the package objects
and the service shutdown?
Is there some other approach I can/should use to accomplish
the running of a script after pkg uninstall?

                                Thanks    -JZ

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

Reply via email to