Jump to content

Obsolete:Solaris

From Wikitech
This page contains historical information. It may be outdated or unreliable.

Solaris is an operating system.

LDAP

# svcadm enable ldap/client
# ldapclient init \
  -a proxyDN=cn=proxyuser,dc=wikimedia,dc=org \
  -a domainName=pmtpa.wmnet \
  -a proxyPassword=whatever \
  -a authenticationMethod=simple 10.0.2.2

SVM

Solaris Volume Manager (formerly Solstice DiskSuite) is a software RAID package for Solaris.

  • display arrays:
# metastat -c
d8               m   19GB d6 d7
    d6           s   19GB c0t2d0s1 c0t3d0s1
    d7           s   19GB c0t4d0s1 c0t5d0s1
d2               m  380GB d0 d1 (resync-46%)
    d0           s  380GB c0t0d0s1 c0t1d0s7 c0t2d0s0
    d1           s  380GB c0t3d0s0 c0t4d0s0 c0t5d0s0
d5               m  8.5GB d3 d4
    d3           s  8.5GB c0t1d0s0
    d4           s  9.2GB c0t0d0s0

(leave off -c for more detailed information)

  • create a new raid-0 array named d0 on c0t0d0s0 and c0t1d0s0:
# metainit -f d0 1 2 c0t0d0s0 c0t1d0s0
  • create a new raid-1 array named d2 from d0 and d1:
# metainit -f d2 -m d0
# metattach d2 d1

(RAID-10 is accomplished by striping mirrors, i.e. it looks like RAID 0+1, except it's not, really)

More information:

Services

Solaris uses Service Management Facility for services. Each service has an identifier called an FMRI, that looks like a URI.

# svcs -a                    (display all services)
STATE          STIME    FMRI
legacy_run     16:57:12 lrc:/etc/rcS_d/S50sk98sol
legacy_run     16:57:43 lrc:/etc/rc2_d/S20sysetup
...
# svcs -a | grep online      (displays online service)
online         16:57:07 svc:/system/svc/restarter:default
online         16:57:08 svc:/network/pfil:default
online         16:57:08 svc:/network/loopback:default
...
# svcadm disable sendmail    (disable sendmail)
# svcadm enable sendmail     (restart it again)
# svcs -x                    (display failed services)
svc:/network/security/ktkt_warn:default (Kerberos V5 warning messages daemon)
 State: maintenance since Mon 05 Sep 2005 12:04:11 PM BST
Reason: Restarter svc:/network/inetd:default gave no explanation.
   See: http://sun.com/msg/SMF-8000-9C
   See: ktkt_warnd(1M)
Impact: This service is not running.

More information:

Misc differences from Linux

  • /etc/vfstab, not /etc/fstab
  • (NOT FOR ZFS!) use share to share NFS filesystems:
share -F nfs -orw=10.0.0.1 /export/homefs
  • make sure to edit /etc/dfs/dfstab afterwards to include the share command, so it takes effect on reboot.
  • For ZFS, do this instead:
zfs set sharenfs=rw=10.0.0.1 export/homefs
  • no need to edit any files, sharenfs is persistent.
  • df looks odd. use df -h
  • There is no md5sum. You can build md5 from source (get it from sunfreeware.com); by default it will install into /usr/local/bin. On ms1 and ms4 it has been installed into /opt/ts/bin along with most locally-installed software, and then symlinked into /usr/bin.
  • There is no rsync by default. We have a local build on ms1 and ms4 in /opt/ts/bin which is symlinked into /usr/bin/rsync.
  • If you want to mount a filesystem by hand use -F filsesystemtype (not -t), here's an example:
    mount -F nfs -o bg,soft,intr,vers=3 ms4:/export/upload /mnt/tmp

Software

We use the Toolserver (TS) packages for installing extra software. All the package names start with TS, like TSmutt, and install into /opt/ts/bin (config in /etc/opt/ts).

Check out the ts-specs repo:

$ svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs

Build + install something:

$ pkgtool build www/TSphp53

You can also use build-only (to skip installing), install-pkgs and uninstall-pkgs. Be aware that one spec, like TSmutt, might map to several Solaris packages (TSmutt-root, TSmutt).

Check for packages that need upgrading:

$ ./upgrade -a

Live upgrade of OS

See Live Upgrade quickstart

Patch commands

Ordinarily you will be able to just bring your current copy of Solaris up to speed (or create an alternate boot environment and bring that up to speed) with the /opt/ts/bin/pca command (see Live Upgrade quickstart for more info on this). Some useful commands:

pca -l
show all patches not yet installed
showrev -p
show the patches installed on your currently running system
lumount name-of-alt-boot-env-here
showrev -p -R /.alt.name-of-alt-boot-env-here
show the patches installed on your alternate boot environment

Note that PCA is not part of Solaris. The Sun equivalent is smpatch, but it's annoying to use, so use PCA instead (everyone else does).

Installing Solaris

See Installing Solaris.

Installing free packages

Some packages (for eample, sudo) are available as free packages from sunfreeware. You can download gzipped "package streams" (use wget to retrieve them from the site). These can then be installed by

 pkgadd -d path-to-gunzipped-file

You may find these will have dependencies; even if your system has the particular libraries in /usr/lib, you probably need to install the dependencies, because the versions will be different. These packages usually wind up in /usr/local/lib.

Hardware information

  • /usr/platform/`uname -i`/sbin/prtdiag

This command will show you the model (eg. Sun Fire X4540), BIOS, CPU and memory info.

  • smbios

This shows you compoment information and serial numbers. If you do

 smbios | grep Serial  

the first number will be the serial number Sun wants for support.

Troubleshooting

On Sun Fire X4500 and X4540s, sometimes when you reboot one of these hosts, it will not come back. If you get a serial console from the IPMI interface you may see that it's hung asking a question like "Do you wish to have it mounted read-write on /a?" This means that it tried to boot one of the images in "safe mode". You'll need to reboot from the IPMI interface, get your serial console session back, and choose the correct boot image in the grub menu. (Choose the regular image corresponding to the one that was being booted in safe mode.)

On ms6 the default kernel has been moved to to the last entry in the grub boot menu. (You can determine which boot menu file is in use by the command bootadm list-menu.) This is on the theory that something the ilom (maybe) was causing down-arrows to be generated which wound up causing the last entry, i.e. the failsafe mode.