'\" te .\" Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. .TH svcs 1 "02 Jun 2015" "SunOS 5.11" "User Commands" .SH NAME svcs \- report service status .SH SYNOPSIS .LP .nf \fBsvcs\fR [\fB-aHpv?\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-R\fR \fIFMRI-instance\fR]... [\fB-sS\fR \fIcol\fR]... [\fIFMRI\fR | \fIpattern\fR]... .fi .LP .nf \fBsvcs\fR {\fB-d\fR | \fB-D\fR} [\fB-Hpv?\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-sS\fR \fIcol\fR]... [\fIFMRI\fR | \fIpattern\fR] ... .fi .LP .nf \fBsvcs\fR \fB-n\fR [\fIFMRI\fR] ... .fi .LP .nf \fBsvcs\fR \fB-l\fR [\fB-v\fR] [\fIFMRI\fR | \fIpattern\fR]... .fi .LP .nf \fBsvcs\fR \fB-L\fR [\fB-v\fR] [\fIFMRI\fR]... .fi .LP .nf \fBsvcs\fR \fB-x\fR [\fB-v\fR] [\fB-L\fR] [\fIFMRI\fR]... .fi .SH DESCRIPTION .sp .LP The \fBsvcs\fR command displays information about service instances as recorded in the service configuration repository. .sp .LP The first form of this command prints one-line status listings for service instances specified by the arguments. Each instance is listed only once. With no arguments, all enabled service instances, even if temporarily disabled, are listed with the columns indicated below. .sp .LP The second form prints one-line status listings for the dependencies or dependents of the service instances specified by the arguments. .sp .LP The third form prints detailed information about specific services and instances. .sp .LP The fourth form explains the states of service instances. For each argument, a block of human-readable text is displayed which explains what state the service is in, and why it is in that state. With no arguments, problematic services are described. .sp .LP Error messages are printed to the standard error stream. .sp .LP The output of this command can be used appropriately as input to the \fBsvcadm\fR(1M) command. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-?\fR\fR .ad .sp .6 .RS 4n Displays an extended usage message, including column specifiers. .RE .sp .ne 2 .mk .na \fB\fB-a\fR\fR .ad .sp .6 .RS 4n Show all services, even disabled ones and incomplete ones. Incomplete services can be further explained using \fBsvcs \(emx\fR\fI\fR\&. .sp This option has no effect if services are selected. .RE .sp .ne 2 .mk .na \fB\fB-d\fR\fR .ad .sp .6 .RS 4n Lists the services or service instances upon which the given service instances depend. .RE .sp .ne 2 .mk .na \fB\fB-D\fR\fR .ad .sp .6 .RS 4n Lists the service instances that depend on the given services or service instances. .RE .sp .ne 2 .mk .na \fB\fB-H\fR\fR .ad .sp .6 .RS 4n Omits the column headers. .RE .sp .ne 2 .mk .na \fB\fB-l\fR\fR .ad .sp .6 .RS 4n (The letter ell.) 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. .sp The following specific attributes require further explanation: .sp .ne 2 .mk .na \fB\fBdependency\fR\fR .ad .sp .6 .RS 4n Information about a dependency. The grouping and \fBrestart_on\fR properties are displayed first and are separated by a forward slash (\fB/\fR). Next, each entity and its state is listed. See \fBsmf\fR(5) for information about states. In addition to the standard states, each service dependency can have the following state descriptions: .sp .ne 2 .mk .na \fB\fBabsent\fR\fR .ad .sp .6 .RS 4n No such service is defined on the system. .RE .sp .ne 2 .mk .na \fB\fBinvalid\fR\fR .ad .sp .6 .RS 4n The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)). .RE .sp .ne 2 .mk .na \fB\fBmultiple\fR\fR .ad .sp .6 .RS 4n The entity is a service with multiple instances. .RE File dependencies can only have one of the following state descriptions: .sp .ne 2 .mk .na \fB\fBabsent\fR\fR .ad .sp .6 .RS 4n No such file on the system. .RE .sp .ne 2 .mk .na \fB\fBonline\fR\fR .ad .sp .6 .RS 4n The file exists. .sp If the file did not exist the last time that \fBsvc.startd\fR evaluated the service's dependencies, it can consider the dependency to be unsatisfied. \fBsvcadm refresh\fR forces dependency re-evaluation. .RE .sp .ne 2 .mk .na \fB\fBunknown\fR\fR .ad .sp .6 .RS 4n \fBstat\fR(2) failed for a reason other than \fBENOENT\fR. .RE See \fBsmf\fR(5) for additional details about dependencies, grouping, and \fBrestart_on\fR values. .RE .sp .ne 2 .mk .na \fB\fBenabled\fR\fR .ad .sp .6 .RS 4n Whether the service is enabled or not, and whether it is enabled or disabled temporarily (until the next system reboot). The former is specified as either \fBtrue\fR or \fBfalse\fR, and the latter is designated by the presence of \fB(temporary)\fR. .sp A service might be temporarily disabled because an administrator has run \fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a specific milestone. See \fBsvcadm\fR(1M) for details. .RE .RE .sp .ne 2 .mk .na \fB\fB-L\fR\fR .ad .sp .6 .RS 4n Prints the path to the logfile created by the service restarter of the selected service instances. .sp With \fB-x\fR, either print the logfile beginning after the last occurrence of log message for a method exit without errors or the last 10 lines of the logfile based on which is smaller at the end of the explanation for that service instance. If a log message for method exit without errors is present in the last line of the logfile, print the last 5 lines of the logfile. .sp With \fB-v\fR and if only a single service instance match the input, it will print the content of logfile. If multiple service instances match the input, print the last 10 lines of the logfile for each service instance. .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .sp .6 .RS 4n Prints notification parameters. See \fBsmf\fR(5). It always prints the FMA events notification parameters and the system-wide SMF state transition notification parameters, regardless of the FMRI or pattern selected. .RE .sp .ne 2 .mk .na \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR .ad .sp .6 .RS 4n Prints the specified columns. Each \fIcol\fR should be a column name. See \fBCOLUMNS\fR below for available columns. .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .sp .6 .RS 4n Lists processes associated with each service instance. A service instance can have no associated processes. The process ID, start time, and command name (\fBPID\fR, \fBSTIME\fR, and \fBCMD\fR fields from \fBps\fR(1)) are displayed for each process. .RE .sp .ne 2 .mk .na \fB\fB-R\fR \fIFMRI-instance\fR\fR .ad .sp .6 .RS 4n Selects service instances that have the given service instance as their restarter. .RE .sp .ne 2 .mk .na \fB\fB-s\fR \fIcol\fR\fR .ad .sp .6 .RS 4n Sorts output by column. \fIcol\fR should be a column name. See \fBCOLUMNS\fR below for available columns. Multiple \fB-s\fR options behave additively. .RE .sp .ne 2 .mk .na \fB\fB-S\fR \fIcol\fR\fR .ad .sp .6 .RS 4n Sorts by \fIcol\fR in the opposite order as option \fB-s\fR. .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .sp .6 .RS 4n Without \fB-x\fR or \fB-l\fR, displays verbose columns: \fBSTATE\fR, \fBNSTATE\fR, \fBSTIME\fR, \fBCTID\fR, and \fBFMRI\fR. .sp With \fB-x\fR, displays extra information for each explanation. .sp With \fB-l\fR, displays user-visible properties in property groups of type \fBapplication\fR and their description. .RE .sp .ne 2 .mk .na \fB\fB-x\fR\fR .ad .sp .6 .RS 4n Displays explanations for service states. .sp Without arguments, the \fB-x\fR option explains the states of services which: .RS +4 .TP .ie t \(bu .el o are enabled, but are not running. .RE .RS +4 .TP .ie t \(bu .el o are preventing another enabled service from running. .RE .RE .SH OPERANDS .sp .LP The following operands are supported: .sp .ne 2 .mk .na \fB\fIFMRI\fR\fR .ad .sp .6 .RS 4n A fault management resource identifier (FMRI) that specifies one or more instances (see \fBsmf\fR(5)). FMRIs can be abbreviated by specifying the instance name, or the trailing portion of the service name. For example, given the FMRI: .sp .in +2 .nf svc:/network/smtp:sendmail .fi .in -2 .sp The following are valid abbreviations: .sp .in +2 .nf sendmail :sendmail smtp smtp:sendmail network/smtp .fi .in -2 .sp The following are invalid abbreviations: .sp .in +2 .nf mail network network/smt .fi .in -2 .sp If the FMRI specifies a service, then the command applies to all instances of that service, except when used with the \fB-D\fR option. .sp Abbreviated forms of FMRIs are unstable, and should not be used in scripts or other permanent tools. .RE .sp .ne 2 .mk .na \fB\fIpattern\fR\fR .ad .sp .6 .RS 4n A pattern that is matched against the \fIFMRI\fRs of service instances according to the globbing rules described by \fBfnmatch\fR(5). If the pattern does not begin with \fBsvc:\fR, then \fBsvc:/\fR is prepended. The following is a typical example of a glob pattern: .sp .in +2 .nf qexample% svcs \e*keyserv\e* STATE STIME FMRI disabled Aug_02 svc:/network/rpc/keyserv:default .fi .in -2 .sp .RE .sp .ne 2 .mk .na \fB\fIFMRI-instance\fR\fR .ad .sp .6 .RS 4n An FMRI that specifies an instance. .RE .SH COLUMNS .sp .LP Column names are case insensitive. The default output format is equivalent to "\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR, \fBSTIME\fR, \fBFMRI\fR. .sp .ne 2 .mk .na \fB\fBCTID\fR\fR .ad .sp .6 .RS 4n The primary contract ID for the service instance. Not all instances have valid primary contract IDs. .RE .sp .ne 2 .mk .na \fB\fBDESC\fR\fR .ad .sp .6 .RS 4n A brief description of the service, from its template element. A service might not have a description available, in which case a hyphen (\fB\(hy\fR) is used to denote an empty value. .RE .sp .ne 2 .mk .na \fB\fBFMRI\fR\fR .ad .sp .6 .RS 4n The \fIFMRI\fR of the service instance. .RE .sp .ne 2 .mk .na \fB\fBINST\fR\fR .ad .sp .6 .RS 4n The instance name of the service instance. .RE .sp .ne 2 .mk .na \fB\fBNSTA\fR\fR .ad .sp .6 .RS 4n The abbreviated next state of the service instance, as given in the \fBSTA\fR column description. A hyphen denotes that the instance is not transitioning. Same as \fBSTA\fR otherwise. .RE .sp .ne 2 .mk .na \fB\fBNSTATE\fR\fR .ad .sp .6 .RS 4n The next state of the service. A hyphen is used to denote that the instance is not transitioning. Same as \fBSTATE\fR otherwise. .RE .sp .ne 2 .mk .na \fB\fBSCOPE\fR\fR .ad .sp .6 .RS 4n The scope name of the service instance. .RE .sp .ne 2 .mk .na \fB\fBSVC\fR\fR .ad .sp .6 .RS 4n The service name of the service instance. .RE .sp .ne 2 .mk .na \fB\fBSTA\fR\fR .ad .sp .6 .RS 4n The abbreviated state of the service instance (see \fBsmf\fR(5)): .sp .ne 2 .mk .na \fB\fBDGD\fR\fR .ad .sp .6 .RS 4n degraded .RE .sp .ne 2 .mk .na \fB\fBDIS\fR\fR .ad .sp .6 .RS 4n disabled .RE .sp .ne 2 .mk .na \fB\fBLRC\fR\fR .ad .sp .6 .RS 4n legacy \fBrc*.d\fR script-initiated instance .RE .sp .ne 2 .mk .na \fB\fBMNT\fR\fR .ad .sp .6 .RS 4n maintenance .RE .sp .ne 2 .mk .na \fB\fBOFF\fR\fR .ad .sp .6 .RS 4n offline .RE .sp .ne 2 .mk .na \fB\fBON\fR\fR .ad .sp .6 .RS 4n online .RE .sp .ne 2 .mk .na \fB\fBUN\fR\fR .ad .sp .6 .RS 4n uninitialized .RE Absent or unrecognized states are denoted by a question mark (\fB?\fR) character. An asterisk (\fB*\fR) is appended for instances in transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed. .sp See \fBsmf\fR(5) for an explanation of service states. .RE .sp .ne 2 .mk .na \fB\fBSTATE\fR\fR .ad .sp .6 .RS 4n The state of the service instance. An asterisk is appended for instances in transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed. .sp See \fBsmf\fR(5) for an explanation of service states. .RE .sp .ne 2 .mk .na \fB\fBSTIME\fR\fR .ad .sp .6 .RS 4n If the service instance entered the current state within the last 24 hours, this column indicates the time that it did so. Otherwise, this column indicates the date on which it did so, printed with underscores (\fB_\fR) in place of blanks. .RE .sp .ne 2 .mk .na \fB\fBASTATE\fR\fR .ad .sp .6 .RS 4n The auxiliary state of the service instance, if applicable. Service instances which have no auxiliary state will display a '-' character in this column. .RE .sp .ne 2 .mk .na \fB\fBLRUN\fR\fR .ad .sp .6 .RS 4n The last time a periodic service instance has run. Service instances that are not periodic, and have no last execution, will display a '-' character in this column. .sp See \fBsvc.periodicd\fR(1M) for an explanation of periodic services. .RE .sp .ne 2 .mk .na \fB\fBNRUN\fR\fR .ad .sp .6 .RS 4n The next time a periodic service instance is scheduled to run. Service instances that are not periodic, and thus have next scheduled run, will display a '-' character in this column. .sp See \fBsvc.periodicd\fR(1M) for an explanation of periodic services. .RE .SH EXAMPLES .LP \fBExample 1 \fRDisplaying the Default Output .sp .LP This example displays default output: .sp .in +2 .nf example% svcs STATE STIME FMRI \&... legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript \&... online 13:21:50 svc:/system/svc/restarter:default \&... online 13:25:03 svc:/milestone/multi-user:default \&... online 13:25:07 svc:/milestone/multi-user-server:default \&... .fi .in -2 .sp .LP \fBExample 2 \fRListing All Local Instances .sp .LP This example lists all local instances of the \fBservice1\fR service. .sp .in +2 .nf example% svcs -o state,nstate,fmri service1 STATE NSTATE FMRI online - svc:/service1:instance1 disabled - svc:/service1:instance2 .fi .in -2 .sp .LP \fBExample 3 \fRListing Verbose Information .sp .LP This example lists verbose information. .sp .in +2 .nf example% svcs -v network/rpc/rstat:udp STATE NSTATE STIME CTID FMRI online - Aug_09 - svc:/network/rpc/rstat:udp .fi .in -2 .sp .LP \fBExample 4 \fRListing Detailed Information .sp .LP This example lists detailed information about all instances of \fBsystem/service3\fR. Additional fields can be displayed, as appropriate to the managing restarter. .sp .in +2 .nf example% svcs -l network/rpc/rstat:udp fmri svc:/network/rpc/rstat:udp enabled true state online next_state none restarter svc:/network/inetd:default contract_id dependency require_all/error svc:/network/rpc/bind (online) .fi .in -2 .sp .LP \fBExample 5 \fRListing Processes .sp .in +2 .nf example% svcs -p sendmail STATE STIME FMRI online 13:25:13 svc:/network/smtp:sendmail 13:25:15 100939 sendmail 13:25:15 100940 sendmail .fi .in -2 .sp .LP \fBExample 6 \fRExplaining Service States Using \fBsvcs\fR \fB-x\fR .sp .LP (a) In this example, \fBsvcs\fR \fB-x\fR has identified that the print/server service being disabled is the root cause of two services which are enabled but not online. \fBsvcs\fR \fB-xv\fR shows that those services are \fBprint/rfc1179\fR and \fBprint/ipp-listener\fR. This situation can be rectified by either enabling \fBprint/server\fR or disabling \fBrfc1179\fR and \fBipp-listener\fR. .sp .in +2 .nf example% svcs -x svc:/application/print/server:default (LP print server) State: disabled since Mon Feb 13 17:56:21 2006 Reason: Disabled by an administrator. See: http://support.oracle.com/msg/SMF-8000-05 See: lpsched(1M) Impact: 2 dependent services are not running. (Use -v for list.) .fi .in -2 .sp .sp .LP (b) In this example, NFS is not working: .sp .in +2 .nf example$ svcs nfs/client STATE STIME FMRI offline 16:03:23 svc:/network/nfs/client:default .fi .in -2 .sp .sp .LP (c) The following example shows that the problem is \fBnfs/status\fR. \fBnfs/client\fR is waiting because it depends on \fBnfs/nlockmgr\fR, which depends on \fBnfs/status\fR: .sp .in +2 .nf example$ svcs -xv nfs/client svc:/network/nfs/client:default (NFS client) State: offline since Mon Feb 27 16:03:23 2006 Reason: Service svc:/network/nfs/status:default is not running because a method failed repeatedly. See: http://support.oracle.com/msg/SMF-8000-GE Path: svc:/network/nfs/client:default svc:/network/nfs/nlockmgr:default svc:/network/nfs/status:default See: man -M /usr/share/man -s 1M mount_nfs See: /var/svc/log/network-nfs-client:default.log Impact: This service is not running. .fi .in -2 .sp .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .sp .6 .RS 4n Successful command invocation. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .sp .6 .RS 4n Fatal error. .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .sp .6 .RS 4n Invalid command line options were specified. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilitySee below. .TE .sp .LP Screen output is Uncommitted. The invocation is Committed. .SH SEE ALSO .sp .LP \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M), \fBsvc.startd\fR(1M), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5), \fBfnmatch\fR(5), \fBsmf\fR(5), \fBsvc.periodicd\fR(1M)