Solaris

From Wikitech
(Difference between revisions)
Jump to: navigation, search
Line 36: Line 36:
  
 
== Services ==
 
== Services ==
Solaris uses Service Management Facility for 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)
 
  # svcs -a                    (display all services)
 
  STATE          STIME    FMRI
 
  STATE          STIME    FMRI
Line 62: Line 63:
 
== Misc differences from Linux ==
 
== Misc differences from Linux ==
 
* <tt>/etc/vfstab</tt>, not <tt>/etc/fstab</tt>
 
* <tt>/etc/vfstab</tt>, not <tt>/etc/fstab</tt>
* use <tt>share</tt> to share NFS filesystems:
+
* (NOT FOR ZFS!) use <tt>share</tt> to share NFS filesystems:
 
  share -F nfs -orw=10.0.0.1 /export/homefs
 
  share -F nfs -orw=10.0.0.1 /export/homefs
 +
* make sure to edit <tt>/etc/dfs/dfstab</tt> 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.
 
* <tt>df</tt> looks odd.  use <tt>df -h</tt>
 
* <tt>df</tt> looks odd.  use <tt>df -h</tt>
  
 
== Software ==
 
== Software ==
  
Solaris packages are available in /h/w/src/solaris/.  They install into /aux0/wmf. To build a package:
+
We use the Toolserver (TS) packages for installing extra software.  All the package names start with TS, like <tt>TSmutt</tt>, and install into <tt>/opt/ts/bin</tt> (config in <tt>/etc/opt/ts</tt>).
  
$ cd /home/wikipedia/src/solaris
+
Check out the <tt>ts-specs</tt> repo:
$ gzip -dc program-1.0.tar.gz | tar xf -
+
 
$ cd program-1.0
+
  $ svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs
  $ ../configure.sh --prefix=/aux0/wmf/misc
+
 
$ make
+
Build + install something:
$ make DESTDIR=/tmp/program install         # or INSTALL_ROOT= for some programs
+
 
  $ cd ../
+
  $ pkgtool build www/TSphp53
$ mkdir program
+
 
$ cd program
+
You can also use '''<tt>build-only</tt>''' (to skip installing), '''<tt>install-pkgs</tt>''' and '''<tt>uninstall-pkgs</tt>'''. Be aware that one spec, like <tt>TSmutt</tt>, might map to several Solaris packages (<tt>TSmutt-root</tt>, <tt>TSmutt</tt>).
$ pkgproto /tmp/program=/ >prototype
+
 
$ echo 'i pkginfo' >>prototype
+
Check for packages that need upgrading:
  $ cat >pkginfo
+
 
PKG=WMFprogram
+
  $ ./upgrade -a
ARCH=sparc
+
VERSION=1.0
+
NAME=A program built for WMF
+
CATEGORY=application
+
BASEDIR=/
+
^D
+
  $ pkgmk -o
+
$ cd ..
+
$ pkgtrans -s /var/spool/pkg `pwd`/WMFprogram.sparc.pkg WMFprogram
+
$ pkgadd -d WMFprogram.sparc.pkg
+
  
 
== Live upgrade of OS ==
 
== Live upgrade of OS ==
Line 100: Line 95:
 
== Patch commands ==
 
== 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:
+
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 <tt>/opt/ts/bin/pca</tt> command (see [[Live Upgrade quickstart]] for more info on this).  Some useful commands:
  
 
  pca -l
 
  pca -l
 
show all patches not yet installed
 
show all patches not yet installed
  
  ls /var/sadm/patch
+
  showrev -p
 
show the patches installed on your currently running system
 
show the patches installed on your currently running system
  
 
  lumount name-of-alt-boot-env-here
 
  lumount name-of-alt-boot-env-here
  ls /.alt.name-of-alt-boot-env-here/var/sadm/patch
+
  showrev -p -R /.alt.name-of-alt-boot-env-here
 
show the patches installed on your alternate boot environment
 
show the patches installed on your alternate boot environment
  
 
+
Note that [http://www.par.univie.ac.at/solaris/pca/ PCA] is not part of Solaris.  The Sun equivalent is <tt>smpatch</tt>, but it's annoying to use, so use PCA instead (everyone else does).
  
 
[[Category:Operating system]]
 
[[Category:Operating system]]

Revision as of 22:14, 17 July 2009

Solaris is an operating system.

Contents

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

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).

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox