1 SVCS(1) User Commands SVCS(1) 2 3 4 5 NAME 6 svcs - report service status 7 8 SYNOPSIS 9 svcs [-aHpv?] [-Z | -z zone] [-o col[,col]]... [-R FMRI-instance]... 10 [-sS col]... [FMRI | pattern]... 11 12 13 svcs {-d | -D} [-Hpv?] [-Z | -z zone] [-o col[,col]]... [-sS col]... 14 [FMRI | pattern] ... 15 16 17 svcs [-l | -L] [-vZ] [-z zone] [FMRI | pattern]... 18 19 20 svcs -x [-v] [-Z | -z zone] [FMRI]... 21 22 23 DESCRIPTION 24 The svcs command displays information about service instances as 25 recorded in the service configuration repository. 26 27 28 The first form of this command prints one-line status listings for 29 service instances specified by the arguments. Each instance is listed 30 only once. With no arguments, all enabled service instances, even if 31 temporarily disabled, are listed with the columns indicated below. 32 33 34 The second form prints one-line status listings for the dependencies or 35 dependents of the service instances specified by the arguments. 36 37 38 The third form prints detailed information about specific services and 39 instances. 40 41 42 The fourth form explains the states of service instances. For each 43 argument, a block of human-readable text is displayed which explains 44 what state the service is in, and why it is in that state. With no 45 arguments, problematic services are described. 46 47 48 Error messages are printed to the standard error stream. 49 50 51 The output of this command can be used appropriately as input to the 52 svcadm(1M) command. 53 54 OPTIONS 55 The following options are supported: 56 57 -? 58 Displays an extended usage message, including 59 column specifiers. 60 61 62 -a 63 Show all services, even disabled ones. This option 64 has no effect if services are selected. 65 66 67 -d 68 Lists the services or service instances upon which 69 the given service instances depend. 70 71 72 -D 73 Lists the service instances that depend on the 74 given services or service instances. 75 76 77 -H 78 Omits the column headers. 79 80 81 -l 82 (The letter ell.) Displays all available 83 information about the selected services and service 84 instances, with one service attribute displayed for 85 each line. Information for different instances are 86 separated by blank lines. 87 88 The following specific attributes require further 89 explanation: 90 91 dependency 92 Information about a dependency. The 93 grouping and restart_on properties 94 are displayed first and are separated 95 by a forward slash (/). Next, each 96 entity and its state is listed. See 97 smf(5) for information about states. 98 In addition to the standard states, 99 each service dependency can have the 100 following state descriptions: 101 102 absent 103 No such service is 104 defined on the system. 105 106 107 invalid 108 The fault management 109 resource identifier 110 (FMRI) is invalid (see 111 smf(5)). 112 113 114 multiple 115 The entity is a service 116 with multiple instances. 117 118 File dependencies can only have one 119 of the following state descriptions: 120 121 absent 122 No such file on the 123 system. 124 125 126 online 127 The file exists. 128 129 If the file did not exist 130 the last time that 131 svc.startd evaluated the 132 service's dependencies, it 133 can consider the 134 dependency to be 135 unsatisfied. svcadm 136 refresh forces dependency 137 re-evaluation. 138 139 140 unknown 141 stat(2) failed for a 142 reason other than ENOENT. 143 144 See smf(5) for additional details 145 about dependencies, grouping, and 146 restart_on values. 147 148 149 enabled 150 Whether the service is enabled or 151 not, and whether it is enabled or 152 disabled temporarily (until the next 153 system reboot). The former is 154 specified as either true or false, 155 and the latter is designated by the 156 presence of (temporary). 157 158 A service might be temporarily 159 disabled because an administrator has 160 run svcadm disable -t, used svcadm 161 milestone, or booted the system to a 162 specific milestone. See svcadm(1M) 163 for details. 164 165 If a service instance was disabled 166 via svcadm disable -c , then the 167 provided comment will also be 168 displayed. 169 170 171 172 -L 173 Display the log file of the selected services and 174 service instances, one per-line. 175 176 177 -o col[,col]... 178 Prints the specified columns. Each col should be a 179 column name. See COLUMNS below for available 180 columns. 181 182 183 -p 184 Lists processes associated with each service 185 instance. A service instance can have no associated 186 processes. The process ID, start time, and command 187 name (PID, STIME, and CMD fields from ps(1)) are 188 displayed for each process. 189 190 191 -R FMRI-instance 192 Selects service instances that have the given 193 service instance as their restarter. 194 195 196 -s col 197 Sorts output by column. col should be a column 198 name. See COLUMNS below for available columns. 199 Multiple -s options behave additively. 200 201 202 -S col 203 Sorts by col in the opposite order as option -s. 204 205 206 -v 207 Without -x or -l, displays verbose columns: STATE, 208 NSTATE, STIME, CTID, and FMRI. 209 210 With -x, displays extra information for each 211 explanation. 212 213 With -l, displays user-visible properties in 214 property groups of type application and their 215 description. 216 217 218 -x 219 Displays explanations for service states. 220 221 Without arguments, the -x option explains the 222 states of services which: 223 224 o are enabled, but are not running. 225 226 o are preventing another enabled service 227 from running. 228 229 230 -z zone 231 Display only the services in the zone. This option 232 is only applicable in the global zone, see 233 zones(5). 234 235 236 -Z 237 Display services from all zones, with an additional 238 column indicating in which zone the service is 239 running. This option is only applicable in the 240 global zone, see zones(5). 241 242 243 OPERANDS 244 The following operands are supported: 245 246 FMRI 247 A fault management resource identifier (FMRI) that 248 specifies one or more instances (see smf(5)). FMRIs 249 can be abbreviated by specifying the instance name, or 250 the trailing portion of the service name. For example, 251 given the FMRI: 252 253 svc:/network/smtp:sendmail 254 255 256 The following are valid abbreviations: 257 258 sendmail 259 :sendmail 260 smtp 261 smtp:sendmail 262 network/smtp 263 264 265 The following are invalid abbreviations: 266 267 mail 268 network 269 network/smt 270 271 272 If the FMRI specifies a service, then the command 273 applies to all instances of that service, except when 274 used with the -D option. 275 276 Abbreviated forms of FMRIs are unstable, and should 277 not be used in scripts or other permanent tools. 278 279 280 pattern 281 A pattern that is matched against the FMRIs of service 282 instances according to the "globbing" rules described 283 by fnmatch(5). If the pattern does not begin with 284 svc:, then svc:/ is prepended. The following is a 285 typical example of a glob pattern: 286 287 qexample% svcs \*keyserv\* 288 STATE STIME FMRI 289 disabled Aug_02 svc:/network/rpc/keyserv:default 290 291 292 293 294 FMRI-instance 295 An FMRI that specifies an instance. 296 297 298 COLUMNS 299 Column names are case insensitive. The default output format is 300 equivalent to "-o state,stime,fmri". The default sorting columns are 301 STATE, STIME, FMRI. 302 303 CTID 304 The primary contract ID for the service instance. Not all 305 instances have valid primary contract IDs. 306 307 308 DESC 309 A brief description of the service, from its template 310 element. A service might not have a description available, in 311 which case a hyphen (-) is used to denote an empty value. 312 313 314 FMRI 315 The FMRI of the service instance. 316 317 318 INST 319 The instance name of the service instance. 320 321 322 NSTA 323 The abbreviated next state of the service instance, as given 324 in the STA column description. A hyphen denotes that the 325 instance is not transitioning. Same as STA otherwise. 326 327 328 NSTATE 329 The next state of the service. A hyphen is used to denote 330 that the instance is not transitioning. Same as STATE 331 otherwise. 332 333 334 SCOPE 335 The scope name of the service instance. 336 337 338 SVC 339 The service name of the service instance. 340 341 342 STA 343 The abbreviated state of the service instance (see smf(5)): 344 345 DGD 346 degraded 347 348 349 DIS 350 disabled 351 352 353 LRC 354 legacy rc*.d script-initiated instance 355 356 357 MNT 358 maintenance 359 360 361 OFF 362 offline 363 364 365 ON 366 online 367 368 369 UN 370 uninitialized 371 372 Absent or unrecognized states are denoted by a question mark 373 (?) character. An asterisk (*) is appended for instances in 374 transition, unless the NSTA or NSTATE column is also being 375 displayed. 376 377 See smf(5) for an explanation of service states. 378 379 380 STATE 381 The state of the service instance. An asterisk is appended 382 for instances in transition, unless the NSTA or NSTATE column 383 is also being displayed. 384 385 See smf(5) for an explanation of service states. 386 387 388 STIME 389 If the service instance entered the current state within the 390 last 24 hours, this column indicates the time that it did so. 391 Otherwise, this column indicates the date on which it did so, 392 printed with underscores (_) in place of blanks. 393 394 395 EXAMPLES 396 Example 1 Displaying the Default Output 397 398 399 This example displays default output: 400 401 402 example% svcs 403 STATE STIME FMRI 404 ... 405 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript 406 ... 407 online 13:21:50 svc:/system/svc/restarter:default 408 ... 409 online 13:25:03 svc:/milestone/multi-user:default 410 ... 411 online 13:25:07 svc:/milestone/multi-user-server:default 412 ... 413 414 415 416 Example 2 Listing All Local Instances 417 418 419 This example lists all local instances of the service1 service. 420 421 422 example% svcs -o state,nstate,fmri service1 423 STATE NSTATE FMRI 424 online - svc:/service1:instance1 425 disabled - svc:/service1:instance2 426 427 428 429 Example 3 Listing Verbose Information 430 431 432 This example lists verbose information. 433 434 435 example% svcs -v network/rpc/rstat:udp 436 STATE NSTATE STIME CTID FMRI 437 online - Aug_09 - svc:/network/rpc/rstat:udp 438 439 440 441 Example 4 Listing Detailed Information 442 443 444 This example lists detailed information about all instances of 445 system/service3. Additional fields can be displayed, as appropriate to 446 the managing restarter. 447 448 449 example% svcs -l network/rpc/rstat:udp 450 451 fmri svc:/network/rpc/rstat:udp 452 enabled true 453 state online 454 next_state none 455 restarter svc:/network/inetd:default 456 contract_id 457 dependency require_all/error svc:/network/rpc/bind (online) 458 459 460 461 Example 5 Listing Processes 462 463 example% svcs -p sendmail 464 STATE STIME FMRI 465 online 13:25:13 svc:/network/smtp:sendmail 466 13:25:15 100939 sendmail 467 13:25:15 100940 sendmail 468 469 470 471 Example 6 Explaining Service States Using svcs -x 472 473 474 (a) In this example, svcs -x has identified that the print/server 475 service being disabled is the root cause of two services which are 476 enabled but not online. svcs -xv shows that those services are 477 print/rfc1179 and print/ipp-listener. This situation can be rectified 478 by either enabling print/server or disabling rfc1179 and ipp-listener. 479 480 481 example% svcs -x 482 svc:/application/print/server:default (LP print server) 483 State: disabled since Mon Feb 13 17:56:21 2006 484 Reason: Disabled by an administrator. 485 See: http://illumos.org/msg/SMF-8000-05 486 See: lpsched(1M) 487 Impact: 2 dependent services are not running. (Use -v for list.) 488 489 490 491 492 (b) In this example, NFS is not working: 493 494 495 example$ svcs nfs/client 496 STATE STIME FMRI 497 offline 16:03:23 svc:/network/nfs/client:default 498 499 500 501 502 (c) The following example shows that the problem is nfs/status. 503 nfs/client is waiting because it depends on nfs/nlockmgr, which depends 504 on nfs/status: 505 506 507 example$ svcs -xv nfs/client 508 svc:/network/nfs/client:default (NFS client) 509 State: offline since Mon Feb 27 16:03:23 2006 510 Reason: Service svc:/network/nfs/status:default 511 is not running because a method failed repeatedly. 512 See: http://illumos.org/msg/SMF-8000-GE 513 Path: svc:/network/nfs/client:default 514 svc:/network/nfs/nlockmgr:default 515 svc:/network/nfs/status:default 516 See: man -M /usr/share/man -s 1M mount_nfs 517 See: /var/svc/log/network-nfs-client:default.log 518 Impact: This service is not running. 519 520 521 522 EXIT STATUS 523 The following exit values are returned: 524 525 0 526 Successful command invocation. 527 528 529 1 530 Fatal error. 531 532 533 2 534 Invalid command line options were specified. 535 536 537 ATTRIBUTES 538 See attributes(5) for descriptions of the following attributes: 539 540 541 542 543 +--------------------+-----------------+ 544 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 545 +--------------------+-----------------+ 546 |Interface Stability | See below. | 547 +--------------------+-----------------+ 548 549 550 Screen output is Uncommitted. The invocation is Committed. 551 552 SEE ALSO 553 ps(1), svcprop(1), svcadm(1M), svccfg(1M), svc.startd(1M), stat(2), 554 libscf(3LIB), attributes(5), fnmatch(5), smf(5), zones(5) 555 556 557 558 May 11, 2020 SVCS(1)