• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
Service Management Facility

The Service Management Facility was introduced in Solaris 9 as an alternative way to manage services. In Solaris 10, SMF has been made the default way to manage most services. The SMF framework has significant advantages over the legacy SVR4 mechanisms, primarily in terms of service monitoring and integration with the Fault Management Facility.

Basic Commands

The basic commands for managing services under SMF (Service Management Facility) control aresvcs,svccfg andsvcadm. The man pages for these commands are a good source of detailed information.

inetadm can be used to monitor services underinetd control.
Many commands require referencing the service identifier, also known as anFMRI.
svcs\u2022
svcs -a: Lists all services currently installed, including their state.
\u2022
svcs -dFMRI: Lists dependencies for FMRI.
\u2022
svcs -DFMRI: Lists dependents for FMRI.
\u2022
svcs -lFMRI: Provides a long listing of information about FMRI; includes dependency
information
\u2022
svcs -pFMRI: Shows relationships between services and processes.
\u2022
svcs -t: This change is temporary (does not persist past a boot).
\u2022
svcs -x: Explains why a service is not available.
\u2022
svcs -xv: Verbose debugging information.
svcadm
\u2022
svcadm clearFMRI: Clear faults for FMRI.
\u2022
svcadm disableFMRI: Disable FMRI.
\u2022
svcadm enableFMRI: Enable FMRI.
\u2022
svcadm refreshFMRI: Force FMRI to read config file.
\u2022
svcadm restartFMRI: Restart FMRI.
To make configuration changes to a non-inetd service, edit the configuration file, then enter the
svcadm restartco mmand.
svccfg
\u2022
svccfg: Enter interactive mode.
\u2022
svccfg -sFMRI setenvENV_VARIABLE value: Set an environment variable for
FMRI. Follow by svcadm refresh and restart commands.
inetadm
\u2022
inetadm -lFMRI: Displays properties for FMRI.
\u2022
inetadm -mFMRI property_name=value: Set a property for FMRI.

In particular, the "exec" value for an inetd-controlled service is the command line executed for
that service by SMF. It may be desirable, for example, to change this value to add logging or
other command-line flags.

To convert an inetd.conf file to SMF format, run the command:
inetconv -i /etc/inet/inetd.conf
Service Identifiers
Services are identified by their FMRI. (This stands for Fault Managed Resource Identifier.) An
example is:
svc:/system/system-log:default
Some commands do not require the full FMRI if there is no ambiguity.
Legacy init scripts have FMRIs starting with lrc. For example:
lrc:/etc/rcS_d/S35cacheos_sh
Converted inetd services have a syntax like one of the following, depending on whether or not
they are rpc services:
svc:network/service-name/protocol svc:network/rpc-service-name/rpc_protocol
SMF Service Starts
Thesvc.startd daemon is the master process starter and restarter for SMF. It tracks service
state and manages dependencies.
Services that are managed through init scripts can be added to SMF via theinetconv command.
Such additions are only monitored for status, but other SMF facilities may not work.
Maintenance
If a service is in the maintenance state, first make sure that all associated processes have died:
svcs -pFMRI
Next, (for all processes displayed by the above):
pkill -9PID

Consult the appropriate logs in/var/svc/log to check any errors; perform any needed
maintenance.
Restore the service:

svcadm clearFMRI
Scripts
The scripts that implement the startups and shutdowns are located in their usual place in
/etc/init.d for the lrc services, or in /lib/svc/method for most of the other services.
Other locations may be specified for a particular service. To track down the script locations for a
particular service, do something like the following:

# svccfg -s smtp
svc:/network/smtp> list
:properties
sendmail
svc:/network/smtp> select sendmail
svc:/network/smtp:sendmail> list
:properties
svc:/network/smtp:sendmail> listprop *exec
start/exec astring "/lib/svc/method/smtp-sendmail start"
stop/exec astring "/lib/svc/method/smtp-sendmail stop %{restarter/contract}"
refresh/exec astring "/lib/svc/method/smtp-sendmail refresh"

Boot Messages
Boot messages are much less verbose than previously. To get verbose output, boot with the
boot -v
or
boot -m verbose
commands.
svcadm can be used to change the run levels. The FMRIs associated with the different run levels
are:\u2022
S: milestone/single-user:default
\u2022
2: milestone/multi-user:default
\u2022
3: milestone/multi-user-server:default
Run levels can be displayed with
who -r
SMF Profiles
SMF profiles are XML files in/var/svc/profile which list sets of service instances which are
enabled and disabled.
Different SMF profiles can be used. They are stored in/var/svc/profile. To use a different
one, perform the following procedure:
svccfg apply /var/svc/profile/desired_profile.xml
The local profile/var/svc/profile/site.xml allows local customizations. This profile is
applied after the standard profiles.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...