Solaris Notes

From The System Administrator Zone

General Solaris Notes

Auto mounting of home directories

Auto mounting of the user home directories is controlled by /etc/auto_home and /etc/auto_master.

auto_master is used to map directories to control files. In this case, to map /home to /etc/auto_home.

% grep home /etc/auto_master
/home           auto_home       -nobrowse

The control files map directory names to remote mount points. In this case, the wildcard username * is mapped to a exported directory on the host and the username is substituted for the placeholder &.

% cat /etc/auto_home
# Home directory map for automounter
*       server:/export/homes/&

Disable dtspc in /etc/inet/inetd.conf on the Solaris

Common Desktop Environment (CDE) DtSvc Library Buffer Overflow May Let Local Users Obtain Root Privileges

See: SecurityTracker

Comment out the following line in /etc/inetd.conf.

# dtspc stream tcp nowait root /usr/dt/bin/dtspcd /usr/dt/bin/dtspcd

Sun Fire V210/240/440 servers: How to set up systems to power up automatically.

Sun Fire V210/240/440 servers have 3 configuration settings which control the behavior of the system after a power outage. These settings are :

  • ALOM variable sc_powerstatememory
  • ALOM variable sc_powerondelay
  • OBP variable auto-boot?

The ALOM sc_powerstatememory variable controls the action of the system when power is applied. Valid settings for this variable are :

  • true - Returns the system to the state it was in when the power was removed
  • false - Keeps the system powered off

If sc_powerstatememory is set to true, the ALOM sc_powerondelay variable controls how quickly the system will be powered on after power is applied. Valid settings are :

  • true - Power-on will be delayed for a random time period between 1 and 5 seconds
  • false - The system will power-on immediately.

Setting sc_powerondelay to true, thus delaying the server power-on, helps minimize current surges on the main power source. This is important when multiple servers in a rack, power on after a power outage.
The Online Boot PROM(OBP) auto-boot? variable, controls whether the system will automatically boot the Solaris Operating System once it passes it's Power On Self Test (POST). Valid settings are :

  • true - Automatically boot Solaris
  • false - Remain at the OK prompt

The two ALOM variables can be set via ALOM commands or, while in Solaris OS, by using the scadm command. The OBP variable can be set from the OK prompt, or, while in Solaris OS, by using the eeprom command.

  1. To set variables through ALOM:
sc> setsc sc_powerstatememory true
sc> setsc sc_powerondelay true
  1. To set the variables with scadm while in Solaris OS: (from directory /usr/platform/SUNW,Sun-Fire-VXX0/sbin - must be run as root)
# scadm set sc_powerstatememory true
# scadm set sc_powerondelay true
  1. To set variable from OBP:
ok setenv auto-boot? true
  1. To set OBP variables from Solaris OS:
# eeprom 'auto-boot?=true'

Booting Single User from Distribution CDROM

To boot the installation CD in single user mode, use the -s option.

OK boot cdrom -s

Regenerating Device Tables

To boot the system and have it look for new hardware and regenerate its tables.

OK boot -rv

To regenerate the tables without rebooting:

# devfsadm -C

It may be necessary to delete the existing links in /dev/rmt/ or /dev/sg/ to make these options work correctly.

Boot Without Disksuite Mirror

Boot with following flags

boot -asv
  • a - interactive mode
  • s - single user
  • v - verbose

Answer /dev/null in the place of /etc/system.

Solaris 10 Specific Notes

SMF: starting/controlling services

In most Unix systems, startup scripts in /etc/rc3.d, etc, are used to start and stop services. Solaris 10 uses a different approach. There are two advantages to the Solaris 10 method:

  • The system can come up faster, because startup of various systems can be done in parallel.
  • The system knows more about what is going on. It can monitor processes and restart them.

Services are managed by svcadm. The most common commands are

    svcadm enable SERVICE
    svcadm disable SERVICE 

Note that enable and disable are persistent. That is, if you enable a service it will be brought back up after a reboot. Similarly with disabling a service. If you want to stop a service but have it come back up after the next reboot, use:

    svcadm -t disable SERVICE

To look at services, two common commands are

    svcs {lists summary of all}
    svcs -l SERVICE {details on one service} 

Solaris 10 still pays attention to /etc/rcN.d, but services defined there are "legacy", and can't be fully monitored and controlled.

Trouble Shooting SMF

  • svcs -x
  • /var/svc/log/

Controlling autofs with SMF

  • svcadm disable network/rpc/bind
  • svccfg delete network/rpc/bind
  • svccfg import /var/svc/manifest/network/rpc/bind.xml
  • svcadm enable system/filesystem/autofs

Informative Links

route - manually manipulate the routing tables

route manually manipulates the network routing tables. These tables are normally maintained by the system routing daemon, such as in.routed(1M) and in.ripngd(1M).

Say, for example, you have the wrong default router subnet 54 instead of subnet 56

[root@srv16 etc]# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------             U         1    270  bge0            U         1      0  bge0
default               UG        1     22              UH        5    172  lo0
[root@srv16 etc]#

You can edit /etc/defaultrouter so that the correct value is set the next time you reboot, but you can also delete the old, incorrect entry and add the new one while still online.

[root@srv16 etc]# route delete default
delete net default: gateway
[root@srv16 etc]# route add default
add net default: gateway
[root@srv16 etc]# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------             U         1    270  bge0            U         1      0  bge0
default               UG        1      0              UH        5    172  lo0
[root@palsrv16 etc]#