On Tue, Aug 26, 2008 at 07:13:12PM +0100, Robert Milkowski wrote:
> pkg won't allow pre/post install scripts directly but it allows to
> restart given smf service which actually allows to execute arbitrary
> script, right?
>
> It's just "harder" to do so, but what exactly is accomplished by it?
> is it about encouraging developers to try not to use pre/post install
> scripts?
The problem, as has been reiterated many times here, is execution context.
When you write a postinstall script, it's executed in the context of the
package install. That means that you have be careful that your code works
- on alternate roots
- from a miniroot, where not all utilities are available
- on a hardware architecture different from that of the package you're
installing
- in a diskless installation, where the root and usr filesystems aren't
mounted in the normal configuration
- installing into a zone
And once you've gotten all those right, we come along and add a new
installation context that means all previously written scripts break all
over again.
Historically, install scripts are almost never written correctly, and prove
over and over again to be dangerous.
And they prevent innovation.
The solution is to run scripts in a single context -- that of a fully
booted image. That way, you can run things you just installed, and you can
be guaranteed that everything is where it expects to be. It's far, far
simpler, even if you do have to whip up a quick SMF manifest to do what you
need to do. That part really isn't all that hard.
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss