Solaris 10 zones and startup scripts - SUN

This is a discussion on Solaris 10 zones and startup scripts - SUN ; Setup a non-global zone on Solaris 10. Boots up ok. It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts. I thought Solaris 10 still ran these? Also I can't get sshd to start on the non-global zone. ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Solaris 10 zones and startup scripts

  1. Solaris 10 zones and startup scripts

    Setup a non-global zone on Solaris 10. Boots up ok.
    It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts.
    I thought Solaris 10 still ran these?

    Also I can't get sshd to start on the non-global zone.

    # svcs -a |grep ssh2
    offline 11:44:58 svc:/network/ssh:default
    # svcadm enable -t svc:/network/ssh:default
    # svcs -a |grep ssh2
    offline 11:44:58 svc:/network/ssh:default

    Anyone got any ideas?


  2. Re: Solaris 10 zones and startup scripts

    halfmanhalfpint@gmail.com wrote:
    > Setup a non-global zone on Solaris 10. Boots up ok.
    > It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts.
    > I thought Solaris 10 still ran these?


    I think it does but haven't checked in a non-global zone. I have used
    non-global zones for the JES LDAP server, and it started OK: I'm fairly
    sure it still uses init.d scripts, so some run anyway.

    > Also I can't get sshd to start on the non-global zone.
    >
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    > # svcadm enable -t svc:/network/ssh:default
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default


    Does it have a network interface? I suspect sshd won't start
    otherwise. What does svcs -x say?


  3. Re: Solaris 10 zones and startup scripts

    Tim Bradshaw wrote:
    >
    > Does it have a network interface? I suspect sshd won't start
    > otherwise. What does svcs -x say?


    This is crap, sorry: I just checked in a zone with no non-loopback
    interfaces and it runs.

    --tim


  4. Re: Solaris 10 zones and startup scripts

    halfmanhalfpint@gmail.com wrote:

    > Setup a non-global zone on Solaris 10. Boots up ok.
    > It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts.
    > I thought Solaris 10 still ran these?


    It does.

    > Also I can't get sshd to start on the non-global zone.
    >
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    > # svcadm enable -t svc:/network/ssh:default
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    >
    > Anyone got any ideas?


    Looks in the logs: sshd has hit some kind of error starting up. sshd
    works fine for me in non-global zones.

  5. Re: Solaris 10 zones and startup scripts

    It isn't running scripts in run level 2 or 3 because these services are
    offline in the non-global zone:

    offline 11:30:31 svc:/milestone/multi-user:default
    offline 11:30:31 svc:/milestone/multi-user-server:default

    Tried enabling them using "svcadm enable -t
    svc:/milestone/multi-user:default", but they are still offline.

    This his how I setup the non-global zone:

    # zonecfg -z myzone
    myzone: No such zone configured
    Use 'create' to begin configuring a new zone.
    zonecfg:myzone> create
    zonecfg:myzone> set autoboot=true
    zonecfg:myzone> set zonepath=/export/zones/myzone
    zonecfg:myzone> add net
    zonecfg:myzone:net> set address=10.10.10.13
    zonecfg:myzone:net> set physical=bge0
    zonecfg:myzone:net> end
    zonecfg:myzone> add attr
    zonecfg:myzone:attr> set name=comment
    zonecfg:myzone:attr> set type=string
    zonecfg:myzone:attr> set value="myzone"
    zonecfg:myzone:attr> end
    zonecfg:myzone> verify
    zonecfg:myzone> commit
    zonecfg:myzone> exit

    # zoneadm -z myzone install
    Preparing to install zone .
    Creating list of files to copy from the global zone.
    Copying <3196> files to the zone.
    Initializing zone product registry.
    Determining zone package initialization order.
    Preparing to initialize <1613> packages on the zone.
    Initialized <1613> packages on zone.
    Zone is initialized.
    Installation of these packages generated errors: SUNWapch2d>
    The file
    contains a log of the zone installation.

    # zoneadm -z myzone list -v
    ID NAME STATUS PATH
    - myzone installed /export/zones/myzone

    # zoneadm -z myzone boot




    On Dec 13, 12:10 pm, halfmanhalfp...@gmail.com wrote:
    > Setup a non-global zone on Solaris 10. Boots up ok.
    > It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts.
    > I thought Solaris 10 still ran these?
    >
    > Also I can't get sshd to start on the non-global zone.
    >
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    > # svcadm enable -t svc:/network/ssh:default
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    >
    > Anyone got any ideas?



  6. Re: Solaris 10 zones and startup scripts

    This is why none of the rc2.d or rc3.d scripts are being run:

    offline Dec_12 svc:/milestone/multi-user-server:default
    offline Dec_12 svc:/milestone/multi-user:default

    Tried to enable them with svcadm, didn't work. Anyone got any ideas?

    This is how I installed the non-global zone:

    # zonecfg -z myzone
    myzone: No such zone configured
    Use 'create' to begin configuring a new zone.
    zonecfg:myzone> create
    zonecfg:myzone> set autoboot=true
    zonecfg:myzone> set zonepath=/export/zones/myzone
    zonecfg:myzone> add net
    zonecfg:myzone:net> set address=10.1.1.13
    zonecfg:myzone:net> set physical=bge0
    zonecfg:myzone:net> end
    zonecfg:myzone> add attr
    zonecfg:myzone:attr> set name=comment
    zonecfg:myzone:attr> set type=string
    zonecfg:myzone:attr> set value="myzone zone"
    zonecfg:myzone:attr> end
    zonecfg:myzone> verify
    zonecfg:myzone> commit
    zonecfg:myzone> exit

    # zoneadm -z myzone install
    Preparing to install zone .
    Creating list of files to copy from the global zone.
    Copying <3196> files to the zone.
    Initializing zone product registry.
    Determining zone package initialization order.
    Preparing to initialize <1613> packages on the zone.
    Initialized <1613> packages on zone.
    Zone is initialized.
    Installation of these packages generated errors: SUNWapch2d>
    The file
    contains a log of the zone installation.

    # zoneadm -z myzone list -v
    ID NAME STATUS PATH
    - myzone installed /export/zones/myzone

    # zoneadm -z myzone boot

    halfmanhalfpint@gmail.com wrote:

    > Setup a non-global zone on Solaris 10. Boots up ok.
    > It doesn't seem to run any of the /etc/rc2.d or /etc/rc3.d scripts.
    > I thought Solaris 10 still ran these?
    >
    > Also I can't get sshd to start on the non-global zone.
    >
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    > # svcadm enable -t svc:/network/ssh:default
    > # svcs -a |grep ssh2
    > offline 11:44:58 svc:/network/ssh:default
    >
    > Anyone got any ideas?



  7. Re: Solaris 10 zones and startup scripts

    halfmanhalfpint@gmail.com wrote:

    > Anyone got any ideas?


    Heh, I made that mistake. After the zone is first booted you need to
    answer some sysidcfg questions (or provide a config file for it, which
    is documented somewhere). Once it's booted use zlogin -C to it and
    you'll find it will be sitting there asking you for things like host
    name etc.

    It's a misfeature, in my opinion, that zlogin lets you log in to a zone
    when it's in an essentially unbooted state. Even after the config
    stuff is done, you can have bad experiences by using zlogin too soon
    after booting the zone: you get a shell but half the stuff in the zone
    isn't running yet.

    --tim


  8. Re: Solaris 10 zones and startup scripts

    In article <1166025283.816070.108760@t46g2000cwa.googlegroups. com>,
    "Tim Bradshaw" wrote:

    > halfmanhalfpint@gmail.com wrote:
    >
    > > Anyone got any ideas?

    >
    > Heh, I made that mistake. After the zone is first booted you need to
    > answer some sysidcfg questions (or provide a config file for it, which
    > is documented somewhere). Once it's booted use zlogin -C to it and
    > you'll find it will be sitting there asking you for things like host
    > name etc.
    >
    > It's a misfeature, in my opinion, that zlogin lets you log in to a zone
    > when it's in an essentially unbooted state.


    I disagree. The "-C" option is intended to mimic a console providing
    console access to the zone similar to that of a real console.

    Josh

  9. Re: Solaris 10 zones and startup scripts

    On 2006-12-14 23:41:57 +0000, Josh McKee said:

    > I disagree. The "-C" option is intended to mimic a console providing
    > console access to the zone similar to that of a real console.


    It's not the -C option that annoys me (and thanks, I know what it
    does). The issue is that if you just zlogin (no -C) to a zone you can
    get a shell well before the system has finished booting. So something
    like

    zoneadm -z myzone boot && zlogin myzone

    can result in you talking to myzone while it is in a fairly odd state.
    The classic example of this is to do that on a freshly minted zone,
    where it will typically be in a half-booted state (waiting for sysid on
    the console) *and remain there*. This was the OP's problem in this
    thread I think. I'd rather that zlogin by default did not let you get
    a shell until the zone had reached the appropriate runlevel /
    milestone. zlogin -C should obviously always connect you to the
    console (even if the zone is not booted at all, as currently), and it
    would be fine if plain zlogin had an `I don't care, just give me a
    shell' option: I'd just rather that wasn't the default.

    The feature as it stands leads to all sorts of possible issues: something like

    zoneadm -z myzone boot && zlogin myzone /opt/myhugepackage/sbin/start

    could result in mysterious failures as myhugepackage races with the
    machine being far enough up for it to run. (Yes, I know that's a bad
    way to start apps, but people do that sort of thing.)

    --tim


  10. Re: Solaris 10 zones and startup scripts

    I've just been bitten by this and it occurs to me to wonder why one has to re-specify during the config process a load of stuff that I've already specified during zone creation (IP address, root password). It seems to make it rather hard to create a number of zones in an automated fashion.

    Or am I missing something?

+ Reply to Thread