Hello Danek,

Tuesday, August 26, 2008, 7:25:27 PM, you wrote:

DD> 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?

DD> The problem, as has been reiterated many times here, is execution context.
DD> When you write a postinstall script, it's executed in the context of the
DD> package install.  That means that you have be careful that your code works

DD>   - on alternate roots

DD>   - from a miniroot, where not all utilities are available

DD>   - on a hardware architecture different from that of the package you're
DD>     installing

DD>   - in a diskless installation, where the root and usr filesystems aren't
DD>     mounted in the normal configuration

DD>   - installing into a zone

DD> And once you've gotten all those right, we come along and add a new
DD> installation context that means all previously written scripts break all
DD> over again.

DD> Historically, install scripts are almost never written correctly, and prove
DD> over and over again to be dangerous.

DD> And they prevent innovation.

DD> The solution is to run scripts in a single context -- that of a fully
DD> booted image.  That way, you can run things you just installed, and you can
DD> be guaranteed that everything is where it expects to be.  It's far, far
DD> simpler, even if you do have to whip up a quick SMF manifest to do what you
DD> need to do.  That part really isn't all that hard.


Thank you - does make a sense.

I guess it would be beneficial to create as many defaul actions
withing pkg so in most cases developer would not need any scripts at
all.

-- 
Best regards,
 Robert Milkowski                            mailto:[EMAIL PROTECTED]
                                       http://milek.blogspot.com

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

Reply via email to