thewatertower.org.uk

Opensolaris


To do list

Post build

Research

Root: hidden in the menus (system|preferences|main menu) I found under system rools a hidden 'root terminal' option. But it doesn't work. I read something about 'roles' restricting access to root. Might be useful to understand whats going on here.

What's bootadm?


Tips

The Open Solaris equivalent of suexec is pfexec


Static IP (v.all)

Network config is arranged via the Network Auto-Magic daemon by default. Need to set it to manual and set it up correctly.


Fix screen resolution. (v.200805)

This was superficially easy: simply use the screen resolution tool in system|preferences. (Ubuntu 8.04 .. take note). Tick 'make this the default'. It didn't last a reboot though.

Really regretting installing VMWare tools now .. found a really good blog though ..

The fix was simple though. Having tracked down /etc/X11/xorg.conf, it was just a case of finding Section "Monitor" and removing all the ModeLine entries I didn't want. It'd defaulted to the last in the list. I kept 1152x864 and 1152x900 which fit OK on a 1280x1024 screen with all the VMWare console furniture.


Shell misbehaviour (v.200805)

Shell behaviour is really inconsistent, and ~/.profile and /etc/profile are absent. Within an xterm on the machine, I get a bash shell (nice to see it .. will Sun abandon 'sh' in a mainstream release, I wonder?) with a nicely built prompt. SSH into the machine, and I get an ugly '-bash-3.2$' prompt.

'su' and the prompt fixes itself. So, root's .profile must be OK.

Except root doesn't have a .profile, and 'su -' and it stays broken. Like screen resolution (no xorg configuration; its all 'automagic') and network configuration (again, 'automagic' by default) it seems even building one's PATH and PROMPT is automagic.


Lightweight installation (v.200805)

On a machine with not enough memory, Gnome never starts. It just spins around failing to start and shutting down again. A route round this:

  • ctrl-alt-backspace out of X

  • hold down shift as it starts - this appears to stop auto-login as 'jack'

  • log in as 'jack:jack' with failsafe terminal

  • 'metacity &' will start the basic gnome window manager

  • su to root; 'opensolaris' is the password (normally it'd use gnome 'su' management, but gnome isn't running)

  • then run the installer:

# /usr/bin/gui-install

Admire it, and then shut it down again. The installation ground away all night and didn't get more than 40% through, but left the machine unbootable (it was supposed to dual boot Linux)


Disabling the GUI (v.200811)

I'm not interested in having the GUI running on a server installation, so will disable the applicable services.

The following checks all the services on which gdm depends, except for four which are core OS services, and verifies what services depend on those.

svcs -d svc:/application/graphical-login/gdm:default | grep svc \
| awk '{ print $3 }' | egrep -v 'multi-user|sysconfig|utmp|filesystem' | \
while read sf ; do svcs -D $sf ; done \
| grep -v FMRI | awk '{ print $3 }' | sort | uniq

No services depend on GDM, and the list generated by the shell script are only required by GDM. (update 18th Jul - the 'system/hal' service has turned up; this has children; updated to exclude that.)

root@lexington:~# svcs -D  svc:/application/graphical-login/gdm:default 

root@lexington:~# svcs -d svc:/application/graphical-login/gdm:default | grep svc \
>  | awk '{ print $3 }' | egrep -v 'multi-user|sysconfig|utmp|filesystem|hal' | \
> while read sf ; do svcs -D $sf ; done \
> | grep -v FMRI | awk '{ print $3 }' | sort | uniq
svc:/application/graphical-login/gdm:default

root@lexington:~# svcs -d svc:/application/graphical-login/gdm:default | grep svc | \
> egrep  'multi-user|sysconfig|utmp|filesystem|hal' | awk '{ print $3 }'
svc:/system/filesystem/local:default
svc:/milestone/sysconfig:default
svc:/system/utmp:default
svc:/milestone/multi-user:default
svc:/system/hal:default

Just GDM, so we can disable that plus all these other extras.

root@lexington:~# svcadm disable svc:/application/graphical-login/gdm:default
root@lexington:~# svcs -d svc:/application/graphical-login/gdm:default | grep svc | \
> awk '{ print $3 }' | egrep -v 'multi-user|sysconfig|utmp|filesystem|hal' | while read sf ; do
> svcadm disable $sf && echo $sf ; done
svc:/application/desktop-cache/input-method-cache:default
svc:/application/desktop-cache/mime-types-cache:default
svc:/application/desktop-cache/gconf-cache:default
svc:/application/desktop-cache/desktop-mime-cache:default
svc:/application/desktop-cache/pixbuf-loaders-installer:default
svc:/application/opengl/ogl-select:default
svc:/application/font/fc-cache:default
svc:/application/desktop-cache/icon-cache:default

Tweaks (v.?)

Configuring an intel system to use a serial console and enabling console root is tackled by dclarke in the following blog posting:

The root entry in /etc/user_attr changed to:

#root::::type=role;auths=solaris.*,solaris.grant;profiles=All;lock_after_retries=no;min_label=admin_low;clearance=admin_high
root::::auths=solaris.*,solaris.grant;profiles=All;lock_after_retries=no;min_label=admin_low;clearance=admin_high

Text boot

Opensolaris 200811 has a text boot option as a second GRUB option. As I've disabled the GUI and am running the machine with a 12" VGA monitor, I'd like to set it as the default.

Conspicuous by its absence is /boot/grub/menu.lst

There's a /boot/grub/install_menu file which shows some other potential boot configurations, such as setting serial consoles. But they're not ZFS boot, which requires more infrastructure. Turns out its in a separate boot/grub/ folder in the root zpool.

root@lexington:~# ls /boot/grub/menu.lst
ls: cannot access /boot/grub/menu.lst: No such file or directory
root@lexington:~# tail -3 /boot/grub/install_menu 
title Solaris Express Serial Console ttyb (for lx50, v60x and v65x)
        kernel$ /boot/platform/i86pc/kernel/$ISADIR/unix -B install_media=cdrom,console=ttyb
        module$ /boot/$ISADIR/x86.miniroot
