On Mon, Mar 3, 2008 at 4:31 PM, Jordan Brown (Sun)
<opensolaris at jordan.maileater.net> wrote:
> One of the things that we need to do is to automatically apply patches
>  during system startup.
>
>  The patches are documented as requiring that they be installed in single
>  user mode.
>
>  Currently, we install them at /etc/rcS.d/S90.

>From init(1M):

     1        Put the system in system  administrator  mode.  All
              local file systems are mounted. Only a small set of
              essential kernel processes are left  running.  This
              mode is for administrative tasks such as installing
              optional utility packages. All files are accessible
              and no users are logged in on the system.

              This request corresponds to a request for smf(5) to
              restrict      the      system      milestone     to
              svc:/milestone/single-user:default.

According to svc.startd(1M):

  LEGACY SERVICES
     svc.startd continues to provide support for services invoked
     during  the  startup  run level transitions. Each /etc/rc?.d
     directory is processed after all managed services which con-
     stitute the equivalent run level milestone have transitioned
     to the online state.  Standard init scripts  placed  in  the
     /etc/rc?.d  directories  are  run  in  the  order  of  their
     sequence numbers.

     The milestone to run-level mapping is:

     milestone/single-user

         Single-user (S)

Based upon the fact that your rcS.d script is rebooting prior to
getting a console login prompt, I would guess that init(1M) is
correct.  I betchya that you could move your start script to
/etc/rc1.d and you would get console-login to start before your
script, yet it would still run your start script when you boot -m
single-user:default.

That being said, adding a service that inserts itself between
svc:/system/console-login:default and
svc:/milestone/single-user:default would probably be the most reliable
mechanism.

>  Occasionally we find that there's a problem with this process - either a
>  patch is bad or for some other reasons the process fails or hangs.  (In
>  a recent case, the mechanism that rebooted the system after installing a
>  patch that needed a reboot wasn't getting cleared, leading to a reboot
>  loop.)  Putting this processing before "real" interactive single-user
>  mode means that you can't get to single-user mode to fix the problem.

A "sleep 60" before the reboot would probably help you out of the
reboot loop.  This would probably annoy people like me that complain
about multiple reboots being required to install patches.
Alternatively, "boot -m milestone=none" is your friend to recover from
the reboot loop induced by rcS.d scripts.

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

Reply via email to