Links

   Quran Explorer - Interactive Audio Recitations & Translations

Wednesday, September 1, 2010

Solaris - Service Management Primer

SMF Commands

SMF has a limited yet powerful set of commands. Each command has several options which cover the tasks required to manage Solaris systems. The following table lists the SMF commands.

Command
Description
svcs
Reports service status
svcadm
Used for service management: e.g., starting, stopping and restoring services
svccfg
Used to list properties of a service
svcprop
Used to list properties of a service
inetadm
Used to manage inetd services


Table 1—SMF commands


This guide focuses on gathering information about the services running on a Solaris system and troubleshooting a failed service. These tasks are accomplished with the svcs and svcadm commands.
The other commands enable system administrators to manage, modify, and display service manifests. You can read more about them on docs.sun.com under the Solaris 10 Basic Administration Guide.




An Example
This example begins by looking at all the services currently running on your Solaris system and then examining a few of the services for more details. These details include the services upon which they depend and the services which depend upon them.
Displaying System Services Information

To display all services on your Solaris system with their state information, use the svcs command along with the -a option:
my-system# svcs -a

STATE STIME FMRI
legacy_run Apr_18 lrc:/etc/rcS_d/S51installupdates
legacy_run Apr_18 lrc:/etc/rc2_d/S47pppd
legacy_run Apr_18 lrc:/etc/rc2_d/S99audit
legacy_run Apr_18 lrc:/etc/rc3_d/S76snmpdx
legacy_run Apr_18 lrc:/etc/rc3_d/S90samba
disabled Apr_18 svc:/network/ipfilter:default
disabled Apr_18 svc:/network/rpc/keyserv:default
disabled Apr_18 svc:/network/rpc/nisplus:default
disabled Apr_18 svc:/application/print/server:default
disabled Apr_18 svc:/network/dhcp-server:default
disabled Apr_18 svc:/network/http:apache2
online Apr_18 svc:/system/svc/restarter:default
online Apr_18 svc:/network/pfil:default
online Apr_18 svc:/network/physical:default
online Apr_18 svc:/system/identity:domain
online Apr_18 svc:/system/cryptosvc:default
online Apr_18 svc:/network/inetd:default
online Apr_18 svc:/network/telnet:default
online Apr_18 svc:/network/ssh:default
online Apr_18 svc:/system/zones:default
online Apr_18 svc:/network/nfs/nlockmgr:default
offline Apr_18 svc:/application/print/ipp-listener:default
offline Apr_18 svc:/application/print/rfc1179:default
[Note: This is a truncated list] Displaying Individual Services

You can look at individual services as well. This is especially useful during troubleshooting or when examining what is going on with a particular service.
To display information about the inetd service, use the svcs command specifying the service by name:

my-system# svcs inetd
STATE STIME FMRI
online Apr_18 svc:/network/inetd:default
To display information about the Samba service, use the svcs command specifying the service by name:

my-system# svcs S90samba
STATE STIME FMRI
legacy_run Apr_18 lrc:/etc/rc3_d/S90samba
To display information about the Apache service, use the svcs command specifying the service by name:

my-system# svcs apache2
STATE STIME FMRI
disabled Apr_18 svc:/network/http:apache2 Retrieving Dependency Tree Information

SMF permits you to identify all the service dependencies for a given service. That is, the services upon which a given service depends, as well as the services that depend upon that service. The following options are used to provide additional detail on the services.

Option
Description
-a
Displays all services, including those which have been disabled
-d
Lists a service's dependencies
-D
Lists a service's dependents
-l
Displays all available information about the service
-p
Lists all processes (PID) associated with a service

No comments:

Post a Comment

Feel free to leave a comment