Ceci est une ancienne révision du document !


Boot Process and Service Administration

Boot Process

SPARC Systems

The boot process on a SPARC system uses OpenBoot commands.

For a detailed description of the SPARC boot process, look as the following two pages from oracle's documentation site:

The finality of the boot process is the execution of /sbin/init which generates the init process.

Since there is no Live Media boot option for SPARC systems, installation of Solaris 11 must be accomplished using the Text Install method.

x86 Systems

x86 systems boot using the Basic Input/Output System ( BIOS ) or more recently the Unified Extensible Firmware Interface ( UEFI ). Amongst other roles, both of these are responsible for starting the Boot Loader. Solaris 11 uses the GNU GRand Unified Boot loader 2 ( Grub2 ) as its default boot loader on x86 systems.

Grub 2

Grub 2 is a complete re-write of the previous Grub, now called Grub Legacy.

Grub 2 has gone the modules route. Solaris 11 Grub 2 modules can be found in the /boot/grub/i386-pc directory:

root@solaris:~# ls /boot/grub/i386-pc
acpi.mod                     luks.mod
adler32.mod                  lvm.mod
affs.mod                     lzma_decompress.img
afs.mod                      lzopio.mod
ahci.mod                     mdraid09.mod
aout.mod                     mdraid1x.mod
at_keyboard.mod              memrw.mod
ata.mod                      minix.mod
bfs.mod                      minix2.mod
bitmap_scale.mod             minix3.mod
bitmap.mod                   mmap.mod
blocklist.mod                moddep.lst
boot.img                     msdospart.mod
boot.mod                     multiboot.mod
bsd.mod                      multiboot2.mod
btrfs.mod                    net.mod
bufio.mod                    newc.mod
cat.mod                      nilfs2.mod
cdboot.img                   normal.mod
chain.mod                    ntfs.mod
cmostest.mod                 ntfscomp.mod
cmp.mod                      ntldr.mod
command.lst                  odc.mod
core.img                     ohci.mod
cpio_be.mod                  part_acorn.mod
cpio.mod                     part_amiga.mod
cpuid.mod                    part_apple.mod
crc64.mod                    part_bsd.mod
crypto.lst                   part_dvh.mod
crypto.mod                   part_plan.mod
cryptodisk.mod               part_sun.mod
cs5536.mod                   partmap.lst
custom.cfg                   parttool.lst
date.mod                     parttool.mod
datehook.mod                 password_pbkdf2.mod
datetime.mod                 password.mod
diskboot.img                 pata.mod
dm_nv.mod                    pbkdf2.mod
drivemap.mod                 pci.mod
echo.mod                     plan9.mod
efiemu.mod                   play.mod
efiemu32.o                   png.mod
efiemu64.o                   priority_queue.mod
elf.mod                      probe.mod
example_functional_test.mod  pxe.mod
exfat.mod                    pxeboot.img
ext2.mod                     raid.mod
extcmd.mod                   raid5rec.mod
fat.mod                      raid6rec.mod
font.mod                     read.mod
freedos.mod                  reiserfs.mod
fs.lst                       relocator.mod
fshelp.mod                   romfs.mod
functional_test.mod          scsi.mod
gcry_arcfour.mod             search_fs_file.mod
gcry_blowfish.mod            search_fs_uuid.mod
gcry_camellia.mod            search_label.mod
gcry_cast5.mod               sendkey.mod
gcry_crc.mod                 serial.mod
gcry_des.mod                 setjmp.mod
gcry_md4.mod                 setpci.mod
gcry_md5.mod                 sfs.mod
gcry_rfc2268.mod             sleep.mod
gcry_rijndael.mod            squash4.mod
gcry_rmd160.mod              terminal.lst
gcry_seed.mod                terminal.mod
gcry_serpent.mod             terminfo.mod
gcry_sha1.mod                test_blockarg.mod
gcry_sha256.mod              test.mod
gcry_sha512.mod              testload.mod
gcry_tiger.mod               tftp.mod
gcry_twofish.mod             tga.mod
gcry_whirlpool.mod           time.mod
geli.mod                     tr.mod
gettext.mod                  trig.mod
gfxmenu.mod                  true.mod
gfxterm.mod                  udf.mod
gptsync.mod                  ufs2.mod
grub.cfg                     uhci.mod
halt.mod                     usb_keyboard.mod
hashsum.mod                  usb.mod
hdparm.mod                   usbms.mod
hello.mod                    usbserial_common.mod
help.mod                     usbserial_ftdi.mod
hexdump.mod                  usbserial_pl2303.mod
hfs.mod                      usbtest.mod
hfsplus.mod                  vbe.mod
http.mod                     version.lst
iorw.mod                     vga_text.mod
jfs.mod                      vga.mod
jpeg.mod                     video_bochs.mod
kernel.img                   video_cirrus.mod
keylayouts.mod               video_fb.mod
keystatus.mod                video.lst
legacycfg.mod                video.mod
linux.mod                    videoinfo.mod
linux16.mod                  videotest.mod
lnxboot.img                  xfs.mod
loadenv.mod                  xnu_uuid.mod
loopback.mod                 xnu.mod
ls.mod                       xzio.mod
lsacpi.mod                   zfs.mod
lsapm.mod                    zfscrypt.mod
lsmmap.mod                   zfsinfo.mod
lspci.mod

Grub 2 reads the boot entries or stanzas from the /boot/grub/grub.cfg file:

root@solaris:~# cat /boot/grub/grub.cfg 
# GRUB2 configuration file

load_video_$target
terminal_output console

if sleep --verbose --interruptible 5; then
	set timeout=0
fi

set default="0"

menuentry "Oracle Solaris 11.1" {
	search --no-floppy --file --set=root /.geranium-2012-09-19T13:14:16.621522
	set kern=/platform/i86pc/kernel/amd64/unix
	echo -n "Loading ${root}$kern: "
	$multiboot $kern $kern 
	set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"
	insmod gzio
	echo -n "Loading ${root}/platform/i86pc/amd64/boot_archive: "
	$module /platform/i86pc/amd64/boot_archive
}

menuentry "Oracle Solaris 11.1 ttya" {
	search --no-floppy --file --set=root /.geranium-2012-09-19T13:14:16.621522
	set kern=/platform/i86pc/kernel/amd64/unix
	echo -n "Loading ${root}$kern: "
	$multiboot $kern $kern -B console=ttya
	set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"
	insmod gzio
	echo -n "Loading ${root}/platform/i86pc/amd64/boot_archive: "
	$module /platform/i86pc/amd64/boot_archive
}

menuentry "Oracle Solaris 11.1 ttyb" {
	search --no-floppy --file --set=root /.geranium-2012-09-19T13:14:16.621522
	set kern=/platform/i86pc/kernel/amd64/unix
	echo -n "Loading ${root}$kern: "
	$multiboot $kern $kern -B console=ttyb
	set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"
	insmod gzio
	echo -n "Loading ${root}/platform/i86pc/amd64/boot_archive: "
	$module /platform/i86pc/amd64/boot_archive
}

if [ "$target" = "i386_pc" ]; then
	menuentry "Boot from Hard Disk" {
		set root=(hd0)
		chainloader --force +1
	}
else
	menuentry "Entry [Boot from Hard Disk] not supported on this firmware" {
		echo "Not supported"
	}
fi


if [ -f /boot/grub/custom.cfg ]; then
	source /boot/grub/custom.cfg
fi

This file must never be edited manually. To modify Grub 2, use the bootadm command:

root@solaris:~# bootadm
Usage:
	bootadm update-archive [-vn] [-R altroot [-p platform>]]
	bootadm list-archive [-R altroot [-p platform>]]
	bootadm install-bootloader [-fMv] [-P pool] [-R path] [device1 ... deviceN]
	bootadm set-menu [-P pool] [-R altroot] key=value
	bootadm list-menu [-P pool] [-R altroot] <entry_title>|-i <index>
	bootadm add-entry [-P pool] [-i <source_index>] <entry_title>
	bootadm remove-entry [-P pool] <entry_title>|-i <index>
	bootadm change-entry [-P pool] <entry_title>|-i <index> {key=value}+ [set-default]
	bootadm generate-menu [-f] [-P pool]

The bootadm command can, for example, be used to display the current boot menu and default Grub values:

root@solaris:~# bootadm list-menu
the location of the boot loader configuration files is: /rpool/boot/grub
default 0
console text
timeout 30
0 Oracle Solaris 11.1
1 solaris-backup-1

The Init Process

As seen above, the first process to be launched at boot is the init process. The init process is configured by editing the /etc/inittab file.

Inittab

#
# Copyright (c) 1988, 2011, Oracle and/or its affiliates. All rights reserved.
#
# The /etc/inittab file controls the configuration of init(1M); for more
# information refer to init(1M) and inittab(4).  It is no longer
# necessary to edit inittab(4) directly; administrators should use the
# Solaris Service Management Facility (SMF) to define services instead.
# Refer to smf(5) and the System Administration Guide for more
# information on SMF.
#
# For modifying parameters passed to ttymon, use svccfg(1m) to modify
# the SMF repository. For example:
#
#	# svccfg
#	svc:> select system/console-login:default
#	svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
#	svc:/system/console-login> refresh
#	svc:/system/console-login> exit
#
ap::sysinit:/usr/sbin/autopush -f /etc/iu.ap
smf::sysinit:/lib/svc/bin/svc.startd	>/dev/msglog 2<>/dev/msglog </dev/console
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog

In the above example, each uncommented line contains four fields separated by a colon:

Field Name Description
1 ID A 1 to 4 character unique identifier for the line
2 RUN LEVELS The UNIX SVR4 run levels concerned by the line
3 ACTION The method used to run the command in the 4th field
4 COMMAND The command to execute

As you can see by the following line in the above file:

...
smf::sysinit:/lib/svc/bin/svc.startd	>/dev/msglog 2<>/dev/msglog </dev/console
...

the action sysinit starts /lib/svc/bin/svc.startd at system boot.

The svc.startd daemon is responsible for:

  • starting SMF service instances,
  • monitoring SMF service instances,
  • restarting SMF service instances,
  • running legacy rc scripts in the appropriate run levels,
  • error state reporting.

The svc.startd daemon keeps status information for every SMF service instance in files in the /etc/svc directory. It also keeps a repository of all SMF service instances in the /etc/svc/repository.db database:

root@solaris:~# ls -l /etc/svc
total 214807
drwxr-xr-x   3 root     sys           17 Nov 20 19:20 profile
lrwxrwxrwx   1 root     root          31 Dec  3 13:15 repository-boot -> repository-boot-20121203_131509
-rw-------   1 root     root       54272 Nov 20 19:24 repository-boot-20121120_182407
-rw-------   1 root     root     14077952 Nov 20 22:45 repository-boot-20121120_224526
-rw-------   1 root     root     14093312 Dec  1 14:32 repository-boot-20121201_143210
-rw-------   1 root     root     14131200 Dec  3 13:15 repository-boot-20121203_131509
lrwxrwxrwx   1 root     root          42 Dec  1 17:39 repository-manifest_import -> repository-manifest_import-20121201_173902
-rw-------   1 root     root     12013568 Nov 20 19:25 repository-manifest_import-20121120_182518
-rw-------   1 root     root     12632064 Nov 20 19:26 repository-manifest_import-20121120_182617
-rw-------   1 root     root     14077952 Nov 20 22:40 repository-manifest_import-20121120_214010
-rw-------   1 root     root     14115840 Dec  1 17:39 repository-manifest_import-20121201_173902
-rw-------   1 root     root     14160896 Dec 10 15:14 repository.db
lrwxrwxrwx   1 root     root          21 Nov 20 19:19 volatile -> ../../system/volatile

Boot log files are now stored in /etc/svc/volatile and the service configurations common to all services are stored in the /etc/svc/profile/generic.xml file:

root@solaris:~# ls /etc/svc/volatile
application-cups-scheduler:default.log
application-desktop-cache-desktop-mime-cache:default.log
application-desktop-cache-docbook-dtds-update:default.log
application-desktop-cache-docbook-style-dsssl-update:default.log
application-desktop-cache-docbook-style-xsl-update:default.log
application-desktop-cache-gconf-cache:default.log
application-desktop-cache-icon-cache:default.log
application-desktop-cache-input-method-cache:default.log
application-desktop-cache-mime-types-cache:default.log
application-desktop-cache-pixbuf-loaders-installer:default.log
application-font-fc-cache:default.log
application-graphical-login-gdm:default.log
application-man-index:default.log
application-management-net-snmp:default.log
application-opengl-ogl-select:default.log
application-pkg-dynamic-mirror:default.log
application-pkg-server:default.log
application-pkg-system-repository:default.log
application-pkg-update:default.log
application-pkg-zones-proxyd:default.log
application-security-tcsd:default.log
application-stosreg:default.log
application-texinfo-update:default.log
application-time-slider-plugin:rsync.log
application-time-slider-plugin:zfs-send.log
application-time-slider:default.log
application-upnp-coherence:default.log
application-virtualbox-vboxmslnk:default.log
application-virtualbox-vboxservice:default.log
bootadm.lock
ConsoleKit
cronfifo
cups
cups-socket
daemon
dbus
dladm
filesystem-autofs.lock
gdm
gdm.pid
hald
in.ndpd_ipadm
in.ndpd_mib
in.ndpd.pid
inetd.uds
init.state
initpipe
ipadm
ipf
ipmon.pid
ipsecconf.lock
kcfd_door
milestone-config:default.log
milestone-devices:default.log
milestone-multi-user-server:default.log
milestone-multi-user:default.log
milestone-name-services:default.log
milestone-network:default.log
milestone-self-assembly-complete:default.log
milestone-single-user:default.log
milestone-unconfig:default.log
name_service_door
netcfg
network-datalink-management:default.log
network-dhcp-relay:ipv4.log
network-dhcp-relay:ipv6.log
network-dhcp-server:ipv4.log
network-dhcp-server:ipv6.log
network-dns-client:default.log
network-dns-multicast:default.log
network-dns-server:default.log
network-ftp:default.log
network-http:apache22.log
network-ilomconfig-interconnect:default.log
network-inetd-upgrade:default.log
network-inetd:default.log
network-initial:default.log
network-install:default.log
network-ip-interface-management:default.log
network-ipfilter:default.log
network-ipmievd:default.log
network-ipmon:default.log
network-ipmp:default.log
network-ipsec-ike:default.log
network-ipsec-ipsecalgs:default.log
network-ipsec-manual-key:default.log
network-ipsec-policy:default.log
network-iptun:default.log
network-iscsi-initiator:default.log
network-ldap-client:default.log
network-ldap-server:openldap_24.log
network-lms:default.log
network-loadbalancer-ilb:default.log
network-location:default.log
network-location:upgrade.log
network-loopback:default.log
network-netcfg:default.log
network-netmask:default.log
network-nfs-cbd:default.log
network-nfs-client:default.log
network-nfs-fedfs-client:default.log
network-nfs-mapid:default.log
network-nfs-nlockmgr:default.log
network-nfs-server:default.log
network-nfs-status:default.log
network-nis-client:default.log
network-nis-domain:default.log
network-npiv_config:default.log
network-ntp:default.log
network-physical:default.log
network-physical:upgrade.log
network-routing-legacy-routing:ipv4.log
network-routing-legacy-routing:ipv6.log
network-routing-ndp:default.log
network-routing-rdisc:default.log
network-routing-ripng:default.log
network-routing-route:default.log
network-routing-setup:default.log
network-rpc-bind:default.log
network-rpc-keyserv:default.log
network-sctp-congestion-control:cubic.log
network-sctp-congestion-control:highspeed.log
network-sctp-congestion-control:newreno.log
network-sctp-congestion-control:vegas.log
network-security-kadmin:default.log
network-security-krb5kdc:default.log
network-sendmail-client:default.log
network-service:default.log
network-shares:default.log
network-slp:default.log
network-smb-client:default.log
network-smb:default.log
network-smtp:sendmail.log
network-socket-config:default.log
network-socket-filter:kssl.log
network-ssh:default.log
network-tcp-congestion-control:cubic.log
network-tcp-congestion-control:highspeed.log
network-tcp-congestion-control:newreno.log
network-tcp-congestion-control:vegas.log
network-uucp-lock-cleanup:default.log
network-vpanels-http:apache2.log
nfs-mapid.lock
nfs4_domain
opengl
picld_door
platform-i86pc-acpihpd:default.log
rad
rcm_daemon_door
rcm_daemon_lock
rcm_daemon_state
repository_door
rpc_door
sendmail.pid
sshd.pid
svc_nonpersist.db
svc:
svc.startd.log
sysevent_channels
sysevent_door
syseventconf.lock
syseventconfd_door
syseventd.lock
syslog_door
syslog.pid
system-auditd:default.log
system-auditset:default.log
system-avahi-bridge-dsd:default.log
system-boot-archive-update:default.log
system-boot-archive:default.log
system-boot-config:default.log
system-boot-loader-update:default.log
system-ca-certificates:default.log
system-config-user:default.log
system-consadm:default.log
system-console-login:default.log
system-console-login:terma.log
system-console-login:termb.log
system-console-login:vt2.log
system-console-login:vt3.log
system-console-login:vt4.log
system-console-login:vt5.log
system-console-login:vt6.log
system-console-reset:default.log
system-consolekit:default.log
system-coreadm:default.log
system-cron:default.log
system-cryptosvc:default.log
system-dbus:default.log
system-devchassis:cleanstart.log
system-devchassis:daemon.log
system-devfsadm:default.log
system-device-audio:default.log
system-device-fc-fabric:default.log
system-device-local:default.log
system-device-mpxio-upgrade:default.log
system-dumpadm:default.log
system-early-manifest-import:default.log
system-environment:init.log
system-extended-accounting:flow.log
system-extended-accounting:net.log
system-extended-accounting:process.log
system-extended-accounting:task.log
system-fcoe_initiator:default.log
system-filesystem-autofs:default.log
system-filesystem-local:default.log
system-filesystem-minimal:default.log
system-filesystem-reparse:default.log
system-filesystem-rmvolmgr:default.log
system-filesystem-root:default.log
system-filesystem-ufs-quota:default.log
system-filesystem-usr:default.log
system-filesystem-zfs-auto-snapshot:daily.log
system-filesystem-zfs-auto-snapshot:frequent.log
system-filesystem-zfs-auto-snapshot:hourly.log
system-filesystem-zfs-auto-snapshot:monthly.log
system-filesystem-zfs-auto-snapshot:weekly.log
system-fm-asr-notify:default.log
system-fm-notify-params:default.log
system-fm-smtp-notify:default.log
system-fm-snmp-notify:default.log
system-fmd:default.log
system-hal:default.log
system-hostid:default.log
system-hotplug:default.log
system-identity:domain.log
system-identity:node.log
system-idmap:default.log
system-install-server:default.log
system-intrd:default.log
system-keymap:default.log
system-logadm-upgrade:default.log
system-manifest-import:default.log
system-name-service-cache:default.log
system-name-service-switch:default.log
system-name-service-upgrade:default.log
system-ocm:default.log
system-pfexec:default.log
system-picl:default.log
system-pkgserv:default.log
system-pools-dynamic:default.log
system-pools:default.log
system-postrun:default.log
system-power:default.log
system-rad:local.log
system-rad:remote.log
system-rbac:default.log
system-rcap:default.log
system-rds:default.log
system-resource-controls:default.log
system-resource-mgmt:default.log
system-rmtmpfiles:default.log
system-sar:default.log
system-scheduler:default.log
system-security-security-extensions:default.log
system-svc-global:default.log
system-sysevent:default.log
system-system-log:default.log
system-timezone:default.log
system-utmp:default.log
system-vbiosd:default.log
system-vtdaemon:default.log
system-wusbd:default.log
system-zones-install:default.log
system-zones-monitoring:default.log
system-zones:default.log
tzsync
utmppipe
utmpx
vbiosd.door
vbiosd.lock
vt
xkb
zonestat_door

For example:

root@solaris:~# cat /etc/svc/volatile/application-cups-scheduler:default.log
[ Dec  3 13:15:22 Enabled. ]

Traditional Unix Run Levels

Historically Solaris used the UNIX SVR4 boot sequence based upon run levels:

Run level Description
0 Shut down for SPARC systems
S or s Single-User mode with only root filesystem mounted (as read-only)
1 Single-User mode with all local filesystems mounted (read-write)
2 Multiple user mode without NFS export
3 Multiple user mode with NFS export
4 Unused / User definable
5 Shut down, power-off if hardware supports it
6 System reboot

This boot sequence made use of scripts which either started or stopped services dependent upon the current run level. Solaris no longer uses this start up sequence. However Solaris 11 still has run levels as shown by the output of the following command:

root@solaris:~# who -r
   .       run-level 3  Dec  3 13:16     3      0  S

You can interpret this output as follows:

Output Description
run-level 3 The current run level
Dec 3 13:16 Date and hour the run level last changed
3 The current run level
0 The number of times the system has been at this run level since the last reboot
S The previous run level

Solaris 11 Boot Milestones

Solaris 11's boot process is based upon boot milestones. The following table shows the correspondence between the previous run levels and the new milestones:

Run level Milestone Description
- none All services are disabled
S or s svc://milestone/single-user:default Single-user mode
2 svc://milestone/multi-user:default Multiuser mode
3 svc://milestone/multi-user-server:default Multiuser mode with NFS
5 all Multiuser mode with all services enabled

Changing milestones manually is uncommon. However if necessary, it is recommended to use the init command as opposed to the svcadm command. Using init to put a system in run-level S will change the milestone automatically.

Service Management Facility

The Service Management Facility ( SMF ), introduced with Solaris 10, is used to manage services under Solaris 11.

An SMF service contains the following:

  1. an SMF Manifest containing the default properties of the service,
  2. one or several Start and Stop Methods or scripts used to control the service,
  3. one or several Programs,
  4. a log file,
  5. a Fault Management Resource Identifier ( FMRI ).

Fault Management Resource Identifiers

An FRMI is composed of:

  1. a Scheme - the type of service,
  2. a Location - the hostname of the system where the service runs,
  3. a Category - the service category,
  4. a Description - the service name,
  5. an Instance - the service instance ( some programs run multiple instances or the same service, for example apache ).

SMF Service categories

SMF services are grouped into functional categories:

  1. Applications,
  2. Network,
  3. Device,
  4. Milestone,
  5. System.

SMF Service States

At any point in time a SMF service instance can be in one of seven states:

  1. Uninitialized - The initial state or a service instance before being started by the svc.startd deamon.
  2. Offline - The service instance is enabled but not yet running.
  3. Online - The service instance and all of its dependencies are running without any errors.
  4. Degraded - The service instance is running but in a limited mode.
  5. Maintenance - The deamon svc.startd cannot start the service instance because of a problem.
  6. Disabled - The service instance is disabled and will not run at the next reboot.
  7. Legacy_run - The service instance cannot be managed by SMF.

Legacy_run Services

Legacy_run services are those services that still use the previous Unix rcx.d structure. SMF can start and stop these services but can do nothing more:

root@solaris:~# ls /etc/rc*
/etc/rc0.d:
K50pppd

/etc/rc1.d:
K50pppd

/etc/rc2.d:
README              S47pppd             S81dodatadm.udaplt  S89PRESERVE

/etc/rc3.d:
README

/etc/rcm:
scripts

/etc/rcS.d:
K50pppd  README

SMF Commands

The commands used to manage SMF services are shown in the following table:

Command Description
svcs Displays information about a service
svcadm Used to manage services
svccfg Used to manipulate the SMF repository
svcprop Used to view the SMF repository data
inetadm Used to view and configure inetd services

Lab #1 - Working with SMF

Using the svcs command

Firstly, use the svcs command with the -a switch to view all of the services and their current status:

root@solaris:~# svcs -a
STATE          STIME    FMRI
legacy_run     Dec_03   lrc:/etc/rc2_d/S47pppd
legacy_run     Dec_03   lrc:/etc/rc2_d/S81dodatadm_udaplt
legacy_run     Dec_03   lrc:/etc/rc2_d/S89PRESERVE
disabled       Dec_03   svc:/system/device/mpxio-upgrade:default
disabled       Dec_03   svc:/network/install:default
disabled       Dec_03   svc:/network/ipsec/ike:default
disabled       Dec_03   svc:/network/ipsec/manual-key:default
disabled       Dec_03   svc:/network/nis/domain:default
disabled       Dec_03   svc:/system/name-service-cache:default
disabled       Dec_03   svc:/network/ldap/client:default
disabled       Dec_03   svc:/network/nis/client:default
disabled       Dec_03   svc:/network/nfs/status:default
disabled       Dec_03   svc:/network/nfs/nlockmgr:default
disabled       Dec_03   svc:/network/nfs/cbd:default
disabled       Dec_03   svc:/system/idmap:default
disabled       Dec_03   svc:/network/rpc/keyserv:default
disabled       Dec_03   svc:/network/inetd-upgrade:default
disabled       Dec_03   svc:/network/nfs/client:default
disabled       Dec_03   svc:/system/pools:default
disabled       Dec_03   svc:/system/rcap:default
disabled       Dec_03   svc:/network/smb/client:default
disabled       Dec_03   svc:/application/management/net-snmp:default
disabled       Dec_03   svc:/application/security/tcsd:default
disabled       Dec_03   svc:/network/nfs/server:default
disabled       Dec_03   svc:/system/filesystem/reparse:default
disabled       Dec_03   svc:/network/ntp:default
disabled       Dec_03   svc:/application/pkg/system-repository:default
disabled       Dec_03   svc:/network/dns/multicast:default
disabled       Dec_03   svc:/application/pkg/dynamic-mirror:default
disabled       Dec_03   svc:/application/pkg/server:default
disabled       Dec_03   svc:/application/pkg/zones-proxyd:default
disabled       Dec_03   svc:/system/console-login:terma
disabled       Dec_03   svc:/system/console-login:termb
disabled       Dec_03   svc:/network/dhcp/server:ipv4
disabled       Dec_03   svc:/network/dhcp/server:ipv6
disabled       Dec_03   svc:/network/dhcp/relay:ipv6
disabled       Dec_03   svc:/network/dhcp/relay:ipv4
disabled       Dec_03   svc:/network/routing/ripng:default
disabled       Dec_03   svc:/network/routing/legacy-routing:ipv4
disabled       Dec_03   svc:/network/routing/legacy-routing:ipv6
disabled       Dec_03   svc:/network/routing/route:default
disabled       Dec_03   svc:/network/routing/rdisc:default
disabled       Dec_03   svc:/network/security/krb5kdc:default
disabled       Dec_03   svc:/network/security/kadmin:default
disabled       Dec_03   svc:/network/slp:default
disabled       Dec_03   svc:/network/socket-filter:kssl
disabled       Dec_03   svc:/network/lms:default
disabled       Dec_03   svc:/network/dns/server:default
disabled       Dec_03   svc:/network/ftp:default
disabled       Dec_03   svc:/network/http:apache22
disabled       Dec_03   svc:/network/loadbalancer/ilb:default
disabled       Dec_03   svc:/network/ipmievd:default
disabled       Dec_03   svc:/network/ldap/server:openldap_24
disabled       Dec_03   svc:/system/consadm:default
disabled       Dec_03   svc:/system/fm/notify-params:default
disabled       Dec_03   svc:/system/fm/snmp-notify:default
disabled       Dec_03   svc:/system/extended-accounting:process
disabled       Dec_03   svc:/system/pools/dynamic:default
disabled       Dec_03   svc:/system/extended-accounting:flow
disabled       Dec_03   svc:/system/extended-accounting:net
disabled       Dec_03   svc:/system/extended-accounting:task
disabled       Dec_03   svc:/system/install/server:default
disabled       Dec_03   svc:/system/rad:remote
disabled       Dec_03   svc:/system/wusbd:default
disabled       Dec_03   svc:/system/sar:default
disabled       Dec_03   svc:/system/hotplug:default
disabled       Dec_03   svc:/system/rds:default
disabled       Dec_03   svc:/system/svc/global:default
disabled       Dec_03   svc:/system/avahi-bridge-dsd:default
disabled       Dec_03   svc:/application/time-slider:default
disabled       Dec_03   svc:/application/time-slider/plugin:rsync
disabled       Dec_03   svc:/application/time-slider/plugin:zfs-send
disabled       Dec_03   svc:/application/upnp/coherence:default
disabled       Dec_03   svc:/network/vpanels-http:apache2
disabled       Dec_03   svc:/system/filesystem/zfs/auto-snapshot:monthly
disabled       Dec_03   svc:/system/filesystem/zfs/auto-snapshot:hourly
disabled       Dec_03   svc:/system/filesystem/zfs/auto-snapshot:weekly
disabled       Dec_03   svc:/system/filesystem/zfs/auto-snapshot:daily
disabled       Dec_03   svc:/system/filesystem/zfs/auto-snapshot:frequent
disabled       Dec_03   svc:/platform/i86pc/acpihpd:default
disabled       Dec_03   svc:/network/rpc/rstat:default
disabled       Dec_03   svc:/application/cups/in-lpd:default
disabled       Dec_03   svc:/network/rpc/rusers:default
disabled       Dec_03   svc:/network/rpc/spray:default
disabled       Dec_03   svc:/network/rpc/wall:default
disabled       Dec_03   svc:/network/rpc/rex:default
disabled       Dec_03   svc:/network/echo:dgram
disabled       Dec_03   svc:/network/echo:stream
disabled       Dec_03   svc:/network/time:dgram
disabled       Dec_03   svc:/network/time:stream
disabled       Dec_03   svc:/network/shell:default
disabled       Dec_03   svc:/network/shell:kshell
disabled       Dec_03   svc:/network/stlisten:default
disabled       Dec_03   svc:/network/finger:default
disabled       Dec_03   svc:/network/discard:dgram
disabled       Dec_03   svc:/network/discard:stream
disabled       Dec_03   svc:/network/nfs/rquota:default
disabled       Dec_03   svc:/network/telnet:default
disabled       Dec_03   svc:/network/chargen:dgram
disabled       Dec_03   svc:/network/chargen:stream
disabled       Dec_03   svc:/network/rexec:default
disabled       Dec_03   svc:/network/daytime:dgram
disabled       Dec_03   svc:/network/daytime:stream
disabled       Dec_03   svc:/network/comsat:default
disabled       Dec_03   svc:/network/login:eklogin
disabled       Dec_03   svc:/network/login:klogin
disabled       Dec_03   svc:/network/login:rlogin
disabled       Dec_03   svc:/network/talk:default
disabled       Dec_03   svc:/network/tftp/udp6:default
disabled       Dec_03   svc:/network/stdiscover:default
disabled       Dec_03   svc:/application/x11/xfs:default
disabled       Dec_03   svc:/application/x11/xvnc-inetd:default
disabled       15:14:45 svc:/network/ipmon:default
disabled       15:14:45 svc:/network/ipfilter:default
online         Dec_03   svc:/system/early-manifest-import:default
online         Dec_03   svc:/system/svc/restarter:default
online         Dec_03   svc:/network/netcfg:default
online         Dec_03   svc:/network/sctp/congestion-control:highspeed
online         Dec_03   svc:/network/sctp/congestion-control:vegas
online         Dec_03   svc:/network/tcp/congestion-control:highspeed
online         Dec_03   svc:/network/tcp/congestion-control:newreno
online         Dec_03   svc:/network/sctp/congestion-control:newreno
online         Dec_03   svc:/network/tcp/congestion-control:vegas
online         Dec_03   svc:/network/tcp/congestion-control:cubic
online         Dec_03   svc:/network/sctp/congestion-control:cubic
online         Dec_03   svc:/network/smb:default
online         Dec_03   svc:/system/name-service/upgrade:default
online         Dec_03   svc:/system/filesystem/root:default
online         Dec_03   svc:/system/cryptosvc:default
online         Dec_03   svc:/system/resource-controls:default
online         Dec_03   svc:/system/scheduler:default
online         Dec_03   svc:/network/ipsec/ipsecalgs:default
online         Dec_03   svc:/network/ip-interface-management:default
online         Dec_03   svc:/system/boot-archive:default
online         Dec_03   svc:/network/datalink-management:default
online         Dec_03   svc:/network/loopback:default
online         Dec_03   svc:/network/ipmp:default
online         Dec_03   svc:/system/filesystem/usr:default
online         Dec_03   svc:/system/devchassis:cleanstart
online         Dec_03   svc:/system/pfexec:default
online         Dec_03   svc:/system/device/local:default
online         Dec_03   svc:/network/socket-config:default
online         Dec_03   svc:/system/filesystem/minimal:default
online         Dec_03   svc:/system/rbac:default
online         Dec_03   svc:/system/ca-certificates:default
online         Dec_03   svc:/system/sysevent:default
online         Dec_03   svc:/network/uucp-lock-cleanup:default
online         Dec_03   svc:/system/pkgserv:default
online         Dec_03   svc:/system/zones-monitoring:default
online         Dec_03   svc:/system/security/security-extensions:default
online         Dec_03   svc:/application/desktop-cache/mime-types-cache:default
online         Dec_03   svc:/system/vbiosd:default
online         Dec_03   svc:/system/utmp:default
online         Dec_03   svc:/network/ilomconfig-interconnect:default
online         Dec_03   svc:/system/hostid:default
online         Dec_03   svc:/system/logadm-upgrade:default
online         Dec_03   svc:/system/resource-mgmt:default
online         Dec_03   svc:/network/npiv_config:default
online         Dec_03   svc:/system/environment:init
online         Dec_03   svc:/system/devfsadm:default
online         Dec_03   svc:/system/dbus:default
online         Dec_03   svc:/system/rad:local
online         Dec_03   svc:/application/opengl/ogl-select:default
online         Dec_03   svc:/application/desktop-cache/desktop-mime-cache:default
online         Dec_03   svc:/system/rmtmpfiles:default
online         Dec_03   svc:/application/desktop-cache/gconf-cache:default
online         Dec_03   svc:/application/desktop-cache/pixbuf-loaders-installer:default
online         Dec_03   svc:/application/desktop-cache/input-method-cache:default
online         Dec_03   svc:/milestone/unconfig:default
online         Dec_03   svc:/system/postrun:default
online         Dec_03   svc:/system/device/fc-fabric:default
online         Dec_03   svc:/milestone/devices:default
online         Dec_03   svc:/application/desktop-cache/docbook-style-xsl-update:default
online         Dec_03   svc:/milestone/config:default
online         Dec_03   svc:/system/device/audio:default
online         Dec_03   svc:/system/manifest-import:default
online         Dec_03   svc:/system/config-user:default
online         Dec_03   svc:/system/coreadm:default
online         Dec_03   svc:/system/timezone:default
online         Dec_03   svc:/network/physical:upgrade
online         Dec_03   svc:/network/location:upgrade
online         Dec_03   svc:/application/desktop-cache/docbook-style-dsssl-update:default
online         Dec_03   svc:/application/desktop-cache/docbook-dtds-update:default
online         Dec_03   svc:/system/keymap:default
online         Dec_03   svc:/application/font/fc-cache:default
online         Dec_03   svc:/application/desktop-cache/icon-cache:default
online         Dec_03   svc:/network/physical:default
online         Dec_03   svc:/system/identity:node
online         Dec_03   svc:/system/picl:default
online         Dec_03   svc:/system/identity:domain
online         Dec_03   svc:/network/ipsec/policy:default
online         Dec_03   svc:/system/fcoe_initiator:default
online         Dec_03   svc:/network/initial:default
online         Dec_03   svc:/network/nfs/fedfs-client:default
online         Dec_03   svc:/network/netmask:default
online         Dec_03   svc:/milestone/single-user:default
online         Dec_03   svc:/system/filesystem/local:default
online         Dec_03   svc:/system/boot-loader-update:default
online         Dec_03   svc:/system/filesystem/ufs/quota:default
online         Dec_03   svc:/system/power:default
online         Dec_03   svc:/application/virtualbox/vboxmslnk:default
online         Dec_03   svc:/application/virtualbox/vboxservice:default
online         Dec_03   svc:/system/consolekit:default
online         Dec_03   svc:/network/shares:default
online         Dec_03   svc:/system/boot-archive-update:default
online         Dec_03   svc:/system/auditset:default
online         Dec_03   svc:/network/service:default
online         Dec_03   svc:/system/cron:default
online         Dec_03   svc:/network/iscsi/initiator:default
online         Dec_03   svc:/system/hal:default
online         Dec_03   svc:/system/filesystem/rmvolmgr:default
online         Dec_03   svc:/network/rpc/bind:default
online         Dec_03   svc:/network/inetd:default
online         Dec_03   svc:/system/dumpadm:default
online         Dec_03   svc:/network/ssh:default
online         Dec_03   svc:/network/rpc/gss:default
online         Dec_03   svc:/milestone/self-assembly-complete:default
online         Dec_03   svc:/network/rpc/smserver:default
online         Dec_03   svc:/system/system-log:default
online         Dec_03   svc:/network/security/ktkt_warn:default
online         Dec_03   svc:/system/auditd:default
online         Dec_03   svc:/system/console-login:default
online         Dec_03   svc:/system/vtdaemon:default
online         Dec_03   svc:/system/console-login:vt6
online         Dec_03   svc:/system/console-login:vt4
online         Dec_03   svc:/milestone/multi-user:default
online         Dec_03   svc:/application/cups/scheduler:default
online         Dec_03   svc:/system/console-login:vt5
online         Dec_03   svc:/system/fmd:default
online         Dec_03   svc:/system/console-login:vt3
online         Dec_03   svc:/system/console-login:vt2
online         Dec_03   svc:/milestone/multi-user-server:default
online         Dec_03   svc:/system/fm/asr-notify:default
online         Dec_03   svc:/application/man-index:default
online         Dec_03   svc:/system/fm/smtp-notify:default
online         Dec_03   svc:/system/devchassis:daemon
online         Dec_03   svc:/system/boot-config:default
online         Dec_03   svc:/system/intrd:default
online         Dec_03   svc:/application/graphical-login/gdm:default
online         Dec_03   svc:/application/stosreg:default
online         Dec_03   svc:/system/zones-install:default
online         Dec_03   svc:/system/zones:default
online         Dec_03   svc:/network/routing/ndp:default
online         Dec_03   svc:/system/ocm:default
online         Dec_03   svc:/system/console-reset:default
online         Dec_03   svc:/application/texinfo-update:default
online         Dec_07   svc:/application/pkg/update:default
online         15:14:39 svc:/network/routing-setup:default
online         15:14:40 svc:/network/iptun:default
online         15:14:46 svc:/milestone/network:default
online         15:14:51 svc:/system/name-service/switch:default
online         15:14:51 svc:/milestone/name-services:default
online         15:14:51 svc:/network/nfs/mapid:default
online         15:14:52 svc:/network/sendmail-client:default
online         15:14:52 svc:/network/dns/client:default
online         15:14:52 svc:/network/smtp:sendmail
online         15:14:55 svc:/network/location:default
online         15:14:56 svc:/system/name-service/cache:default
online         15:14:56 svc:/system/filesystem/autofs:default

