1 SVCS(1)                          User Commands                         SVCS(1)
   2 
   3 NAME
   4      svcs - report service status
   5 
   6 SYNOPSIS
   7      svcs [-aHpv?] [-o col[,col]...] [-R FMRI-instance]... [-sS col]...
   8           [-z zone|-Z] [FMRI|pattern]...
   9      svcs {-d|-D} -Hpv? [-o col[,col]...] [-sS col]... [-z zone|-Z]
  10           [FMRI|pattern]...
  11      svcs {-l|-L} [-v] [-z zone|-Z] {FMRI|pattern}...
  12      svcs -x [-v] [-z zone|-Z] [FMRI]...
  13 
  14 DESCRIPTION
  15      The svcs command displays information about service instances as recorded
  16      in the service configuration repository.
  17 
  18      The first form of this command prints one-line status listings for
  19      service instances specified by the arguments.  Each instance is listed
  20      only once.  With no arguments, all enabled service instances, even if
  21      temporarily disabled, are listed with the columns indicated below.
  22 
  23      The second form prints one-line status listings for the dependencies or
  24      dependents of the service instances specified by the arguments.
  25 
  26      The third form prints detailed information about specific services and
  27      instances.
  28 
  29      The fourth form explains the states of service instances.  For each
  30      argument, a block of human-readable text is displayed which explains what
  31      state the service is in, and why it is in that state.  With no arguments,
  32      problematic services are described.
  33 
  34      The output of this command can be used appropriately as input to the
  35      svcadm(1M) command.
  36 
  37 OPTIONS
  38      The following options are supported:
  39 
  40      -?                Displays an extended usage message, including column
  41                        specifiers.
  42 
  43      -a                Show all services, even disabled ones.  This option has
  44                        no effect if services are selected.
  45 
  46      -d                Lists the services or service instances upon which the
  47                        given service instances depend.
  48 
  49      -D                Lists the service instances that depend on the given
  50                        services or service instances.
  51 
  52      -H                Used for scripting mode.  Do not print headers and
  53                        separate fields by a single tab instead of arbitrary
  54                        white space.
  55 
  56      -l                Displays all available information about the selected
  57                        services and service instances, with one service
  58                        attribute displayed for each line.  Information for
  59                        different instances are separated by blank lines.
  60 
  61                        The following specific attributes require further
  62                        explanation:
  63 
  64                        dependency  Information about a dependency.  The
  65                                    grouping and restart_on properties are
  66                                    displayed first and are separated by a
  67                                    forward slash (/).  Next, each entity and
  68                                    its state is listed.  See smf(5) for
  69                                    information about states.  In addition to
  70                                    the standard states, each service
  71                                    dependency can have the following state
  72                                    descriptions:
  73 
  74                                    absent    No such service is defined on the
  75                                              system.
  76 
  77                                    invalid   The fault management resource
  78                                              identifier (FMRI) is invalid (see
  79                                              smf(5)).
  80 
  81                                    multiple  The entity is a service with
  82                                              multiple instances.
  83 
  84                                    File dependencies can only have one of the
  85                                    following state descriptions:
  86 
  87                                    absent   No such file on the system.
  88 
  89                                    online   The file exists.
  90 
  91                                             If the file did not exist the last
  92                                             time that svc.startd evaluated the
  93                                             service's dependencies, it can
  94                                             consider the dependency to be
  95                                             unsatisfied.  svcadm refresh
  96                                             forces dependency re-evaluation.
  97 
  98                                    unknown  stat(2) failed for a reason other
  99                                             than ENOENT.
 100 
 101                                    See smf(5) for additional details about
 102                                    dependencies, grouping, and restart_on
 103                                    values.
 104 
 105                        enabled     Whether the service is enabled or not, and
 106                                    whether it is enabled or disabled
 107                                    temporarily (until the next system reboot).
 108                                    The former is specified as either true or
 109                                    false, and the latter is designated by the
 110                                    presence of (temporary).
 111 
 112                                    A service might be temporarily disabled
 113                                    because an administrator has run svcadm
 114                                    disable -t, used svcadm milestone, or
 115                                    booted the system to a specific milestone.
 116                                    See svcadm(1M) for details.
 117 
 118      -L                Display the log file of the selected services and
 119                        service instances, one per-line.
 120 
 121      -o col[,col]...   Prints the specified columns.  Each col should be a
 122                        column name.  See COLUMNS below for available columns.
 123 
 124      -p                Lists processes associated with each service instance.
 125                        A service instance can have no associated processes.
 126                        The process ID, start time, and command name (PID,
 127                        STIME, and CMD fields from ps(1)) are displayed for
 128                        each process.
 129 
 130      -R FMRI-instance  Selects service instances that have the given service
 131                        instance as their restarter.
 132 
 133      -s col            Sorts output by column.  col should be a column name.
 134                        See COLUMNS below for available columns.  Multiple -s
 135                        options behave additively.
 136 
 137      -S col            Sorts by col in the opposite order as option -s.
 138 
 139      -v                Without -x or -l, displays verbose columns: STATE,
 140                        NSTATE, STIME, CTID, and FMRI.
 141 
 142                        With -x, displays extra information for each
 143                        explanation.
 144 
 145                        With -l, displays user-visible properties in property
 146                        groups of type application and their description.
 147 
 148      -x                Displays explanations for service states.
 149 
 150                        Without arguments, the -x option explains the states of
 151                        services which:
 152 
 153                        o   are enabled, but are not running.
 154 
 155                        o   are preventing another enabled service from
 156                            running.
 157 
 158      -z zone           Display only the services in the zone.  This option is
 159                        only applicable in the global zone, see zones(5).
 160 
 161      -Z                Display services from all zones, with an additional
 162                        column indicating in which zone the service is running.
 163                        This option is only applicable in the global zone, see
 164                        zones(5).
 165 
 166 OPERANDS
 167      The following operands are supported:
 168 
 169      FMRI           A fault management resource identifier (FMRI) that
 170                     specifies one or more instances (see smf(5)).  FMRIs can
 171                     be abbreviated by specifying the instance name, or the
 172                     trailing portion of the service name.  For example, given
 173                     the FMRI svc:/network/smtp:sendmail, the following are
 174                     valid abbreviations: sendmail :sendmail smtp smtp:sendmail
 175                     network/smtp, and the following are invalid abbreviations:
 176                     mail network network/smt.
 177 
 178                     If the FMRI specifies a service, then the command applies
 179                     to all instances of that service, except when used with
 180                     the -D option.
 181 
 182                     Abbreviated forms of FMRIs are unstable, and should not be
 183                     used in scripts or other permanent tools.
 184 
 185      pattern        A pattern that is matched against the FMRI of service
 186                     instances according to the "globbing" rules described by
 187                     fnmatch(5).  If the pattern does not begin with svc:, then
 188                     svc:/ is prepended.  The following is a typical example of
 189                     a glob pattern:
 190 
 191                     qexample% svcs \*keyserv\*
 192                     STATE          STIME     FMRI
 193                     disabled       Aug_02    svc:/network/rpc/keyserv:default
 194 
 195      FMRI-instance  An FMRI that specifies an instance.
 196 
 197 COLUMNS
 198      Column names are case insensitive.  The default output format is
 199      equivalent to -o state,stime,fmri.  The default sorting columns are
 200      STATE, STIME, FMRI.
 201 
 202      CTID    The primary contract ID for the service instance.  Not all
 203              instances have valid primary contract IDs.
 204 
 205      DESC    A brief description of the service, from its template element.  A
 206              service might not have a description available, in which case a
 207              hyphen (-) is used to denote an empty value.
 208 
 209      FMRI    The FMRI of the service instance.
 210 
 211      INST    The instance name of the service instance.
 212 
 213      NSTA    The abbreviated next state of the service instance, as given in
 214              the STA column description.  A hyphen denotes that the instance
 215              is not transitioning.  Same as STA otherwise.
 216 
 217      NSTATE  The next state of the service.  A hyphen is used to denote that
 218              the instance is not transitioning.  Same as STATE otherwise.
 219 
 220      SCOPE   The scope name of the service instance.
 221 
 222      SVC     The service name of the service instance.
 223 
 224      STA     The abbreviated state of the service instance:
 225 
 226              DGD  degraded
 227 
 228              DIS  disabled
 229 
 230              LRC  legacy rc*.d script-initiated instance
 231 
 232              MNT  maintenance
 233 
 234              OFF  offline
 235 
 236              ON   online
 237 
 238              UN   uninitialized
 239 
 240              Absent or unrecognized states are denoted by a question mark (?)
 241              character.  An asterisk (*) is appended for instances in
 242              transition, unless the NSTA or NSTATE column is also being
 243              displayed.
 244 
 245      STATE   The state of the service instance.  An asterisk is appended for
 246              instances in transition, unless the NSTA or NSTATE column is also
 247              being displayed.
 248 
 249      STIME   If the service instance entered the current state within the last
 250              24 hours, this column indicates the time that it did so.
 251              Otherwise, this column indicates the date on which it did so,
 252              printed with underscores (_) in place of blanks.
 253 
 254 EXIT STATUS
 255      The following exit values are returned:
 256 
 257      0  Successful command invocation.
 258 
 259      1  Fatal error.
 260 
 261      2  Invalid command line options were specified.
 262 
 263 EXAMPLES
 264      Example 1 Displaying the Default Output
 265        This example displays default output:
 266 
 267        example% svcs
 268        STATE          STIME    FMRI
 269        ...
 270        legacy_run     13:25:04 lrc:/etc/rc3_d/S42myscript
 271        ...
 272        online         13:21:50 svc:/system/svc/restarter:default
 273        ...
 274        online         13:25:03 svc:/milestone/multi-user:default
 275        ...
 276        online         13:25:07 svc:/milestone/multi-user-server:default
 277        ...
 278 
 279      Example 2 Listing All Local Instances
 280        This example lists all local instances of the service1 service:
 281 
 282        example% svcs -o state,nstate,fmri service1
 283        STATE        NSTATE        FMRI
 284        online       -             svc:/service1:instance1
 285        disabled     -             svc:/service1:instance2
 286 
 287      Example 3 Listing Verbose Information
 288        This example lists verbose information:
 289 
 290        example% svcs -v network/rpc/rstat:udp
 291        STATE          NSTATE        STIME    CTID   FMRI
 292        online         -             Aug_09        - svc:/network/rpc/rstat:udp
 293 
 294      Example 4 Listing Detailed Information
 295        This example lists detailed information about all instances of
 296        system/service3.  Additional fields can be displayed, as appropriate to
 297        the managing restarter.
 298 
 299        example% svcs -l network/rpc/rstat:udp
 300 
 301        fmri         svc:/network/rpc/rstat:udp
 302        enabled      true
 303        state        online
 304        next_state   none
 305        restarter    svc:/network/inetd:default
 306        contract_id
 307        dependency   require_all/error svc:/network/rpc/bind (online)
 308 
 309      Example 5 Listing Processes
 310 
 311        example% svcs -p sendmail
 312        STATE          STIME    FMRI
 313        online         13:25:13 svc:/network/smtp:sendmail
 314                       13:25:15   100939 sendmail
 315                       13:25:15   100940 sendmail
 316 
 317      Example 6 Explaining Service States Using svcs -x
 318 
 319        1.   In this example, svcs -x has identified that the print/server
 320             service being disabled is the root cause of two services which are
 321             enabled but not online.  svcs -xv shows that those services are
 322             print/rfc1179 and print/ipp-listener.  This situation can be
 323             rectified by either enabling print/server or disabling rfc1179 and
 324             ipp-listener.
 325 
 326             example% svcs -x
 327             svc:/application/print/server:default (LP print server)
 328              State: disabled since Mon Feb 13 17:56:21 2006
 329             Reason: Disabled by an administrator.
 330                See: http://illumos.org/msg/SMF-8000-05
 331                See: lpsched(1M)
 332             Impact: 2 dependent services are not running. (Use -v for list.)
 333 
 334        2.   In this example, NFS is not working:
 335 
 336             example$ svcs nfs/client
 337             STATE          STIME    FMRI
 338             offline        16:03:23 svc:/network/nfs/client:default
 339 
 340        3.   The following example shows that the problem is nfs/status.
 341             nfs/client is waiting because it depends on nfs/nlockmgr, which
 342             depends on nfs/status:
 343 
 344             example$ svcs -xv nfs/client
 345             svc:/network/nfs/client:default (NFS client)
 346              State: offline since Mon Feb 27 16:03:23 2006
 347             Reason: Service svc:/network/nfs/status:default
 348                     is not running because a method failed repeatedly.
 349                See: http://illumos.org/msg/SMF-8000-GE
 350               Path: svc:/network/nfs/client:default
 351                       svc:/network/nfs/nlockmgr:default
 352                         svc:/network/nfs/status:default
 353                See: man -M /usr/share/man -s 1M mount_nfs
 354                See: /var/svc/log/network-nfs-client:default.log
 355             Impact: This service is not running.
 356 
 357 INTERFACE STABILITY
 358      Screen output is Uncommitted.  The invocation is Committed.
 359 
 360 SEE ALSO
 361      ps(1), svcprop(1), svc.startd(1M), svcadm(1M), svccfg(1M), stat(2),
 362      libscf(3LIB), attributes(5), fnmatch(5), smf(5), zones(5)
 363 
 364 illumos                         April 23, 2015                         illumos