1 '\" te 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 6 .TH SVCS 1 "Apr 17, 2011" 7 .SH NAME 8 svcs \- report service status 9 .SH SYNOPSIS 10 .LP 11 .nf 12 \fBsvcs\fR [\fB-aHpv?\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-R\fR \fIFMRI-instance\fR]... 13 [\fB-sS\fR \fIcol\fR]... [\fIFMRI\fR | \fIpattern\fR]... 14 .fi 15 16 .LP 17 .nf 18 \fBsvcs\fR {\fB-d\fR | \fB-D\fR} [\fB-Hpv?\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-sS\fR \fIcol\fR]... 19 [\fIFMRI\fR | \fIpattern\fR] ... 20 .fi 21 22 .LP 23 .nf 24 \fBsvcs\fR [\fB-l\fR | \fB-L\fR] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]... 25 .fi 26 27 .LP 28 .nf 29 \fBsvcs\fR \fB-x\fR [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fIFMRI\fR]... 30 .fi 31 32 .SH DESCRIPTION 33 .sp 34 .LP 35 The \fBsvcs\fR command displays information about service instances as recorded 36 in the service configuration repository. 37 .sp 38 .LP 39 The first form of this command prints one-line status listings for service 40 instances specified by the arguments. Each instance is listed only once. With 41 no arguments, all enabled service instances, even if temporarily disabled, are 42 listed with the columns indicated below. 43 .sp 44 .LP 45 The second form prints one-line status listings for the dependencies or 46 dependents of the service instances specified by the arguments. 47 .sp 48 .LP 49 The third form prints detailed information about specific services and 50 instances. 51 .sp 52 .LP 53 The fourth form explains the states of service instances. For each argument, a 54 block of human-readable text is displayed which explains what state the service 55 is in, and why it is in that state. With no arguments, problematic services are 56 described. 57 .sp 58 .LP 59 Error messages are printed to the standard error stream. 60 .sp 61 .LP 62 The output of this command can be used appropriately as input to the 63 \fBsvcadm\fR(1M) command. 64 .SH OPTIONS 65 .sp 66 .LP 67 The following options are supported: 68 .sp 69 .ne 2 70 .na 71 \fB\fB-?\fR\fR 72 .ad 73 .RS 20n 74 Displays an extended usage message, including column specifiers. 75 .RE 76 77 .sp 78 .ne 2 79 .na 80 \fB\fB-a\fR\fR 81 .ad 82 .RS 20n 83 Show all services, even disabled ones. This option has no effect if services 84 are selected. 85 .RE 86 87 .sp 88 .ne 2 89 .na 90 \fB\fB-d\fR\fR 91 .ad 92 .RS 20n 93 Lists the services or service instances upon which the given service instances 94 depend. 95 .RE 96 97 .sp 98 .ne 2 99 .na 100 \fB\fB-D\fR\fR 101 .ad 102 .RS 20n 103 Lists the service instances that depend on the given services or service 104 instances. 105 .RE 106 107 .sp 108 .ne 2 109 .na 110 \fB\fB-H\fR\fR 111 .ad 112 .RS 20n 113 Omits the column headers. 114 .RE 115 116 .sp 117 .ne 2 118 .na 119 \fB\fB-l\fR\fR 120 .ad 121 .RS 20n 122 (The letter ell.) Displays all available information about the selected 123 services and service instances, with one service attribute displayed for each 124 line. Information for different instances are separated by blank lines. 125 .sp 126 The following specific attributes require further explanation: 127 .sp 128 .ne 2 129 .na 130 \fB\fBdependency\fR\fR 131 .ad 132 .RS 14n 133 Information about a dependency. The grouping and \fBrestart_on\fR properties 134 are displayed first and are separated by a forward slash (\fB/\fR). Next, each 135 entity and its state is listed. See \fBsmf\fR(5) for information about states. 136 In addition to the standard states, each service dependency can have the 137 following state descriptions: 138 .sp 139 .ne 2 140 .na 141 \fB\fBabsent\fR\fR 142 .ad 143 .RS 12n 144 No such service is defined on the system. 145 .RE 146 147 .sp 148 .ne 2 149 .na 150 \fB\fBinvalid\fR\fR 151 .ad 152 .RS 12n 153 The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)). 154 .RE 155 156 .sp 157 .ne 2 158 .na 159 \fB\fBmultiple\fR\fR 160 .ad 161 .RS 12n 162 The entity is a service with multiple instances. 163 .RE 164 165 File dependencies can only have one of the following state descriptions: 166 .sp 167 .ne 2 168 .na 169 \fB\fBabsent\fR\fR 170 .ad 171 .RS 11n 172 No such file on the system. 173 .RE 174 175 .sp 176 .ne 2 177 .na 178 \fB\fBonline\fR\fR 179 .ad 180 .RS 11n 181 The file exists. 182 .sp 183 If the file did not exist the last time that \fBsvc.startd\fR evaluated the 184 service's dependencies, it can consider the dependency to be unsatisfied. 185 \fBsvcadm refresh\fR forces dependency re-evaluation. 186 .RE 187 188 .sp 189 .ne 2 190 .na 191 \fB\fBunknown\fR\fR 192 .ad 193 .RS 11n 194 \fBstat\fR(2) failed for a reason other than \fBENOENT\fR. 195 .RE 196 197 See \fBsmf\fR(5) for additional details about dependencies, grouping, and 198 \fBrestart_on\fR values. 199 .RE 200 201 .sp 202 .ne 2 203 .na 204 \fB\fBenabled\fR\fR 205 .ad 206 .RS 14n 207 Whether the service is enabled or not, and whether it is enabled or disabled 208 temporarily (until the next system reboot). The former is specified as either 209 \fBtrue\fR or \fBfalse\fR, and the latter is designated by the presence of 210 \fB(temporary)\fR. 211 .sp 212 A service might be temporarily disabled because an administrator has run 213 \fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a 214 specific milestone. See \fBsvcadm\fR(1M) for details. 215 .RE 216 217 .RE 218 219 .sp 220 .ne 2 221 .na 222 \fB-L\fR 223 .ad 224 .RS 20n 225 Display the log file of the selected services and service instances, one 226 per-line. 227 .RE 228 229 .sp 230 .ne 2 231 .na 232 \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR 233 .ad 234 .RS 20n 235 Prints the specified columns. Each \fIcol\fR should be a column name. See 236 \fBCOLUMNS\fR below for available columns. 237 .RE 238 239 .sp 240 .ne 2 241 .na 242 \fB\fB-p\fR\fR 243 .ad 244 .RS 20n 245 Lists processes associated with each service instance. A service instance can 246 have no associated processes. The process ID, start time, and command name 247 (\fBPID\fR, \fBSTIME\fR, and \fBCMD\fR fields from \fBps\fR(1)) are displayed 248 for each process. 249 .RE 250 251 .sp 252 .ne 2 253 .na 254 \fB\fB-R\fR \fIFMRI-instance\fR\fR 255 .ad 256 .RS 20n 257 Selects service instances that have the given service instance as their 258 restarter. 259 .RE 260 261 .sp 262 .ne 2 263 .na 264 \fB\fB-s\fR \fIcol\fR\fR 265 .ad 266 .RS 20n 267 Sorts output by column. \fIcol\fR should be a column name. See \fBCOLUMNS\fR 268 below for available columns. Multiple \fB-s\fR options behave additively. 269 .RE 270 271 .sp 272 .ne 2 273 .na 274 \fB\fB-S\fR \fIcol\fR\fR 275 .ad 276 .RS 20n 277 Sorts by \fIcol\fR in the opposite order as option \fB-s\fR. 278 .RE 279 280 .sp 281 .ne 2 282 .na 283 \fB\fB-v\fR\fR 284 .ad 285 .RS 20n 286 Without \fB-x\fR or \fB-l\fR, displays verbose columns: \fBSTATE\fR, 287 \fBNSTATE\fR, \fBSTIME\fR, \fBCTID\fR, and \fBFMRI\fR. 288 .sp 289 With \fB-x\fR, displays extra information for each explanation. 290 .sp 291 With \fB-l\fR, displays user-visible properties in property groups of type 292 \fBapplication\fR and their description. 293 .RE 294 295 .sp 296 .ne 2 297 .na 298 \fB\fB-x\fR\fR 299 .ad 300 .RS 20n 301 Displays explanations for service states. 302 .sp 303 Without arguments, the \fB-x\fR option explains the states of services which: 304 .RS +4 305 .TP 306 .ie t \(bu 307 .el o 308 are enabled, but are not running. 309 .RE 310 .RS +4 311 .TP 312 .ie t \(bu 313 .el o 314 are preventing another enabled service from running. 315 .RE 316 .RE 317 318 .sp 319 .ne 2 320 .na 321 \fB-z \fIzone\fR 322 .ad 323 .RS 20n 324 Display only the services in the \fIzone\fR. This option is only applicable 325 in the global zone, see \fBzones\fR(5). 326 .RE 327 328 .sp 329 .ne 2 330 .na 331 \fB-Z\fR 332 .ad 333 .RS 20n 334 Display services from all zones, with an additional column indicating in which 335 zone the service is running. This option is only applicable in the global 336 zone, see \fBzones\fR(5). 337 .RE 338 339 .SH OPERANDS 340 .sp 341 .LP 342 The following operands are supported: 343 .sp 344 .ne 2 345 .na 346 \fB\fIFMRI\fR\fR 347 .ad 348 .RS 17n 349 A fault management resource identifier (FMRI) that specifies one or more 350 instances (see \fBsmf\fR(5)). FMRIs can be abbreviated by specifying the 351 instance name, or the trailing portion of the service name. For example, given 352 the FMRI: 353 .sp 354 .in +2 355 .nf 356 svc:/network/smtp:sendmail 357 .fi 358 .in -2 359 .sp 360 361 The following are valid abbreviations: 362 .sp 363 .in +2 364 .nf 365 sendmail 366 :sendmail 367 smtp 368 smtp:sendmail 369 network/smtp 370 .fi 371 .in -2 372 .sp 373 374 The following are invalid abbreviations: 375 .sp 376 .in +2 377 .nf 378 mail 379 network 380 network/smt 381 .fi 382 .in -2 383 .sp 384 385 If the FMRI specifies a service, then the command applies to all instances of 386 that service, except when used with the \fB-D\fR option. 387 .sp 388 Abbreviated forms of FMRIs are unstable, and should not be used in scripts or 389 other permanent tools. 390 .RE 391 392 .sp 393 .ne 2 394 .na 395 \fB\fIpattern\fR\fR 396 .ad 397 .RS 17n 398 A pattern that is matched against the \fIFMRI\fRs of service instances 399 according to the "globbing" rules described by \fBfnmatch\fR(5). If the pattern 400 does not begin with \fBsvc:\fR, then \fBsvc:/\fR is prepended. The following is 401 a typical example of a glob pattern: 402 .sp 403 .in +2 404 .nf 405 qexample% svcs \e*keyserv\e* 406 STATE STIME FMRI 407 disabled Aug_02 svc:/network/rpc/keyserv:default 408 .fi 409 .in -2 410 .sp 411 412 .RE 413 414 .sp 415 .ne 2 416 .na 417 \fB\fIFMRI-instance\fR\fR 418 .ad 419 .RS 17n 420 An FMRI that specifies an instance. 421 .RE 422 423 .SH COLUMNS 424 .sp 425 .LP 426 Column names are case insensitive. The default output format is equivalent to 427 "\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR, 428 \fBSTIME\fR, \fBFMRI\fR. 429 .sp 430 .ne 2 431 .na 432 \fB\fBCTID\fR\fR 433 .ad 434 .RS 10n 435 The primary contract ID for the service instance. Not all instances have valid 436 primary contract IDs. 437 .RE 438 439 .sp 440 .ne 2 441 .na 442 \fB\fBDESC\fR\fR 443 .ad 444 .RS 10n 445 A brief description of the service, from its template element. A service might 446 not have a description available, in which case a hyphen (\fB\(hy\fR) is used 447 to denote an empty value. 448 .RE 449 450 .sp 451 .ne 2 452 .na 453 \fB\fBFMRI\fR\fR 454 .ad 455 .RS 10n 456 The \fIFMRI\fR of the service instance. 457 .RE 458 459 .sp 460 .ne 2 461 .na 462 \fB\fBINST\fR\fR 463 .ad 464 .RS 10n 465 The instance name of the service instance. 466 .RE 467 468 .sp 469 .ne 2 470 .na 471 \fB\fBNSTA\fR\fR 472 .ad 473 .RS 10n 474 The abbreviated next state of the service instance, as given in the \fBSTA\fR 475 column description. A hyphen denotes that the instance is not transitioning. 476 Same as \fBSTA\fR otherwise. 477 .RE 478 479 .sp 480 .ne 2 481 .na 482 \fB\fBNSTATE\fR\fR 483 .ad 484 .RS 10n 485 The next state of the service. A hyphen is used to denote that the instance is 486 not transitioning. Same as \fBSTATE\fR otherwise. 487 .RE 488 489 .sp 490 .ne 2 491 .na 492 \fB\fBSCOPE\fR\fR 493 .ad 494 .RS 10n 495 The scope name of the service instance. 496 .RE 497 498 .sp 499 .ne 2 500 .na 501 \fB\fBSVC\fR\fR 502 .ad 503 .RS 10n 504 The service name of the service instance. 505 .RE 506 507 .sp 508 .ne 2 509 .na 510 \fB\fBSTA\fR\fR 511 .ad 512 .RS 10n 513 The abbreviated state of the service instance (see \fBsmf\fR(5)): 514 .sp 515 .ne 2 516 .na 517 \fB\fBDGD\fR\fR 518 .ad 519 .RS 7n 520 degraded 521 .RE 522 523 .sp 524 .ne 2 525 .na 526 \fB\fBDIS\fR\fR 527 .ad 528 .RS 7n 529 disabled 530 .RE 531 532 .sp 533 .ne 2 534 .na 535 \fB\fBLRC\fR\fR 536 .ad 537 .RS 7n 538 legacy \fBrc*.d\fR script-initiated instance 539 .RE 540 541 .sp 542 .ne 2 543 .na 544 \fB\fBMNT\fR\fR 545 .ad 546 .RS 7n 547 maintenance 548 .RE 549 550 .sp 551 .ne 2 552 .na 553 \fB\fBOFF\fR\fR 554 .ad 555 .RS 7n 556 offline 557 .RE 558 559 .sp 560 .ne 2 561 .na 562 \fB\fBON\fR\fR 563 .ad 564 .RS 7n 565 online 566 .RE 567 568 .sp 569 .ne 2 570 .na 571 \fB\fBUN\fR\fR 572 .ad 573 .RS 7n 574 uninitialized 575 .RE 576 577 Absent or unrecognized states are denoted by a question mark (\fB?\fR) 578 character. An asterisk (\fB*\fR) is appended for instances in transition, 579 unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed. 580 .sp 581 See \fBsmf\fR(5) for an explanation of service states. 582 .RE 583 584 .sp 585 .ne 2 586 .na 587 \fB\fBSTATE\fR\fR 588 .ad 589 .RS 10n 590 The state of the service instance. An asterisk is appended for instances in 591 transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being 592 displayed. 593 .sp 594 See \fBsmf\fR(5) for an explanation of service states. 595 .RE 596 597 .sp 598 .ne 2 599 .na 600 \fB\fBSTIME\fR\fR 601 .ad 602 .RS 10n 603 If the service instance entered the current state within the last 24 hours, 604 this column indicates the time that it did so. Otherwise, this column indicates 605 the date on which it did so, printed with underscores (\fB_\fR) in place of 606 blanks. 607 .RE 608 609 .SH EXAMPLES 610 .LP 611 \fBExample 1 \fRDisplaying the Default Output 612 .sp 613 .LP 614 This example displays default output: 615 616 .sp 617 .in +2 618 .nf 619 example% svcs 620 STATE STIME FMRI 621 \&... 622 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript 623 \&... 624 online 13:21:50 svc:/system/svc/restarter:default 625 \&... 626 online 13:25:03 svc:/milestone/multi-user:default 627 \&... 628 online 13:25:07 svc:/milestone/multi-user-server:default 629 \&... 630 .fi 631 .in -2 632 .sp 633 634 .LP 635 \fBExample 2 \fRListing All Local Instances 636 .sp 637 .LP 638 This example lists all local instances of the \fBservice1\fR service. 639 640 .sp 641 .in +2 642 .nf 643 example% svcs -o state,nstate,fmri service1 644 STATE NSTATE FMRI 645 online - svc:/service1:instance1 646 disabled - svc:/service1:instance2 647 .fi 648 .in -2 649 .sp 650 651 .LP 652 \fBExample 3 \fRListing Verbose Information 653 .sp 654 .LP 655 This example lists verbose information. 656 657 .sp 658 .in +2 659 .nf 660 example% svcs -v network/rpc/rstat:udp 661 STATE NSTATE STIME CTID FMRI 662 online - Aug_09 - svc:/network/rpc/rstat:udp 663 .fi 664 .in -2 665 .sp 666 667 .LP 668 \fBExample 4 \fRListing Detailed Information 669 .sp 670 .LP 671 This example lists detailed information about all instances of 672 \fBsystem/service3\fR. Additional fields can be displayed, as appropriate to 673 the managing restarter. 674 675 .sp 676 .in +2 677 .nf 678 example% svcs -l network/rpc/rstat:udp 679 680 fmri svc:/network/rpc/rstat:udp 681 enabled true 682 state online 683 next_state none 684 restarter svc:/network/inetd:default 685 contract_id 686 dependency require_all/error svc:/network/rpc/bind (online) 687 .fi 688 .in -2 689 .sp 690 691 .LP 692 \fBExample 5 \fRListing Processes 693 .sp 694 .in +2 695 .nf 696 example% svcs -p sendmail 697 STATE STIME FMRI 698 online 13:25:13 svc:/network/smtp:sendmail 699 13:25:15 100939 sendmail 700 13:25:15 100940 sendmail 701 .fi 702 .in -2 703 .sp 704 705 .LP 706 \fBExample 6 \fRExplaining Service States Using \fBsvcs\fR \fB-x\fR 707 .sp 708 .LP 709 (a) In this example, \fBsvcs\fR \fB-x\fR has identified that the print/server 710 service being disabled is the root cause of two services which are enabled but 711 not online. \fBsvcs\fR \fB-xv\fR shows that those services are 712 \fBprint/rfc1179\fR and \fBprint/ipp-listener\fR. This situation can be 713 rectified by either enabling \fBprint/server\fR or disabling \fBrfc1179\fR and 714 \fBipp-listener\fR. 715 716 .sp 717 .in +2 718 .nf 719 example% svcs -x 720 svc:/application/print/server:default (LP print server) 721 State: disabled since Mon Feb 13 17:56:21 2006 722 Reason: Disabled by an administrator. 723 See: http://illumos.org/msg/SMF-8000-05 724 See: lpsched(1M) 725 Impact: 2 dependent services are not running. (Use -v for list.) 726 .fi 727 .in -2 728 .sp 729 730 .sp 731 .LP 732 (b) In this example, NFS is not working: 733 734 .sp 735 .in +2 736 .nf 737 example$ svcs nfs/client 738 STATE STIME FMRI 739 offline 16:03:23 svc:/network/nfs/client:default 740 .fi 741 .in -2 742 .sp 743 744 .sp 745 .LP 746 (c) The following example shows that the problem is \fBnfs/status\fR. 747 \fBnfs/client\fR is waiting because it depends on \fBnfs/nlockmgr\fR, which 748 depends on \fBnfs/status\fR: 749 750 .sp 751 .in +2 752 .nf 753 example$ svcs -xv nfs/client 754 svc:/network/nfs/client:default (NFS client) 755 State: offline since Mon Feb 27 16:03:23 2006 756 Reason: Service svc:/network/nfs/status:default 757 is not running because a method failed repeatedly. 758 See: http://illumos.org/msg/SMF-8000-GE 759 Path: svc:/network/nfs/client:default 760 svc:/network/nfs/nlockmgr:default 761 svc:/network/nfs/status:default 762 See: man -M /usr/share/man -s 1M mount_nfs 763 See: /var/svc/log/network-nfs-client:default.log 764 Impact: This service is not running. 765 .fi 766 .in -2 767 .sp 768 769 .SH EXIT STATUS 770 .sp 771 .LP 772 The following exit values are returned: 773 .sp 774 .ne 2 775 .na 776 \fB\fB0\fR\fR 777 .ad 778 .RS 5n 779 Successful command invocation. 780 .RE 781 782 .sp 783 .ne 2 784 .na 785 \fB\fB1\fR\fR 786 .ad 787 .RS 5n 788 Fatal error. 789 .RE 790 791 .sp 792 .ne 2 793 .na 794 \fB\fB2\fR\fR 795 .ad 796 .RS 5n 797 Invalid command line options were specified. 798 .RE 799 800 .SH ATTRIBUTES 801 .sp 802 .LP 803 See \fBattributes\fR(5) for descriptions of the following attributes: 804 .sp 805 806 .sp 807 .TS 808 box; 809 c | c 810 l | l . 811 ATTRIBUTE TYPE ATTRIBUTE VALUE 812 _ 813 Interface Stability See below. 814 .TE 815 816 .sp 817 .LP 818 Screen output is Uncommitted. The invocation is Committed. 819 .SH SEE ALSO 820 .sp 821 .LP 822 \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M), 823 \fBsvc.startd\fR(1M), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5), 824 \fBfnmatch\fR(5), \fBsmf\fR(5), \fBzones\fR(5)