To view the processes associated with a specific service, use the svcs command with the -p switch:

root@solaris:~# svcs -p svc:/system/cron:default
STATE          STIME    FMRI
online         Dec_03   svc:/system/cron:default
               Dec_03        856 cron

To see a detailed output of the properties of a service, use the -l switch:

root@solaris:~# svcs -l svc:/system/cron:default
fmri         svc:/system/cron:default
name         clock daemon (cron)
enabled      true
state        online
next_state   none
state_time   December  3, 2012 01:16:23 PM CET
logfile      /var/svc/log/system-cron:default.log
restarter    svc:/system/svc/restarter:default
contract_id  98 
manifest     /etc/svc/profile/generic.xml
manifest     /lib/svc/manifest/system/cron.xml
dependency   require_all/none svc:/system/filesystem/local (online)
dependency   require_all/none svc:/milestone/name-services (online)

The properties are as follows:

Property Description
fmri The Fault Management Resource Identifier of the service instance
name An abbreviated name for the service
state The current state of the service
next_state When initialising, shows the next state that the service will go to
state_time The service startup time stamp
logfile Full path to the service log file
restarter The service responsible for restarting the current service
contract_id The Process ID of the restarter
manifest The Start and Stop Manifest(s) of the service
dependancy The services dependencies

List the service(s) that cron depends on by using the -d switch:

