You are on page 1of 13

svcs - report service status

The svcs command displays


information about service instances
as recorded in the service
configuration repository.
#svcs -a

list all service instances rather


than only those that are enabled
#svcs -d

-d=Lists the services or service instances upon which the


service instance depend.
-bash-3.00# svcs -d svc:/milestone/name-services:default
STATE STIME FMRI
disabled 13:52:02 svc:/network/dns/client:default
disabled 13:52:02 svc:/network/nis/client:default
disabled 13:52:02 svc:/network/rpc/nisplus:default
disabled 13:52:02 svc:/network/ldap/client:default
#svcs -D

-D=lists service or service instances that depend on the given service


instance.
-bash-3.00# svcs -D svc:/milestone/name-services:default
STATE STIME FMRI
disabled 13:52:02 svc:/system/auditd:default
disabled 13:52:02 svc:/network/rpc/bootparams:default
online 13:52:12 svc:/system/cron:default
online 13:52:13 svc:/application/opengl/ogl-select:default
online 13:52:25 svc:/system/filesystem/autofs:default
online 13:52:27 svc:/network/inetd:default
online 13:52:27 svc:/system/system-log:default
online 13:52:27 svc:/network/smtp:sendmail
online 13:52:29 svc:/milestone/multi-user:default
online 13:52:39 svc:/network/apocd/udp:default
offline 13:52:02 svc:/network/nfs/cbd:default
offline 13:52:02 svc:/network/nfs/mapid:default
offline 13:52:02 svc:/network/nfs/client:default
offline 13:52:02 svc:/application/management/seaport:default
offline 13:52:03 svc:/application/management/sma:default
offline 13:52:05 svc:/system/webconsole:console
#svcs -l

Displays all available information about the selected services and service
instances, with one service attribute displayed for each line.
Information for different instances are separated by blank lines.

-bash-3.00# svcs -l svc:/milestone/name-services:default


fmri svc:/milestone/name-services:default
name name services milestone
enabled true
state online
next_state none
state_time Mon Nov 08 13:52:03 2010
alt_logfile /etc/svc/volatile/milestone-name-services:default.log
restarter svc:/system/svc/restarter:default
dependency optional_all/none svc:/network/dns/client (disabled)
dependency optional_all/none svc:/network/ldap/client (disabled)
dependency optional_all/none svc:/network/nis/client (disabled)
dependency optional_all/none svc:/network/rpc/nisplus (disabled)
#svcs -l

Dependency - Information about a dependency. The grouping and


restart_on properties are displayed first and are separated by a forward
slash (/). Next, each entity and its state is listed. See smf(5) for
information about states. In addition to the standard states, each service
dependency can have the following state descriptions :

absent = no such service is defined on the system.

invalid = the FMRI(Fault Management Resource Identifier) is invalid.

Multiple= the entity is service with multiple instances.


contd...
File dependencies can only have one of the following state descriptions:

absent=No such file on the system.


online = file exists

If the file did not exist the last time that /lib/svc/bin/svc.startd evaluated the
service's dependencies, it can consider the dependency to be unsatisfied.
#svcadm refresh <service_name>
forces dependency reevaluation.

Enabled = whether service is enabled or not or temporarily disabled(until next


system boot).

A service may be temporarily disabled by sys' admins'


#svcadm disable -t or used a milestone or booted to a specific milestone.
#svcs -o col[,col] - Prints the specified columns.
Column

FMRI - A fault management resource identifier(FMRI) that specifies one or instances.


Example:svc:/network/smtp:sendmail
FMRIs can be abbreviated by specifying the instance name, or the trailing portion of the service name
ex: #svcs sendmail

CTID - The primary contract ID for the service instance. Not all instances have valid primary contract
Ids.

DESC - A brief description of the service, from its template element. if description not available then it
has a hyphen(-) in the field.

INST - The instance name of the service instance.

NSTATE - The next state of the service. A hyphen is used to denote that the instance is not
transitioning.

SCOPE The scope name of the service instance.

SVC The service name of the service instance.


STA The abbreviated state of the service instance
DGD - degraded

DIS - disabled

LRC - legacy rc*.d script-initiated instance

MNT - maintenance

OFF - offline

ON - online

UN - uninitialized

? - absent or unrecognised

* - instance in transition

STATE The state of the service instance

STIME If the service instance entered the current state within the last 24 hours, this
column indicates the time that it did so or else date on which it entered the state.
#svcs -p > Lists processes associated with each service instance.

-bash-3.00# svcs -p sendmail


STATE STIME FMRI
online 8:55:33 svc:/network/smtp:sendmail
8:55:40 651 sendmail
8:55:40 652 sendmail
-bash-3.00# svcs -s STIME -s FMRI
The default output is
1.example% svcs
STATE STIME FMRI
...
legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript

This example lists all local instances of the service1 service


2.example% svcs -o state,nstate,fmri service1
STATE NSTATE FMRI
online - svc:/service1:instance1
disabled - svc:/service1:instance2

3.example% svcs -v network/rpc/rstat:udp


STATE NSTATE STIME CTID FMRI
online - Aug_09 - svc:/network/rpc/rstat:udp
4.Listing detailed information
-bash-3.00# svcs -l sendmail
fmri svc:/network/smtp:sendmail
name sendmail SMTP mail transfer agent
enabled true
state online
next_state none
state_time Wed Nov 10 08:55:33 2010
logfile /var/svc/log/network-smtp:sendmail.log
restarter svc:/system/svc/restarter:default
contract_id 60
dependency require_all/refresh file://localhost/etc/mail/sendmail.cf (online)
...
Restarters

Each service is managed by a restarter. The master restarter,


svc.startd(1M) manages states for the entire set of service instances and
their dependencies. The master restarter acts on behalf of its services and
on delegated restarters that can provide specific execution environments for
certain application classes. For instance, inetd(1M) is a delegated restarter
that provides its service instances with an initial environment composed of a
network connection as input and output file descriptors. Each instance
delegated to inetd(1M) is in the online state. While the daemon of a
particular instance might not be running, the instance is available to run.
As dependencies are satisfied when instances move to the online
state, svc.startd(1M) invokes start methods of other instances or directs the
delegated restarter to do so. These operations might overlap.

You might also like