Print this page
12071 clarify implementation of single_instance in SMF services
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
   1 '\" te
   2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 2012, Joyent, Inc. All Rights Reserved.
   4 .\" 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.
   5 .\" 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.
   6 .\" 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]
   7 .TH SVC.STARTD 1M "Mar 18, 2011"
   8 .SH NAME
   9 svc.startd \- Service Management Facility master restarter
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fB/lib/svc/bin/svc.startd\fR
  14 .fi
  15 
  16 .LP
  17 .nf
  18 \fBsvc:/system/svc/restarter:default\fR
  19 .fi
  20 
  21 .SH DESCRIPTION
  22 .sp
  23 .LP
  24 \fBsvc.startd\fR is the master restarter daemon for Service Management Facility
  25 (SMF) and the default restarter for all services. \fBsvc.startd\fR starts,
  26 stops, and restarts services based on administrative requests, system failures,
  27 or application failures.
  28 .sp
  29 .LP
  30 \fBsvc.startd\fR maintains service state, as well as being responsible for
  31 managing faults in accordance with the dependencies of each service.
  32 .sp
  33 .LP
  34 \fBsvc.startd\fR is invoked automatically during system startup. It is
  35 restarted if any failures occur. \fBsvc.startd\fR should never be invoked
  36 directly.
  37 .sp
  38 .LP
  39 See \fBsmf_restarter\fR(5) for information on configuration and behavior common
  40 to all restarters.
  41 .sp
  42 .LP
  43 \fBsvcs\fR(1) reports status for all services managed by the Service
  44 Configuration Facility. \fBsvcadm\fR(1M) allows manipulation of service
  45 instances with respect to the service's restarter.
  46 .SS "Environment Variables"
  47 .sp
  48 .LP
  49 Environment variables with the "SMF_" prefix are reserved and may be
  50 overwritten.
  51 .sp
  52 .LP
  53 \fBsvc.startd\fR supplies the "SMF_" environment variables specified in
  54 \fBsmf_method\fR(5) to the method. PATH is set to "\fB/usr/sbin:/usr/bin\fR" by
  55 default. By default, all other environment variables supplied to
  56 \fBsvc.startd\fR are those inherited from \fBinit\fR(1M).
  57 .sp
  58 .LP
  59 Duplicate entries are reduced to a single entry. The value used is undefined.
  60 Environment entries that are not prefixed with "<\fIname\fR>=" are ignored.
  61 .SS "Restarter Options"
  62 .sp
  63 .LP
  64 \fBsvc.startd\fR is not configured by command line options. Instead,
  65 configuration is read from the service configuration repository. You can use
  66 \fBsvccfg\fR(1M) to set all options and properties.
  67 .sp
  68 .LP
  69 The following configuration variables in the \fBoptions\fR property group are
  70 available to developers and administrators:
  71 .sp
  72 .ne 2
  73 .na
  74 \fB\fBboot_messages\fR\fR
  75 .ad
  76 .sp .6
  77 .RS 4n
  78 An \fIastring\fR (as defined in \fBscf_value_is_type\fR; see
  79 \fBscf_value_is_type\fR(3SCF)) that describes the default level of messages to
  80 print to the console during boot. The supported message options include
  81 \fBquiet\fR and \fBverbose\fR. The \fBquiet\fR option prints minimal messages
  82 to console during boot. The \fBverbose\fR option prints a single message per
  83 service started to indicate success or failure. You can use the \fBboot\fR


 142 .ne 2
 143 .na
 144 \fB\fBsystem/reconfigure\fR\fR
 145 .ad
 146 .sp .6
 147 .RS 4n
 148 Indicates that a reconfiguration reboot has been requested. Services with
 149 actions that must key off of a reconfiguration reboot may check that this
 150 property exists and is set to 1 to confirm a reconfiguration boot has been
 151 requested.
 152 .sp
 153 This property is managed by \fBsvc.startd\fR and should not be modified by the
 154 administrator.
 155 .RE
 156 
 157 .sp
 158 .LP
 159 Configuration errors, such as disabling \fBsvc.startd\fR are logged by
 160 \fBsyslog\fR, but ignored.
 161 .SS "SERVICE STATES"
 162 .sp
 163 .LP
 164 Services managed by \fBsvc.startd\fR can appear in any of the states described
 165 in \fBsmf\fR(5). The state definitions are unmodified by this restarter.
 166 .SS "SERVICE REPORTING"
 167 .sp
 168 .LP
 169 In addition to any logging done by the managed service, \fBsvc.startd\fR
 170 provides a common set of service reporting and logging mechanisms.
 171 .sp
 172 .LP
 173 Reporting properties \fBsvc.startd\fR updates a common set of properties on all
 174 services it manages. These properties are a common interface that can be used
 175 to take action based on service instance health. The \fBsvcs\fR(1) command can
 176 be used to easily display these properties.
 177 .sp
 178 .ne 2
 179 .na
 180 \fB\fBrestarter/state\fR\fR
 181 .ad
 182 .br
 183 .na
 184 \fB\fBrestarter/next_state\fR\fR
 185 .ad
 186 .sp .6
 187 .RS 4n
 188 The current and next (if currently in transition) state for an instance.


 232 .na
 233 \fB\fBrestarter/contract\fR\fR
 234 .ad
 235 .sp .6
 236 .RS 4n
 237 The primary process contract ID, if any, that under which the service instance
 238 is executing.
 239 .RE
 240 
 241 .sp
 242 .LP
 243 \fBLogs\fR
 244 .sp
 245 .LP
 246 By default, \fBsvc.startd\fR provides logging of significant restarter actions
 247 for the service as well as method standard output and standard error file
 248 descriptors to \fB/var/svc/log/\fIservice\fR:\fIinstance\fR.log\fR. The level
 249 of logging to system global locations like \fB/var/svc/log/svc.startd.log\fR
 250 and \fBsyslog\fR is controlled by the \fBoptions/logging\fR property.
 251 .SS "SERVICE DEFINITION"
 252 .sp
 253 .LP
 254 When developing or configuring a service managed by \fBsvc.startd\fR, a common
 255 set of properties are used to affect the interaction between the service
 256 instance and the restarter.
 257 .sp
 258 .LP
 259 \fBMethods\fR
 260 .sp
 261 .LP
 262 The general form of methods for the fork/exec model provided by
 263 \fBsvc.startd\fR are presented in \fBsmf_method\fR(5). The following methods
 264 are supported as required or optional by services managed by \fBsvc.startd\fR.
 265 .sp
 266 .ne 2
 267 .na
 268 \fB\fBrefresh\fR\fR
 269 .ad
 270 .RS 11n
 271 Reload any appropriate configuration parameters from the repository or
 272 \fBconfig\fR file, without interrupting service. This is often implemented
 273 using \fBSIGHUP\fR for system daemons. If the service is unable to recognize


 334 .sp
 335 .ne 2
 336 .na
 337 \fB\fBgeneral/restarter\fR\fR
 338 .ad
 339 .sp .6
 340 .RS 4n
 341 If this FMRI property is empty or set to
 342 \fBsvc:/system/svc/restarter:default\fR, the service is managed by
 343 \fBsvc.startd\fR. Otherwise, the restarter specified is responsible (once it is
 344 available) for managing the service.
 345 .RE
 346 
 347 .sp
 348 .ne 2
 349 .na
 350 \fB\fBgeneral/single_instance\fR\fR
 351 .ad
 352 .sp .6
 353 .RS 4n
 354 If \fBsingle_instance\fR is set to true, \fBsvc.startd\fR only allows one
 355 instance of this service to transition to online or degraded at any time.


 356 .RE
 357 
 358 .sp
 359 .LP
 360 Additionally, \fBsvc.startd\fR managed services can define the optional
 361 properties listed below in the \fBstartd\fR property group.
 362 .sp
 363 .ne 2
 364 .na
 365 \fB\fBstartd/critical_failure_count\fR
 366 .ad
 367 .br
 368 .na
 369 \fBstartd/critical_failure_period\fR\fR
 370 .ad
 371 .sp .6
 372 .RS 4n
 373 The \fBcritical_failure_count\fR and \fBcritical_failure_period\fR properties
 374 together specify the maximum number of service failures allowed in a given
 375 time interval before \fBsvc.startd\fR transitions the service to maintenance.


 409 .ad
 410 .sp .6
 411 .RS 4n
 412 The \fBneed_session\fR property, if set to true, indicates that the instance
 413 should be launched in its own session. The default is not to do so.
 414 .RE
 415 
 416 .sp
 417 .ne 2
 418 .na
 419 \fB\fBstartd/utmpx_prefix\fR\fR
 420 .ad
 421 .sp .6
 422 .RS 4n
 423 The \fButmpx_prefix\fR string property defines that the instance requires a
 424 valid \fButmpx\fR entry prior to start method execution. The default is not to
 425 create a \fButmpx\fR entry.
 426 .RE
 427 
 428 .SS "SERVICE FAILURE"
 429 .sp
 430 .LP
 431 \fBsvc.startd\fR assumes that a method has failed if it returns a non-zero exit
 432 code or if fails to complete before the timeout specified expires. If
 433 \fB$SMF_EXIT_ERR_CONFIG\fR or \fB$SMF_EXIT_ERR_FATAL\fR is returned,
 434 \fBsvc.startd\fR immediately places the service in the maintenance state. For
 435 all other failures, \fBsvc.startd\fR places the service in the offline state.
 436 If a service is offline and its dependencies are satisfied, \fBsvc.startd\fR
 437 tries again to start the service (see \fBsmf\fR(5)).
 438 .sp
 439 .LP
 440 If a contract or transient service does not return from its start method before
 441 its defined timeout elapses, \fBsvc.startd\fR sends a \fBSIGKILL\fR to the
 442 method, and returns the service to the offline state.
 443 .sp
 444 .LP
 445 If three failures happen in a row, or if the service is restarting more than
 446 once a second, \fBsvc.startd\fR places the service in the maintenance state.
 447 .sp
 448 .LP
 449 The conditions of service failure are defined by a combination of the service
 450 model (defined by the \fBstartd/duration\fR property) and the value of the


 475 .sp
 476 .LP
 477 The last two conditions may be ignored by the service by specifying core and/or
 478 signal in \fBstartd/ignore_error\fR.
 479 .sp
 480 .LP
 481 Defining a service as transient means that \fBsvc.startd\fR does not track
 482 processes for that service. Thus, the potential faults described for contract
 483 model services are not considered failures for transient services. A transient
 484 service only enters the maintenance state if one of the method failure
 485 conditions occurs.
 486 .sp
 487 .LP
 488 "\fBWait\fR" model services are restarted whenever the child process associated
 489 with the service exits. A child process that exits is not considered an error
 490 for "\fBwait\fR" model services, and repeated failures do not lead to a
 491 transition to maintenance state. However, a wait service which is repeatedly
 492 exiting with an error that exceeds the default rate (5 failures/second) will be
 493 throttled back so that the service only restarts once per second.
 494 .SS "LEGACY SERVICES"
 495 .sp
 496 .LP
 497 \fBsvc.startd\fR continues to provide support for services invoked during the
 498 startup run level transitions. Each \fB/etc/rc?.d\fR directory is processed
 499 after all managed services which constitute the equivalent run level milestone
 500 have transitioned to the online state. Standard \fBinit\fR scripts placed in
 501 the \fB/etc/rc?.d\fR directories are run in the order of their sequence
 502 numbers.
 503 .sp
 504 .LP
 505 The milestone to run-level mapping is:
 506 .sp
 507 .ne 2
 508 .na
 509 \fB\fBmilestone/single-user\fR\fR
 510 .ad
 511 .sp .6
 512 .RS 4n
 513 Single-user (\fBS\fR)
 514 .RE
 515 
 516 .sp


 525 
 526 .sp
 527 .ne 2
 528 .na
 529 \fB\fBmilestone/multi-user-server\fR\fR
 530 .ad
 531 .sp .6
 532 .RS 4n
 533 Multi-user with network services (\fB3\fR)
 534 .RE
 535 
 536 .sp
 537 .LP
 538 Additionally, \fBsvc.startd\fR gives these legacy services visibility in SMF by
 539 inserting an instance per script into the repository. These legacy instances
 540 are visible using standard SMF interfaces such as \fBsvcs\fR(1), always appear
 541 in the \fBLEGACY-RUN\fR state, cannot be modified, and can not be specified as
 542 dependencies of other services. The initial start time of the legacy service is
 543 captured as a convenience for the administrator.
 544 .SH FILES
 545 .sp
 546 .ne 2
 547 .na
 548 \fB\fB/var/svc/log\fR\fR
 549 .ad
 550 .RS 21n
 551 Directory where \fBsvc.startd\fR stores log files.
 552 .RE
 553 
 554 .sp
 555 .ne 2
 556 .na
 557 \fB\fB/etc/svc/volatile\fR\fR
 558 .ad
 559 .RS 21n
 560 Directory where \fBsvc.startd\fR stores log files in early stages of boot,
 561 before \fB/var\fR is mounted read-write.
 562 .RE
 563 
 564 .SH EXAMPLE
 565 .LP
 566 \fBExample 1 \fRTurning on Verbose Logging
 567 .sp
 568 .LP
 569 To turn on verbose logging, type the following:
 570 
 571 .sp
 572 .in +2
 573 .nf
 574 # /usr/sbin/svccfg -s system/svc/restarter:default
 575 svc:/system/svc/restarter:default> addpg options application
 576 svc:/system/svc/restarter:default> setprop options/logging = \e
 577 astring: verbose
 578 svc:/system/svc/restarter:default> exit
 579 .fi
 580 .in -2
 581 .sp
 582 
 583 .sp
 584 .LP
 585 This request will take effect on the next restart of \fBsvc.startd\fR.
 586 
 587 .SH SEE ALSO
 588 .sp
 589 .LP
 590 \fBsvcs\fR(1), \fBsvcprop\fR(1), \fBkernel\fR(1M), \fBinit\fR(1M),
 591 \fBsvcadm\fR(1M), \fBsvccfg\fR(1M), \fBsvc.configd\fR(1M), \fBsetsid\fR(2),
 592 \fBsyslog\fR(3C), \fBlibscf\fR(3LIB), \fBscf_value_is_type\fR(3SCF),
 593 \fBcontract\fR(4), \fBinit.d\fR(4), \fBprocess\fR(4), \fBinittab\fR(4),
 594 \fBattributes\fR(5), \fBsmf\fR(5), \fBsmf_method\fR(5)
   1 '\" te
   2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 2019 Joyent, Inc.
   4 .\" 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.
   5 .\" 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.
   6 .\" 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]
   7 .TH SVC.STARTD 1M "Dec 11, 2019"
   8 .SH NAME
   9 svc.startd \- Service Management Facility master restarter
  10 .SH SYNOPSIS

  11 .nf
  12 \fB/lib/svc/bin/svc.startd\fR
  13 .fi
  14 
  15 .LP
  16 .nf
  17 \fBsvc:/system/svc/restarter:default\fR
  18 .fi
  19 
  20 .SH DESCRIPTION


  21 \fBsvc.startd\fR is the master restarter daemon for Service Management Facility
  22 (SMF) and the default restarter for all services. \fBsvc.startd\fR starts,
  23 stops, and restarts services based on administrative requests, system failures,
  24 or application failures.
  25 .sp
  26 .LP
  27 \fBsvc.startd\fR maintains service state, as well as being responsible for
  28 managing faults in accordance with the dependencies of each service.
  29 .sp
  30 .LP
  31 \fBsvc.startd\fR is invoked automatically during system startup. It is
  32 restarted if any failures occur. \fBsvc.startd\fR should never be invoked
  33 directly.
  34 .sp
  35 .LP
  36 See \fBsmf_restarter\fR(5) for information on configuration and behavior common
  37 to all restarters.
  38 .sp
  39 .LP
  40 \fBsvcs\fR(1) reports status for all services managed by the Service
  41 Configuration Facility. \fBsvcadm\fR(1M) allows manipulation of service
  42 instances with respect to the service's restarter.
  43 .SS "Environment Variables"


  44 Environment variables with the "SMF_" prefix are reserved and may be
  45 overwritten.
  46 .sp
  47 .LP
  48 \fBsvc.startd\fR supplies the "SMF_" environment variables specified in
  49 \fBsmf_method\fR(5) to the method. PATH is set to "\fB/usr/sbin:/usr/bin\fR" by
  50 default. By default, all other environment variables supplied to
  51 \fBsvc.startd\fR are those inherited from \fBinit\fR(1M).
  52 .sp
  53 .LP
  54 Duplicate entries are reduced to a single entry. The value used is undefined.
  55 Environment entries that are not prefixed with "<\fIname\fR>=" are ignored.
  56 .SS "Restarter Options"


  57 \fBsvc.startd\fR is not configured by command line options. Instead,
  58 configuration is read from the service configuration repository. You can use
  59 \fBsvccfg\fR(1M) to set all options and properties.
  60 .sp
  61 .LP
  62 The following configuration variables in the \fBoptions\fR property group are
  63 available to developers and administrators:
  64 .sp
  65 .ne 2
  66 .na
  67 \fB\fBboot_messages\fR\fR
  68 .ad
  69 .sp .6
  70 .RS 4n
  71 An \fIastring\fR (as defined in \fBscf_value_is_type\fR; see
  72 \fBscf_value_is_type\fR(3SCF)) that describes the default level of messages to
  73 print to the console during boot. The supported message options include
  74 \fBquiet\fR and \fBverbose\fR. The \fBquiet\fR option prints minimal messages
  75 to console during boot. The \fBverbose\fR option prints a single message per
  76 service started to indicate success or failure. You can use the \fBboot\fR


 135 .ne 2
 136 .na
 137 \fB\fBsystem/reconfigure\fR\fR
 138 .ad
 139 .sp .6
 140 .RS 4n
 141 Indicates that a reconfiguration reboot has been requested. Services with
 142 actions that must key off of a reconfiguration reboot may check that this
 143 property exists and is set to 1 to confirm a reconfiguration boot has been
 144 requested.
 145 .sp
 146 This property is managed by \fBsvc.startd\fR and should not be modified by the
 147 administrator.
 148 .RE
 149 
 150 .sp
 151 .LP
 152 Configuration errors, such as disabling \fBsvc.startd\fR are logged by
 153 \fBsyslog\fR, but ignored.
 154 .SS "SERVICE STATES"


 155 Services managed by \fBsvc.startd\fR can appear in any of the states described
 156 in \fBsmf\fR(5). The state definitions are unmodified by this restarter.
 157 .SS "SERVICE REPORTING"


 158 In addition to any logging done by the managed service, \fBsvc.startd\fR
 159 provides a common set of service reporting and logging mechanisms.
 160 .sp
 161 .LP
 162 Reporting properties \fBsvc.startd\fR updates a common set of properties on all
 163 services it manages. These properties are a common interface that can be used
 164 to take action based on service instance health. The \fBsvcs\fR(1) command can
 165 be used to easily display these properties.
 166 .sp
 167 .ne 2
 168 .na
 169 \fB\fBrestarter/state\fR\fR
 170 .ad
 171 .br
 172 .na
 173 \fB\fBrestarter/next_state\fR\fR
 174 .ad
 175 .sp .6
 176 .RS 4n
 177 The current and next (if currently in transition) state for an instance.


 221 .na
 222 \fB\fBrestarter/contract\fR\fR
 223 .ad
 224 .sp .6
 225 .RS 4n
 226 The primary process contract ID, if any, that under which the service instance
 227 is executing.
 228 .RE
 229 
 230 .sp
 231 .LP
 232 \fBLogs\fR
 233 .sp
 234 .LP
 235 By default, \fBsvc.startd\fR provides logging of significant restarter actions
 236 for the service as well as method standard output and standard error file
 237 descriptors to \fB/var/svc/log/\fIservice\fR:\fIinstance\fR.log\fR. The level
 238 of logging to system global locations like \fB/var/svc/log/svc.startd.log\fR
 239 and \fBsyslog\fR is controlled by the \fBoptions/logging\fR property.
 240 .SS "SERVICE DEFINITION"


 241 When developing or configuring a service managed by \fBsvc.startd\fR, a common
 242 set of properties are used to affect the interaction between the service
 243 instance and the restarter.
 244 .sp
 245 .LP
 246 \fBMethods\fR
 247 .sp
 248 .LP
 249 The general form of methods for the fork/exec model provided by
 250 \fBsvc.startd\fR are presented in \fBsmf_method\fR(5). The following methods
 251 are supported as required or optional by services managed by \fBsvc.startd\fR.
 252 .sp
 253 .ne 2
 254 .na
 255 \fB\fBrefresh\fR\fR
 256 .ad
 257 .RS 11n
 258 Reload any appropriate configuration parameters from the repository or
 259 \fBconfig\fR file, without interrupting service. This is often implemented
 260 using \fBSIGHUP\fR for system daemons. If the service is unable to recognize


 321 .sp
 322 .ne 2
 323 .na
 324 \fB\fBgeneral/restarter\fR\fR
 325 .ad
 326 .sp .6
 327 .RS 4n
 328 If this FMRI property is empty or set to
 329 \fBsvc:/system/svc/restarter:default\fR, the service is managed by
 330 \fBsvc.startd\fR. Otherwise, the restarter specified is responsible (once it is
 331 available) for managing the service.
 332 .RE
 333 
 334 .sp
 335 .ne 2
 336 .na
 337 \fB\fBgeneral/single_instance\fR\fR
 338 .ad
 339 .sp .6
 340 .RS 4n
 341 This was originally supposed to ensure that only one service instance could be
 342 in online or degraded state at once; however, it was never implemented, and is
 343 often incorrectly specified in multi-instance manifests. As such, it should be
 344 considered obsolete and not specified in new manifests.
 345 .RE
 346 
 347 .sp
 348 .LP
 349 Additionally, \fBsvc.startd\fR managed services can define the optional
 350 properties listed below in the \fBstartd\fR property group.
 351 .sp
 352 .ne 2
 353 .na
 354 \fB\fBstartd/critical_failure_count\fR
 355 .ad
 356 .br
 357 .na
 358 \fBstartd/critical_failure_period\fR\fR
 359 .ad
 360 .sp .6
 361 .RS 4n
 362 The \fBcritical_failure_count\fR and \fBcritical_failure_period\fR properties
 363 together specify the maximum number of service failures allowed in a given
 364 time interval before \fBsvc.startd\fR transitions the service to maintenance.


 398 .ad
 399 .sp .6
 400 .RS 4n
 401 The \fBneed_session\fR property, if set to true, indicates that the instance
 402 should be launched in its own session. The default is not to do so.
 403 .RE
 404 
 405 .sp
 406 .ne 2
 407 .na
 408 \fB\fBstartd/utmpx_prefix\fR\fR
 409 .ad
 410 .sp .6
 411 .RS 4n
 412 The \fButmpx_prefix\fR string property defines that the instance requires a
 413 valid \fButmpx\fR entry prior to start method execution. The default is not to
 414 create a \fButmpx\fR entry.
 415 .RE
 416 
 417 .SS "SERVICE FAILURE"


 418 \fBsvc.startd\fR assumes that a method has failed if it returns a non-zero exit
 419 code or if fails to complete before the timeout specified expires. If
 420 \fB$SMF_EXIT_ERR_CONFIG\fR or \fB$SMF_EXIT_ERR_FATAL\fR is returned,
 421 \fBsvc.startd\fR immediately places the service in the maintenance state. For
 422 all other failures, \fBsvc.startd\fR places the service in the offline state.
 423 If a service is offline and its dependencies are satisfied, \fBsvc.startd\fR
 424 tries again to start the service (see \fBsmf\fR(5)).
 425 .sp
 426 .LP
 427 If a contract or transient service does not return from its start method before
 428 its defined timeout elapses, \fBsvc.startd\fR sends a \fBSIGKILL\fR to the
 429 method, and returns the service to the offline state.
 430 .sp
 431 .LP
 432 If three failures happen in a row, or if the service is restarting more than
 433 once a second, \fBsvc.startd\fR places the service in the maintenance state.
 434 .sp
 435 .LP
 436 The conditions of service failure are defined by a combination of the service
 437 model (defined by the \fBstartd/duration\fR property) and the value of the


 462 .sp
 463 .LP
 464 The last two conditions may be ignored by the service by specifying core and/or
 465 signal in \fBstartd/ignore_error\fR.
 466 .sp
 467 .LP
 468 Defining a service as transient means that \fBsvc.startd\fR does not track
 469 processes for that service. Thus, the potential faults described for contract
 470 model services are not considered failures for transient services. A transient
 471 service only enters the maintenance state if one of the method failure
 472 conditions occurs.
 473 .sp
 474 .LP
 475 "\fBWait\fR" model services are restarted whenever the child process associated
 476 with the service exits. A child process that exits is not considered an error
 477 for "\fBwait\fR" model services, and repeated failures do not lead to a
 478 transition to maintenance state. However, a wait service which is repeatedly
 479 exiting with an error that exceeds the default rate (5 failures/second) will be
 480 throttled back so that the service only restarts once per second.
 481 .SS "LEGACY SERVICES"


 482 \fBsvc.startd\fR continues to provide support for services invoked during the
 483 startup run level transitions. Each \fB/etc/rc?.d\fR directory is processed
 484 after all managed services which constitute the equivalent run level milestone
 485 have transitioned to the online state. Standard \fBinit\fR scripts placed in
 486 the \fB/etc/rc?.d\fR directories are run in the order of their sequence
 487 numbers.
 488 .sp
 489 .LP
 490 The milestone to run-level mapping is:
 491 .sp
 492 .ne 2
 493 .na
 494 \fB\fBmilestone/single-user\fR\fR
 495 .ad
 496 .sp .6
 497 .RS 4n
 498 Single-user (\fBS\fR)
 499 .RE
 500 
 501 .sp


 510 
 511 .sp
 512 .ne 2
 513 .na
 514 \fB\fBmilestone/multi-user-server\fR\fR
 515 .ad
 516 .sp .6
 517 .RS 4n
 518 Multi-user with network services (\fB3\fR)
 519 .RE
 520 
 521 .sp
 522 .LP
 523 Additionally, \fBsvc.startd\fR gives these legacy services visibility in SMF by
 524 inserting an instance per script into the repository. These legacy instances
 525 are visible using standard SMF interfaces such as \fBsvcs\fR(1), always appear
 526 in the \fBLEGACY-RUN\fR state, cannot be modified, and can not be specified as
 527 dependencies of other services. The initial start time of the legacy service is
 528 captured as a convenience for the administrator.
 529 .SH FILES

 530 .ne 2
 531 .na
 532 \fB\fB/var/svc/log\fR\fR
 533 .ad
 534 .RS 21n
 535 Directory where \fBsvc.startd\fR stores log files.
 536 .RE
 537 
 538 .sp
 539 .ne 2
 540 .na
 541 \fB\fB/etc/svc/volatile\fR\fR
 542 .ad
 543 .RS 21n
 544 Directory where \fBsvc.startd\fR stores log files in early stages of boot,
 545 before \fB/var\fR is mounted read-write.
 546 .RE
 547 
 548 .SH EXAMPLE

 549 \fBExample 1 \fRTurning on Verbose Logging
 550 .sp
 551 .LP
 552 To turn on verbose logging, type the following:
 553 
 554 .sp
 555 .in +2
 556 .nf
 557 # /usr/sbin/svccfg -s system/svc/restarter:default
 558 svc:/system/svc/restarter:default> addpg options application
 559 svc:/system/svc/restarter:default> setprop options/logging = \e
 560 astring: verbose
 561 svc:/system/svc/restarter:default> exit
 562 .fi
 563 .in -2
 564 .sp
 565 
 566 .sp
 567 .LP
 568 This request will take effect on the next restart of \fBsvc.startd\fR.
 569 
 570 .SH SEE ALSO


 571 \fBsvcs\fR(1), \fBsvcprop\fR(1), \fBkernel\fR(1M), \fBinit\fR(1M),
 572 \fBsvcadm\fR(1M), \fBsvccfg\fR(1M), \fBsvc.configd\fR(1M), \fBsetsid\fR(2),
 573 \fBsyslog\fR(3C), \fBlibscf\fR(3LIB), \fBscf_value_is_type\fR(3SCF),
 574 \fBcontract\fR(4), \fBinit.d\fR(4), \fBprocess\fR(4), \fBinittab\fR(4),
 575 \fBattributes\fR(5), \fBsmf\fR(5), \fBsmf_method\fR(5)