root@lexington:~# cat /rpool/boot/grub/menu.lst
splashimage /boot/grub/splash.xpm.gz
background 215ECA
timeout 30
default 0
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title OpenSolaris 2008.11 snv_101b_rc2 X86
findroot (pool_rpool,0,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------

title OpenSolaris 2008.11 snv_101b_rc2 X86 text boot
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

Kernel panics, dumps etc

If its gonna keel over, it'd be nice to have the corefiles.

root@lexington:/var/crash# dumpadm
      Dump content: kernel pages
       Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/lexington
  Savecore enabled: no
root@lexington:/var/crash# ls  /var/crash/lexington
ls: cannot access /var/crash/lexington: No such file or directory
root@lexington:/var/crash# mkdir -p /var/crash/lexington ; chmod 1777 /var/crash/lexington
     -c content-type
         Modify the dump configuration so  that  the  crash  dump
         consists  of  the  specified  dump  content. The content
         should be one of the following:

         kernel
             Kernel memory pages only.

         all
             All memory pages.

         curproc
             Kernel memory pages, and the  memory  pages  of  the
             process  whose thread was currently executing on the
             CPU on which the crash dump was  initiated.  If  the
             thread  executing on that CPU is a kernel thread not
             associated with any user process, only kernel  pages
             will be dumped.
     -n
         Modify  the  dump  configuration  to  not  run  savecore
         automatically  on  reboot.  This  is not the recommended
         system configuration; if the dump device is a swap  par-
         tition,  the dump data will be overwritten as the system
         begins to swap. If  savecore  is  not  executed  shortly
         after boot, crash dump retrieval may not be possible.

     -y
         Modify  the  dump  configuration  to  automatically  run
         savecore  on  reboot.  This is the default for this dump
         setting.
root@lexington:/var/crash# dumpadm -y -c curproc
      Dump content: kernel and current process pages
       Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/lexington
  Savecore enabled: yes

Bug - slow shutdown and errors about GDM [2008.10]

$ tail -2 /var/svc/log/application-graphical-login-gdm:default.log
[ Apr 25 18:07:06 Method "stop" exited with status 0. ]
[ Apr 25 18:08:06 Method or service exit timed out.  Killing contract 89. ]
$ grep gdm /var/adm/messages | tail -2
Apr 25 18:08:06 lexington svc.startd[7]: [ID 122153 daemon.warning] 
   svc:/application/graphical-login/gdm:default: Method or service exit timed out.  Killing contract 89.
Apr 25 18:08:06 lexington svc.startd[7]: [ID 748625 daemon.error] 
   application/graphical-login/gdm:default failed: transitioned to maintenance (see 'svcs -xv' for details)

Seems the service manifest and a script is required to ensure GDM shuts down cleanly.

Download them from the link above.

[for my reference]

sftp> cd /srv/data/files/data/software/solaris/opensolaris_gdm_fix      
sftp> ls
gdm.xml  svc-gdm  
sftp> mget *

[replace the gdm.xml file, with the same authorities.]
[other users report big issues, so back it up; not sure how svcadm would handle backups, so take it out of band]
[add the script in and set the authorities]

# cd /var/svc/manifest/application/graphical-login/
# tar -cf ~ben/gdm.xml.tar gdm.xml
# cat /tmp/gdm.xml > gdm.xml
# cd /lib/svc/method
# cp /tmp/svc-gdm ./
# chmod 555 ./svc-gdm
# chown root:bin ./svc-gdm

# cp -p /usr/sbin/gdm /usr/sbin/gdm.20090425

[edit out the penultimate three lines]

# diff /usr/sbin/gdm /usr/sbin/gdm.20090425
38,40c38,40
< # eval `/usr/bin/su - gdm -c /usr/bin/dbus-launch --sh-syntax --exit-with-session`
< # export DBUS_SESSION_BUS_ADDRESS
< # export DBUS_SESSION_BUS_PID
---
> eval `/usr/bin/su - gdm -c /usr/bin/dbus-launch --sh-syntax --exit-with-session`
> export DBUS_SESSION_BUS_ADDRESS
> export DBUS_SESSION_BUS_PID

# svcadm refresh svc:/application/graphical-login/gdm:default
# svcadm restart svc:/application/graphical-login/gdm:default
# tail -f /var/svc/log/application-graphical-login-gdm:default.log
[ Apr 25 18:37:31 Rereading configuration. ]
[ Apr 25 18:37:31 No 'refresh' method defined.  Treating as :true. ]
[ Apr 25 18:38:53 Stopping because service restarting. ]
[ Apr 25 18:38:53 Executing stop method ("/usr/sbin/gdm-stop"). ]
[ Apr 25 18:38:53 Method "stop" exited with status 0. ]
[ Apr 25 18:39:54 Method or service exit timed out.  Killing contract 89. ]
# svcs svc:/application/graphical-login/gdm:default
STATE          STIME    FMRI
maintenance    18:39:54 svc:/application/graphical-login/gdm:default

That didn't work .. probably need to find out the right way to switch svc configs on the fly!

Rebooted, which is the other approach.

$ svcadm restart svc:/application/graphical-login/gdm:default
$ tail -f /var/svc/log/application-graphical-login-gdm:default.log
[ Apr 25 18:48:29 Stopping because service restarting. ]
[ Apr 25 18:48:29 Executing stop method ("/lib/svc/method/svc-gdm stop"). ]
[ Apr 25 18:48:29 Method "stop" exited with status 0. ]
[ Apr 25 18:48:30 Executing start method ("/lib/svc/method/svc-gdm start"). ]
[ Apr 25 18:48:30 Method "start" exited with status 0. ]


Driver aliases

Trying to get a PCI SATA card to work under opensolaris. System is running off onboard PATA (moral: onboard is best) but I want to be able to pop SATA disks into this machine via a caddy.

Having failed to get two Adaptec cards to work, I bought a startech.com Silicon Graphics based card which works .. mostly:

The Silicon Image 3114 controllers can be shipped with a "RAID" firmware that causes their pci device class to appear as RAID rather than ATA. The ata driver in solaris/opensolaris matches on hardware by the ATA device class, which means the 3114 board wont attach the ata driver in this situation. If you get a 3114 with the non-RAID firmware, it works fine. The hardware should be supported by the legacy ATA driver, so the controller and the disks attached to it should appear in the operating system.

The fix is, apparently:

# update_drv -a -i ' "pci1095,3114" ' ata

Rebooted.

A useful command for querying hardware:

[abridged]

# prtpicl -v -c obp_class
  pci1095,6114 (obp-device, ab00000157)
  :fast-back-to-back
  :66mhz-capable
  :model         RAID controller 
  :compatible   (ab00000161TBL) 
   | pci1095,3114.1095.6114.2 |
   | pci1095,3114.1095.6114 |
   | pci1095,6114 |
   | pci1095,3114.2 |
   | pci1095,3114 |
   | pciclass,010400 |
   | pciclass,0104 |
  :devfs-path    /pci@0,0/pci1095,6114 
  :driver-name   ata 
  :binding-name  pci1095,3114 
  :instance      -1 
  :_class        obp-device 
  :name  pci1095,6114 

Didn't work. The device driver utility (via the menus, or /usr/ddu/ddu.py) showed it as misconfigured.

The dev-fs path shown wasn't in /etc/path_to_inst.

# devfsadm
# grep 6114 /etc/path_to_inst
"/pci@0,0/pci1095,6114@b" 2 "ata"

Lets try a reboot!

No improvement.

Threads on the subject suggested that the firmware needed to be changed to a plain SATA card (when will hardware vendors stop requiring DOS?!) so flashed it in another machine. On booting, an extra entry had been added to /etc/path_to_inst - pci1095,6114 and pci1095,3114 were mapped to ata with instances 2 and 3. Still no extra disk, and 'Misconfigured' in the GUI. Removed the driver alias from /etc/driver_aliases and the two mappings and rebooted. This time, success!

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c7d0 <DEFAULT cyl 3071 alt 2 hd 128 sec 32>
          /pci@0,0/pci-ide@11,1/ide@0/cmdk@0,0
       1. c8d1 <DEFAULT cyl 3263 alt 2 hd 128 sec 32>
          /pci@0,0/pci-ide@11,1/ide@1/cmdk@1,0
       2. c10d0 <drive type unknown>
          /pci@0,0/pci-ide@b/ide@0/cmdk@0,0
# grep '/pci@0,0/pci-ide@b/ide@0' /etc/path_to_inst
"/pci@0,0/pci-ide@b/ide@0" 2 "ata"
"/pci@0,0/pci-ide@b/ide@0/cmdk@0,0" 2 "cmdk"


Removing packages

I've downgraded the graphics to an older NVidia card that's not supported by the 180.* driver.

root@brittain:/# tail -10 /var/log/Xorg.0.log
(WW) NVIDIA(0): The NVIDIA RIVA TNT2 Model 64/Model 64 Pro GPU installed in
(WW) NVIDIA(0):     this system is supported through the NVIDIA 71.86.xx
(WW) NVIDIA(0):     Legacy drivers. Please visit
(WW) NVIDIA(0):     http://www.nvidia.com/object/unix.html for more
(WW) NVIDIA(0):     information.  The 180.44 NVIDIA driver will ignore this
(WW) NVIDIA(0):     GPU.  Continuing probe... 
(EE) No devices detected.

Fatal server error:
no screens found

First step to potentially installing the last one that was supported is to remove the current driver.

root@brittain:/var/log# pkgrm NVDAgraphics

The following package is currently installed:
   NVDAgraphics  NVIDIA Graphics System Software
                 (i386) 180.44,REV=2009.03.26.10.05

Do you want to remove this package? [y,n,?,q] y
pkgrm: ERROR: unable to change current working directory to 

Removal of  failed (internal error).
No changes were made to the system.

root@brittain:/var/log#  pkg uninstall NVDAgraphics
PHASE                                        ACTIONS
Removal Phase                                200/200 

Also work remembering the following command that may fix problems with the removal of core opensolaris packages provided by the cd.

"due to a bug in some builds .. [this command] tells the system to not require all packages installed by the LiveCD stay installed"

pfexec pkg uninstall slim_install

And while we're here, its good to see the pkg tool following the conventions of zfs and ldoms and succumbing to guess work ..

root@brittain:/#  pkg list 'SUNWzf*'
NAME (PUBLISHER)                              VERSION         STATE      UFIX
SUNWzfs                                       0.5.11-0.111    installed  ----
SUNWzfs-auto-snapshot                         0.5.11-0.111    installed  ----
SUNWzfskr                                     0.5.11-0.111    installed  ----

Printed and hosted by Prater Raines Ltd, 98 Sandgate High Street, Folkestone CT20 3BY.
Published and promoted by Ben Prescott, 14, St James's Square, Bournemouth, BH5 2BX. All rights reserved.
The views expressed are solely those of the author, not of the service provider.