Brian Gupta wrote: > On 6/8/07, *Stephen Hahn* <sch at sun.com <mailto:sch at sun.com>> wrote: > > * Keyur Desai <Keyur.Desai at Sun.COM <mailto:Keyur.Desai at Sun.COM>> > [2007-06-08 09:14]: > > > > Need a recommendation. During pkgrm, some preremove scripts > > in Solaris disable the associated SMF service, and some > > just give a warning and fail pkgrm. Users must manually > > disable the associated SMF service (via "svcadm disable") and then > > proceed to remove the package. > > > > Is there any best practice around this ? > > It's my position that a manual package removal of an enabled service > should be classed as a mistake, and blocked. An evaluation whether > this position is an actual best practice is difficult, since it would > require knowing how many times an incorrect removal was stopped by the > restriction--and not just how many inconveniences it's raised. (In a > de-installer, or other higher level package manipulator, it's easy to > write code that leads to the convenient outcome, of course.) > > > How about a warning prompt? > > e.g.: Warning: XYZ service is currently enabled. Do you wish to disable > and continue with the removal? >
Packages included in the Solaris product are not allowed to have interactive scripts, so you'll not find this in any scripts that Sun delivers as part of our product. We don't generally recommend it to customers in their own packages, either, because they often end up wanting to use the packages they've built in their own Jumpstart environments and then find they have difficulties. As Stephen said, you're probably better off putting that sort of functionality in a layer above the package, where you can likely have a more intelligent conversation with the user and achieve a desirable outcome. Dave