On Wed, Jul 2, 2008 at 9:19 PM, Jordan Brown <Jordan.Brown at sun.com> wrote:
> Mike Gerdts wrote:
>>
>> Sometimes a runonce service needs to trigger a reboot.  It looks to me
>> as though all runonce services will be running at the same time -
>> making such a thing somewhat risky.  Is this something that you are
>> intending to support?
>
> First, note that this is something I just threw together this afternoon...
> it hasn't been deeply designed.
>
> If a particular run-once had additional dependencies, presumably they could
> be specified for its instance.  Whether that'd let it reboot safely...
> maybe.  You'd really like to single-thread something that wants to reboot
> the system, so that nothing else is in the middle of doing its work.

Perhaps a special exit code for "reboot required" would cause run-once
to trigger a dependent service to initiate a reboot after all the
run-once services had completed.

>>> sh -c "$RUN"
>>
>> One of the things that I commonly need to run on first boot is an ELF
>> executable.  Is there a reason to force a Bourne shell wrapper?  As
>> currently implemented it could cause confusion for software targeting
>> OpenSolaris and Solaris because /bin/sh in OpenSolaris 2008.05 is
>> really ksh93.  This would mean that a Korn shell script tested on
>> OpenSolaris will work just fine but will fail on Solaris 10.
>
> I think you missed the "-c".  That means "Hey, shell, here is a command
> line.  Process it.".  What it means is that the command that you specify
> must be acceptable to the Bourne shell.  That command might well be the name
> of an ELF executable, or a perl script, or... whatever.

Yep - I missed the -c.  Looks good.  If the run-once service leaves
something running in the background the "svcadm disable" may kill off
that thing.  Is ctrun needed in the mix?

> You could set $RUN to any of
>
>        /opt/myapp/myprog
>        /bin/rm -rf /
>        echo hello
>        echo hello > /etc/passwd
>        echo $PATH
>
> and they would all do sensible and obvious things.

So long as shooting oneself in the foot is sensible, I agree.  :)

-- 
Mike Gerdts
http://mgerdts.blogspot.com/

Reply via email to