root@solaris:~# svcs -d svc:/system/cron:default
STATE          STIME    FMRI
online         Dec_03   svc:/system/filesystem/local:default
online         11:36:13 svc:/milestone/name-services:default

Now list the service(s) that depend on cron by using the -D switch:

root@solaris:~# svcs -D svc:/system/cron:default
STATE          STIME    FMRI
online         Dec_03   svc:/milestone/multi-user:default

svcs switches

The available switches for this command are:

root@solaris:~# svcs -?
Usage: svcs [-aHpv] [-o col[,col ... ]] [-R restarter] [-sS col] [<service> ...]
       svcs -d | -D [-Hpv] [-o col[,col ... ]] [-sS col] [<service> ...]
       svcs -l <service> ...
       svcs -x [-v] [<service> ...]
       svcs -?

	-a  list all service instances rather than only those that are enabled
	-d  list dependencies of the specified service(s)
	-D  list dependents of the specified service(s)
	-H  omit header line from output
	-l  list detailed information about the specified service(s)
	-o  list only the specified columns in the output
	-p  list process IDs and names associated with each service
	-R  list only those services with the specified restarter
	-s  sort output in ascending order by the specified column(s)
	-S  sort output in descending order by the specified column(s)
	-v  list verbose information appropriate to the type of output
	-x  explain the status of services that might require maintenance,
	    or explain the status of the specified service(s)

	Services can be specified using an FMRI, abbreviation, or fnmatch(5)
	pattern, as shown in these examples for svc:/network/smtp:sendmail

	svcs [opts] svc:/network/smtp:sendmail
	svcs [opts] network/smtp:sendmail
	svcs [opts] network/*mail
	svcs [opts] network/smtp
	svcs [opts] smtp:sendmail
	svcs [opts] smtp
	svcs [opts] sendmail

	Columns for output or sorting can be specified using these names:

	CTID    contract ID for service (see contract(4))
	DESC    human-readable description of the service
	FMRI    Fault Managed Resource Identifier for service
	INST    portion of the FMRI indicating service instance
	N       abbreviation for next state (if in transition)
	NSTA    abbreviation for next state (if in transition)
	NSTATE  name for next state (if in transition)
	S       abbreviation for current state
	SCOPE   name for scope associated with service
	SN      abbreviation for current state and next state
	SVC     portion of the FMRI representing service name
	STA     abbreviation for current state
	STATE   name for current state
	STIME   time of last state change

Using the svcadm command

The svcadm command uses subcommands. The following shows a full list of subcommands and their switches:

Usage: svcadm [-v] [cmd [args ... ]]

	svcadm enable [-rst] <service> ...	- enable and online service(s)
	svcadm disable [-st] <service> ...	- disable and offline service(s)
	svcadm restart <service> ...		- restart specified service(s)
	svcadm refresh <service> ...		- re-read service configuration
	svcadm mark [-It] <state> <service> ...	- set maintenance state
	svcadm clear <service> ...		- clear maintenance state
	svcadm milestone [-d] <milestone>	- advance to a service milestone
	svcadm delegate [-s] <restarter> <svc> ...	- delegate service to a restarter

	Services can be specified using an FMRI, abbreviation, or fnmatch(5)
	pattern, as shown in these examples for svc:/network/smtp:sendmail

	svcadm <cmd> svc:/network/smtp:sendmail
	svcadm <cmd> network/smtp:sendmail
	svcadm <cmd> network/*mail
	svcadm <cmd> network/smtp
	svcadm <cmd> smtp:sendmail
	svcadm <cmd> smtp
	svcadm <cmd> sendmail

Using the svcadm command, stop the cron service by using the disable subcommand and the -t switch. The -t switch is specified to temporarily stop the service. Should the -t switch not be used, the service will not automatically restart at the next reboot:

root@solaris:~# svcadm disable -t svc:/system/cron:default
root@solaris:~# svcs svc:/system/cron:default
STATE          STIME    FMRI
disabled       12:13:34 svc:/system/cron:default

Now start the service again using the enable subcommand the -r switch to specify that all dependences should also be started:

root@solaris:~# svcadm enable -r svc:/system/cron:default
root@solaris:~# svcs svc:/system/cron:default
STATE          STIME    FMRI
online         12:16:49 svc:/system/cron:default

Using the svcprop command

The svcprop command is used to display the properties of a particular service:

root@solaris:~# svcprop svc:/system/cron:default
general/complete astring 
general/enabled boolean true
general/action_authorization astring solaris.smf.manage.cron
general/entity_stability astring Unstable
general/single_instance boolean true
usr/entities fmri svc:/system/filesystem/local
usr/grouping astring require_all
usr/restart_on astring none
usr/type astring service
ns/entities fmri svc:/milestone/name-services
ns/grouping astring require_all
ns/restart_on astring none
ns/type astring service
manifestfiles/etc_svc_profile_generic_xml astring /etc/svc/profile/generic.xml
manifestfiles/lib_svc_manifest_system_cron_xml astring /lib/svc/manifest/system/cron.xml
dependents/cron_multi-user fmri svc:/milestone/multi-user
startd/ignore_error astring core,signal
start/exec astring /lib/svc/method/svc-cron
start/group astring root
start/timeout_seconds count 60
start/type astring method
start/use_profile boolean false
start/user astring root
stop/exec astring :kill
stop/timeout_seconds count 60
stop/type astring method
refresh/exec astring :kill\ -THAW
refresh/timeout_seconds count 60
refresh/type astring method
tm_common_name/C ustring clock\ daemon\ \(cron\)
tm_man_cron1M/manpath astring /usr/share/man
tm_man_cron1M/section astring 1M
tm_man_cron1M/title astring cron
tm_man_crontab1/manpath astring /usr/share/man
tm_man_crontab1/section astring 1
tm_man_crontab1/title astring crontab
restarter/logfile astring /var/svc/log/system-cron:default.log
restarter/start_pid count 7978
restarter/start_method_timestamp time 1355226207.490539000
restarter/start_method_waitstatus integer 32512
restarter/contract count 
restarter/auxiliary_state astring fault_threshold_reached
restarter/next_state astring none
restarter/state astring maintenance
restarter/state_timestamp time 1355226207.498412000
restarter_actions/auxiliary_tty boolean true
restarter_actions/auxiliary_fmri astring svc:/application/graphical-login/gdm:default
restarter_actions/restart integer 

In order to identify the method associated with a service, you need to use the svcprop command with the -p switch:

root@solaris:~# svcprop -p start/exec system/cron
/lib/svc/method/svc-cron

Maintenance mode

You are now going to break the cron service by renaming the cron Start and Stop method to svc-cron.old:

root@solaris:~# mv /lib/svc/method/svc-cron /lib/svc/method/svc-cron.old

Restart the service using the svcadm command and check the current state of the cron service using the svcs command:

root@solaris:~# svcadm restart cron
root@solaris:~# svcs cron
STATE          STIME    FMRI
maintenance    12:43:27 svc:/system/cron:default

Note that the cron service has now gone into Maintenance mode !

Use the svcs command and the -x switch to explain why the cron service requires maintenance:

root@solaris:~# svcs -x cron
svc:/system/cron:default (clock daemon (cron))
 State: maintenance since December 11, 2012 12:43:27 PM CET
Reason: Start method failed repeatedly, last exited with status 127.
   See: http://support.oracle.com/msg/SMF-8000-KS
   See: cron(1M)
   See: crontab(1)
   See: /var/svc/log/system-cron:default.log
Impact: This service is not running.

Note that in the above output, the system suggests that you should consult a web page at support.oracle.com, consult the cron(1M) and crontab(1) manuals and finally consult the service log file /var/svc/log/system-cron:default.log in order to find out why the service is in Maintenance mode. In actual fact this list should be read bottoms-up.

So before doing anything else, open the service log file:

root@solaris:~# cat /var/svc/log/system-cron:default.log
[ Nov 20 18:25:55 Enabled. ]
[ Nov 20 18:25:55 Rereading configuration. ]
[ Nov 20 18:27:48 Executing start method ("/lib/svc/method/svc-cron"). ]
[ Nov 20 18:27:49 Method "start" exited with status 0. ]
[ Nov 20 22:46:22 Executing start method ("/lib/svc/method/svc-cron"). ]
[ Nov 20 22:46:22 Method "start" exited with status 0. ]
[ Dec  1 14:33:18 Executing start method ("/lib/svc/method/svc-cron"). ]
[ Dec  1 14:33:18 Method "start" exited with status 0. ]
[ Dec  3 13:14:29 Stopping because service disabled. ]
[ Dec  3 13:14:29 Executing stop method (:kill). ]
[ Dec  3 13:16:22 Executing start method ("/lib/svc/method/svc-cron"). ]
[ Dec  3 13:16:23 Method "start" exited with status 0. ]
[ Dec 11 12:13:34 Stopping because service disabled. ]
[ Dec 11 12:13:34 Executing stop method (:kill). ]
[ Dec 11 12:16:49 Enabled. ]
[ Dec 11 12:16:49 Executing start method ("/lib/svc/method/svc-cron"). ]
[ Dec 11 12:16:49 Method "start" exited with status 0. ]
[ Dec 11 12:43:27 Stopping because service restarting. ]
[ Dec 11 12:43:27 Executing stop method (:kill). ]
[ Dec 11 12:43:27 Executing start method ("/lib/svc/method/svc-cron"). ]
/usr/sbin/sh[1]: exec: /lib/svc/method/svc-cron: not found
[ Dec 11 12:43:27 Method "start" exited with status 127. ]
[ Dec 11 12:43:27 Executing start method ("/lib/svc/method/svc-cron"). ]
/usr/sbin/sh[1]: exec: /lib/svc/method/svc-cron: not found
[ Dec 11 12:43:27 Method "start" exited with status 127. ]
[ Dec 11 12:43:27 Executing start method ("/lib/svc/method/svc-cron"). ]
/usr/sbin/sh[1]: exec: /lib/svc/method/svc-cron: not found
[ Dec 11 12:43:27 Method "start" exited with status 127. ]

Look for lines that give you an indication of what is going wrong, such as:

/usr/sbin/sh[1]: exec: /lib/svc/method/svc-cron: not found

Open and examine the /lib/svc/method/svc-cron.old file:

#!/usr/sbin/sh
#
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Start method script for the cron service.
#

. /lib/svc/share/smf_include.sh

if [ -p $SMF_SYSVOL_FS/cronfifo ]; then
	if /usr/bin/pgrep -x -u 0 -z `smf_zonename` cron >/dev/null 2>&1; then
		echo "$0: cron is already running"
		exit $SMF_EXIT_ERR_NOSMF
	fi
fi

if [ -x /usr/sbin/cron ]; then
	/usr/bin/rm -f $SMF_SYSVOL_FS/cronfifo
	/usr/sbin/cron &
else
	exit 1
fi
exit $SMF_EXIT_OK

As you can see, without the method, the cron service cannot be started.

Now you are aware of the root cause of the problem, repair the cron service by renaming /lib/svc/method/svc-cron.old back to /lib/svc/method/svc-cron:

root@solaris:~# mv /lib/svc/method/svc-cron.old /lib/svc/method/svc-cron

Clear the maintenance status of the cron service:

root@solaris:~# svcadm clear cron

and restart the service:

root@solaris:~# svcadm enable -r cron

Finally, check that the cron service has come out of maintenance mode:

root@solaris:~# svcs cron
STATE          STIME    FMRI
online         13:12:56 svc:/system/cron:default

Using the svccfg command

As you now know the svcprop command is used to the SMF repository data, in other words, he properties defined in the generic.xml and service specific manifest files. The svccfg command is used to configure those properties.

The svccfg command can be used to set both global properties for all services by using the -g switch and service specific properties by using the -s switch followed by the <FMRI>.

Set the set-notify property globally so that you are informed by email every time a service goes into maintenance mode:

root@solaris:~# svccfg setnotify -g to-maintenance mailto:infos@fenestros.com

Now set that same property for the cron service so that you are informed by email when that specific service goes offline:

root@solaris:~# svccfg -s cron setnotify to-offline mailto:infos@fenestros.com

The svccfg command can also be used interactively:

root@solaris:~# svccfg
svc:> help
General commands:        help set repository end
Manifest commands:       inventory validate import export
Profile commands:        apply extract
Entity commands:         list select unselect add delete describe
Snapshot commands:       listsnap selectsnap revert
Instance commands:       refresh
Property group commands: listpg addpg delpg
Property commands:       listprop setprop delprop editprop
Customization commands:  listcust delcust
Property value commands: addpropvalue delpropvalue setenv unsetenv
Notification parameters: listnotify setnotify delnotify
svc:> select system/cron
svc:/system/cron> list
:properties
default
svc:/system/cron> select default
svc:/system/cron:default> listprop
general                            framework          
general/complete                  astring    
general/enabled                   boolean     true
restarter                          framework          	NONPERSISTENT
restarter/contract                count       506
restarter/start_pid               count       8008
restarter/start_method_timestamp  time        1355227976.889809000
restarter/start_method_waitstatus integer     0
restarter/logfile                 astring     /var/svc/log/system-cron:default.log
restarter/auxiliary_state         astring     none
restarter/next_state              astring     none
restarter/state                   astring     online
restarter/state_timestamp         time        1355230779.987887000
restarter_actions                  framework          	NONPERSISTENT
restarter_actions/restart         integer    
restarter_actions/maint_off       integer    
restarter_actions/auxiliary_tty   boolean     true
restarter_actions/auxiliary_fmri  astring     svc:/application/graphical-login/gdm:default
restarter_actions/refresh         integer    
general_ovr                        framework          	NONPERSISTENT
svc:/system/cron:default> exit

inetd

Historically under Unix, certain network servers were managed by inetd. The inetd daemon was capable of launching a specific server on an on-demand basis when it detected an incoming connection on the port associated with that server, as detailed in the /etc/services file. The inetd daemon was configured by the /etc/inetd.conf file:

root@solaris:~# cat /etc/inetd.conf
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"%Z%%M%	%I%	%E% SMI"
#
# Legacy configuration file for inetd(1M).  See inetd.conf(4).
#
# This file is no longer directly used to configure inetd.
# The Solaris services which were formerly configured using this file
# are now configured in the Service Management Facility (see smf(5))
# using inetadm(1M).
#
# Any records remaining in this file after installation or upgrade,
# or later created by installing additional software, must be converted
# to smf(5) services and imported into the smf repository using
# inetconv(1M), otherwise the service will not be available.  Once
# a service has been converted using inetconv, further changes made to
# its entry here are not reflected in the service.
#

As you can see, use of this file is now deprecated.

Lines in this file were of the following format:

tftp   dgram   udp6    wait    root    /usr/sbin/in.tftpd      in.tftpd -s /tftpboot

The first field on each line indicated the port associated with the server. Inetd consulted the /etc/services file in order to identify the port number to listen on.

The second and third fields identified the protocol:

  • stream tcp for tcp
  • dgram udp for udp

The fourth field took one of two values:

  • nowait,
    • a server was started for each connecting client,
  • wait,
    • a single unique server was started for all connecting clients.

The fifth field indicated the user executing the server, in this case root.

The sixth field indicated the program to be launched. In this case /usr/sbin/in.tftpd.

The seventh field identified the arguments and switches given to the program. Argument 0 was always the name of the program.

TCP Wrapper

In order to improve security, TCP Wrapper was used to control access to the servers managed by the inetd daemon. Each line in the /etc/inetd.conf configuration file, such as:

tftp   dgram   udp6    wait    root    /usr/sbin/in.tftpd      in.tftpd -s /tftpboot

was replaced by a line of the following format:

tftp   dgram   udp6    wait    root    /usr/sbin/tcpd      in.tftpd -s /tftpboot

Subsequently, when a connection was detected, inetd launch the /usr/sbin/tcpd program as opposed to /usr/sbin/in.tftpd program.

The tcpd daemon then updated its logs and checked whether the client IP, FQDN or domain name was listed in one of the following two files:

  • /etc/hosts.allow
  • /etc/host.deny

The lines in the above two files were of the following format:

daemon : client list

For example in the case of our tftp, if the /etc/hosts.allow contained the following line:

in.tftpd : 192.168.1.10, .fenestros.com

then the client using the 192.168.1.10 IP address or any client whose domain name was fenestros.com could connect to the server.

A special keyword could also be user; ALL. If the /etc/host.deny file contained the line ALL:ALL, the system was hermetically sealed against all connections.

Since the introduction of Solaris 10, the inetd daemon is managed by SMF. By default, TCP Wrappers is disabled:

root@solaris:~# svcprop -p defaults inetd
defaults/bind_addr astring ""
defaults/bind_fail_interval integer -1
defaults/bind_fail_max integer -1
defaults/con_rate_offline integer -1
defaults/connection_backlog integer 10
defaults/failrate_cnt integer 40
defaults/failrate_interval integer 60
defaults/inherit_env boolean true
defaults/max_con_rate integer -1
defaults/max_copies integer -1
defaults/stability astring Evolving
defaults/tcp_keepalive boolean false
defaults/tcp_trace boolean false
defaults/tcp_wrappers boolean false
defaults/value_authorization astring solaris.smf.value.inetd

To activate TCP Wrappers, use the svccfg command as follows:

root@solaris:~# svccfg -s inetd setprop defaults/tcp_wrappers=true

Refresh the inetd service using svcadm and check whether TCP Wrappers is now enabled:

root@solaris:~# svcadm refresh inetd
root@solaris:~# svcprop -p defaults inetd | grep tcp_wrappers
defaults/tcp_wrappers boolean true

The inetadm command is used to list the servers managed by inetd:

root@solaris:~# inetadm
ENABLED   STATE          FMRI
disabled  disabled       svc:/application/cups/in-lpd:default
enabled   online         svc:/network/security/ktkt_warn:default
disabled  disabled       svc:/network/rpc/rusers:default
disabled  disabled       svc:/network/rpc/spray:default
enabled   online         svc:/network/rpc/smserver:default
disabled  disabled       svc:/network/rpc/wall:default
disabled  disabled       svc:/network/rpc/rstat:default
enabled   online         svc:/network/rpc/gss:default
disabled  disabled       svc:/network/rpc/rex:default
disabled  disabled       svc:/network/echo:dgram
disabled  disabled       svc:/network/echo:stream
disabled  disabled       svc:/network/time:dgram
disabled  disabled       svc:/network/time:stream
disabled  disabled       svc:/network/shell:default
disabled  disabled       svc:/network/shell:kshell
disabled  disabled       svc:/network/stlisten:default
disabled  disabled       svc:/network/finger:default
disabled  disabled       svc:/network/discard:dgram
disabled  disabled       svc:/network/discard:stream
disabled  disabled       svc:/network/nfs/rquota:default
disabled  disabled       svc:/network/telnet:default
disabled  disabled       svc:/network/chargen:dgram
disabled  disabled       svc:/network/chargen:stream
disabled  disabled       svc:/network/rexec:default
disabled  disabled       svc:/network/daytime:dgram
disabled  disabled       svc:/network/daytime:stream
disabled  disabled       svc:/network/comsat:default
disabled  disabled       svc:/network/login:eklogin
disabled  disabled       svc:/network/login:klogin
disabled  disabled       svc:/network/login:rlogin
disabled  disabled       svc:/network/talk:default
disabled  disabled       svc:/network/tftp/udp6:default
disabled  disabled       svc:/network/stdiscover:default
disabled  disabled       svc:/application/x11/xfs:default
disabled  disabled       svc:/application/x11/xvnc-inetd:default

Using this same command and the -l switch you can check to see if the tftp server is configured to use TCP Wrappers:

root@solaris:~# inetadm -l /network/tftp/udp6 | grep tcp_wrappers
default  tcp_wrappers=TRUE

To modify this property, you can use the inetadm command with the -m switch:

root@solaris:~# inetadm -m tftp/udp6 tcp_wrappers=FALSE
root@solaris:~# inetadm -l /network/tftp/udp6 | grep tcp_wrappers
         tcp_wrappers=FALSE

Now change the global system default property of TCP Wrappers:

root@solaris:~# inetadm -M tcp_wrappers=TRUE

Note however that the tftp daemon keeps its previously defined value for the same property:

root@solaris:~# inetadm -l /network/tftp/udp6 | grep tcp_wrappers
         tcp_wrappers=FALSE

Change that value back to TRUE:

root@solaris:~# inetadm -m tftp/udp6 tcp_wrappers=TRUE
root@solaris:~# inetadm -l /network/tftp/udp6 | grep tcp_wrappers
         tcp_wrappers=TRUE

Boot Milestone Services

Before you start experimenting with milestones, write down the following command:

svcadm milestone all

You will now put your system into single-user mode by using the following command:

root@solaris:~# svcadm milestone svc:/milestone/single-user

When you are in single-user mode, use the command you just wrote down to get back here.

The shutdown command

The shutdown command is used to either halt, reboot or change the state of the system. The command takes has following syntax:

shutdown [-y] [-g seconds] [-r | -i state] [message]

The switches are as follows :

Switch Description
-y The command is non-interactive
-g seconds Grace period in seconds. The default value is 60.
-i state Destination state. The default value is S.
-r Equivalent to -i6

Before starting to shutdown, the system sends out a standard message:

The system will be shut down in …

This message is sent out 7200, 3600, 1800, 1200, 600, 300, 120, 60 and 30 seconds before shutdown begins.

The system message can also be complemented by an administrator defined message, [message]. If the message is longer than one word it must be enclosed in single (') or double (“) quotation marks.

The switch -i can take one of 5 states:

State Description
0 System halt
1 Administrative state
s or S Single User state
5 System halt and Powerdown
6 System reboot

Use the following command to shutdown your system:

root@solaris:~# shutdown -y -g360 -i0

Shutdown started.    Wednesday, December 12, 2012 11:56:53 AM CET

Broadcast Message from root (pts/1) on solaris.fenestros.loc Wed Dec 12 11:56:53...
The system solaris.fenestros.loc will be shut down in 6 minutes 

showmount: solaris.fenestros.loc: RPC: Program not registered

Open another terminal and use the follwing command to identify the PID of the shutdown process:

root@solaris:~# ps -ef | grep shutdown
    root  2462  1914   0 11:56:53 pts/1       0:00 /usr/sbin/sh /usr/sbin/shutdown -y -g360 -i0

Now kill the shutdown process:

root@solaris:~# kill -9 2462

References


<html>

Copyright © 2011-2015 Hugh Norris.<br><br> <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/”><img alt=“Creative Commons License” style=“border-width:0” src=“http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png” /></a><br />This work is licensed under a <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/”>Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.

</html>

Menu