Danek Duvall wrote:
>> Presently we (the creator) remove files and directories in pre- or
>> post-install, so this is exactly the topic: how do we get to remove them
>> under IPS (i.e. post-remove)?
> 
> I'm curious about what kinds of files and directories you create in your
> install scripts.  Many instances I've seen of this could much more easily
> have been done by putting them in the package directly (see virtualbox).

I am not sure, but I think he's talking about removing files that were 
created by execution of his application, and stumbled on the words.

> One potential answer is for you to deliver empty preserve=true files to
> those locations and update the contents in the service.

Many of our files have generated names and the exact number of files is 
not known until execution time.

(An exclusive directory might well solve that problem.)

> Obviously, this doesn't apply to software you don't write, or have no
> influence over.

... and that's one of the problems, how to have your application 
integrate into legacy plug-in mechanisms.  As a trivial example, how can 
your package remove its cron entries?  (Preferably before cron tries to 
execute non-existent binaries, of course.)

It might be adequate to have a mechanism that would run an operation[*] 
before removal if on a running system, or after removal and early in 
startup if on a non-running root.

[*] Being deliberately vague as to whether the operation is represented 
as an SMF service, or something else.  "Run this script" is simpler than 
SMF, but SMF would let you declare dependencies that would force it to 
run at the right time in startup.

> Post-remove is straightforward, pre-remove is not.

Mostly.  Post-remove is a bit tricky in that some pieces need to survive 
removal to do the next-reboot cleanup, and then those pieces need to 
clean themselves up.  Infrastructure, or at least patterns, would be 
helpful there.

Unfortunately, preremove tends to be the more interesting stuff.

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

Reply via email to