JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Managing Services and Faults in Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Managing Services (Overview)

2.  Managing Services (Tasks)

Monitoring SMF Services

Monitoring Services (Task Map)

How to List the Status of a Service

How to List Customizations of a Service

How to Show Which Services Are Dependent on a Service Instance

How to Show Which Services a Service Is Dependent On

How to Set Up Notification of SMF Transition Events

Managing SMF Services

Managing SMF Services (Task Map)

Using RBAC Rights Profiles With SMF

How to Create an SMF Service

How to Disable a Service Instance

How to Enable a Service Instance

How to Restart a Service

How to Restore a Service That Is in the Maintenance State

How to Create an SMF Profile

How to Manually Create an SMF Profile

How to Apply an SMF Profile

Configuring SMF Services

Configuring SMF Services (Task Map)

How to Modify an SMF Service Property

How to Modify Multiple Properties for One Service

How to Modify a Service That Is Configured by a File

How to Change an Environment Variable for a Service

How to Change a Property for an inetd Controlled Service

How to Delete Customizations for a Service

How to Modify a Command-Line Argument for an inetd Controlled Service

How to Convert inetd.conf Entries

Using Run Control Scripts

Using Run Control Scripts (Task Map)

How to Use a Run Control Script to Stop or Start a Legacy Service

How to Add a Run Control Script

How to Disable a Run Control Script

How to Convert a Run Control Script to an SMF Service

Troubleshooting the Service Management Facility

Troubleshooting SMF (Task Map)

How to Debug a Service That Is Not Starting

How to Repair a Corrupt Repository

How to Boot Without Starting Any Services

How to Boot in Verbose Mode

How to Force an sulogin Prompt If the system/filesystem/local:default Service Fails During Boot

3.  Using the Fault Manager

Index

Monitoring SMF Services

The following tasks show how to monitor SMF services.

Monitoring Services (Task Map)

The following task map describes the procedures that are needed to monitor SMF services.

Task
Description
For Instructions
Display the status of a service instance.
Displays the status of all running service instances.
Display the customizations to a service.
Displays the customizations in the admin layer for the service.
Display the service dependents.
Display the services that are dependent on the specified service.
Display the dependencies of a service.
Display the services that a specified service is dependent on. This information can be used to help identify what is preventing a service from starting.
Configure notification for significant events.
Uses SNMP or SMTP to send a notification of a change in service state or of an FMA event.

How to List the Status of a Service

This procedure can be used to show what services are running.

Example 2-1 Showing the Status of the sendmail Service

This example shows the status of a service that includes dependencies. Also, the -p option is used so that information about the process ID, start time and command run is displayed

$ svcs -lp network/smtp:sendmail
fmri         svc:/network/smtp:sendmail
name         sendmail SMTP mail transfer agent
enabled      true
state        online
next_state   none
state_time   Tue Aug 09 19:25:54 2011
logfile      /var/svc/log/network-smtp:sendmail.log
restarter    svc:/system/svc/restarter:default
contract_id  114
manifest     /etc/svc/profile/generic_limited_net.xml
manifest     /lib/svc/manifest/network/smtp-sendmail.xml
dependency   require_all/refresh file://localhost/etc/mail/sendmail.cf (online)
dependency   require_all/refresh file://localhost/etc/nsswitch.conf (online)
dependency   optional_all/none svc:/system/filesystem/autofs (online)
dependency   require_all/none svc:/system/filesystem/local (online)
dependency   require_all/none svc:/network/service (online)
dependency   require_all/refresh svc:/milestone/name-services (online)
dependency   optional_all/refresh svc:/system/identity:domain (online)
dependency   optional_all/none svc:/system/system-log (online)
process      101077 /usr/lib/sendmail -bd -q15m

Example 2-2 Showing the Status of all Services

The following command lists all services that are installed on the system as well as the status of each service. The command displays those services that are disabled as well as those that are enabled.

$ svcs -a

Example 2-3 Showing all Notification Parameters

The following command lists all of the FMA events notification parameters and the SMF state transition parameters.

$ svcs -n

Example 2-4 Showing the Status of Services Controlled by inetd

The following command lists services that are controlled by inetd. Each service's FMRI is listed, along with the run state and whether the service is enabled or disabled.

$ inetadm

How to List Customizations of a Service

How to Show Which Services Are Dependent on a Service Instance

This procedure shows how to determine which service instances depend on the specified service.

Example 2-5 Displaying the Service Instances That Are Dependent on the multiuser Milestone

The following example shows how to determine which service instances are dependent on the multiuser milestone.

$ svcs -D milestone/multi-user
STATE          STIME    FMRI
disabled       Aug_09   svc:/application/time-slider:default
disabled       Aug_09   svc:/application/management/net-snmp:default
online         Aug_09   svc:/system/intrd:default
online         Aug_09   svc:/system/boot-config:default
online         Aug_09   svc:/milestone/multi-user-server:default

How to Show Which Services a Service Is Dependent On

This procedure shows how to determine which services a specified service instance is dependent on.

Example 2-6 Displaying the Service Instances That the multiuser Milestone Is Dependent On

The following example shows the services instances that the multiuser milestone is dependent on:

$ svcs -d milestone/multi-user:default
STATE          STIME    FMRI
disabled       Aug_09   svc:/network/nfs/client:default
disabled       Aug_09   svc:/network/smb/client:default
disabled       Aug_09   svc:/system/mdmonitor:default
disabled       Aug_09   svc:/application/print/server:default
online         Aug_09   svc:/system/resource-controls:default
online         Aug_09   svc:/system/metasync:default
online         Aug_09   svc:/system/rmtmpfiles:default
online         Aug_09   svc:/system/utmp:default
online         Aug_09   svc:/system/name-service/cache:default
online         Aug_09   svc:/system/device/audio:default
online         Aug_09   svc:/network/rpc/bind:default
online         Aug_09   svc:/milestone/name-services:default
online         Aug_09   svc:/network/iscsi/initiator:default
online         Aug_09   svc:/milestone/single-user:default
online         Aug_09   svc:/system/filesystem/local:default
online         Aug_09   svc:/network/inetd:default
online         Aug_09   svc:/system/cron:default
online         Aug_09   svc:/system/filesystem/autofs:default
online         Aug_09   svc:/system/filesystem/ufs/quota:default
online         Aug_09   svc:/system/power:default
online         Aug_09   svc:/system/system-log:default
online         Aug_09   svc:/system/system-log:default
online         Aug_09   svc:/system/auditd:default
online         Aug_09   svc:/network/smtp:sendmail

How to Set Up Notification of SMF Transition Events

This procedure causes the system to generate an email notification each time one of the services or a selected service has a change in state. You can choose to use either SMTP or SNMP. Normally, you would only select SNMP if you already have SNMP configured for some other reason.

By default, SNMP traps are sent on maintenance transitions. If you use SNMP for monitoring, you can configure additional traps for other state transitions.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Set notification parameters.

    The following examples show how to set notification parameters for SMF and FMA events, as well as how to list and delete notification parameters.

Example 2-7 Configuring Notifications for All SMF Service State Events

The following command creates a notification that sends email when services go into the maintenance state.

# /usr/sbin/svccfg setnotify -g maintenance mailto:sysadmins@example.com

You can also choose to select services that start in the state listed with the from option and end in the state listed with the to option. The valid SMF states for this option are: degraded, maintenance, offline, and online. You can use the -g all option to generate email for all state transition events. See the Notification Parameters section in the smf(5) man page for more information.

Example 2-8 Configuring Notifications for an Individual Service

The following command creates a notification that sends email when the switch service goes into the online state.

# /usr/sbin/svccfg -s svc:/system/name-service/switch:default setnotify to-online \
      mailto: sysadmins@example.com

Example 2-9 Configuring Notifications for FMA Events

The following command creates a notification that sends an SNMP message when a FMA problem is repaired.

# /usr/sbin/svccfg setnotify problem-repaired snmp: 

The FMA event classes include problem-diagnosed, problem-updated, problem-repaired and problem-resolved. See the Notification Parameters section in the smf(5) man page for more information.

Example 2-10 Listing Notification Settings

The following command shows the notification settings for a new problem diagnosed by the FMA service. Notification settings for SMF service state transition events can be displayed by including the service state instead of the event class or by not including any arguments with listnotify.

# /usr/sbin/svccfg listnotify problem-diagnosed

Example 2-11 Deleting Notification Settings

The following command deletes the notification settings associated with the switch service transitioning to the online service state. You can use an FMA event class in place of the service state.

# /usr/sbin/svccfg -s svc:/system/name-service/switch:default delnotify to-online