Print this page
10451 smf_method(5) man page needs updates after 7928
   1 '\" te

   2 .\" Copyright (c) 2009, 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
   4 .\"  See the License for the specific language governing permissions and limitations under the License. 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
   5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH SMF_METHOD 5 "June 6, 2016"
   7 .SH NAME
   8 smf_method \- service management framework conventions for methods
   9 .SH DESCRIPTION
  10 .LP
  11 The class of services managed by \fBsvc.startd\fR(1M) in the service management
  12 framework, \fBsmf\fR(5), consists of applications that fit a simple
  13 \fBfork\fR(2)-\fBexec\fR(2) model. The \fBsvc.startd\fR(1M) master daemon and
  14 other restarters support the \fBfork\fR(2)-\fBexec\fR(2) model, potentially
  15 with additional capabilities. The \fBsvc.startd\fR(1M) daemon and other
  16 restarters require that the methods which activate, manipulate, or examine a
  17 service instance follow the conventions described in this manual page.
  18 .SS "Invocation form"
  19 .LP
  20 The form of a method invocation is not dictated by convention. In some cases, a
  21 method invocation might consist of the direct invocation of the daemon or other
  22 binary executable that provides the service. For cases in which an executable
  23 script or other mediating executable is used, the convention recommends the
  24 form:
  25 .sp
  26 .in +2


 252 service implementation.
 253 .RE
 254 
 255 .SS "Exiting and Exit Status"
 256 .LP
 257 The required behavior of a start method is to delay exiting until the service
 258 instance is ready to answer requests or is otherwise functional.
 259 .sp
 260 .LP
 261 The following exit status codes are defined in \fB<libscf.h>\fR and in the
 262 shell support file.
 263 .sp
 264 
 265 .sp
 266 .TS
 267 l l l
 268 l l l .
 269 \fBSMF_EXIT_OK\fR       \fB0\fR T{
 270 Method exited, performing its operation successfully.
 271 T}




 272 \fBSMF_EXIT_ERR_FATAL\fR        \fB95\fR        T{
 273 Method failed fatally and is unrecoverable without administrative intervention.
 274 T}
 275 \fBSMF_EXIT_ERR_CONFIG\fR       \fB96\fR        T{
 276 Unrecoverable configuration error. A common condition that returns this exit status is the absence of required configuration files for an enabled service instance.
 277 T}
 278 \fBSMF_EXIT_ERR_NOSMF\fR        \fB99\fR        T{
 279 Method has been mistakenly invoked outside the \fBsmf\fR(5) facility. Services that depend on \fBsmf\fR(5) capabilities should exit with this status value.
 280 T}
 281 \fBSMF_EXIT_ERR_PERM\fR \fB100\fR       T{
 282 Method requires a form of permission such as file access, privilege, authorization, or other credential that is not available when invoked.
 283 T}
 284 \fBSMF_EXIT_ERR_OTHER\fR        \fBnon-zero\fR  T{
 285 Any non-zero exit status from a method is treated as an unknown error. A series of unknown errors can be diagnosed as a fault by the restarter or on behalf of the restarter.
 286 T}
 287 .TE
 288 
 289 .sp
 290 .LP
 291 Use of a precise exit code allows the responsible restarter to categorize an


   1 '\" te
   2 .\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
   3 .\" Copyright (c) 2009, Sun Microsystems, 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
   5 .\"  See the License for the specific language governing permissions and limitations under the License. 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
   6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH SMF_METHOD 5 "February 25, 2019"
   8 .SH NAME
   9 smf_method \- service management framework conventions for methods
  10 .SH DESCRIPTION
  11 .LP
  12 The class of services managed by \fBsvc.startd\fR(1M) in the service management
  13 framework, \fBsmf\fR(5), consists of applications that fit a simple
  14 \fBfork\fR(2)-\fBexec\fR(2) model. The \fBsvc.startd\fR(1M) master daemon and
  15 other restarters support the \fBfork\fR(2)-\fBexec\fR(2) model, potentially
  16 with additional capabilities. The \fBsvc.startd\fR(1M) daemon and other
  17 restarters require that the methods which activate, manipulate, or examine a
  18 service instance follow the conventions described in this manual page.
  19 .SS "Invocation form"
  20 .LP
  21 The form of a method invocation is not dictated by convention. In some cases, a
  22 method invocation might consist of the direct invocation of the daemon or other
  23 binary executable that provides the service. For cases in which an executable
  24 script or other mediating executable is used, the convention recommends the
  25 form:
  26 .sp
  27 .in +2


 253 service implementation.
 254 .RE
 255 
 256 .SS "Exiting and Exit Status"
 257 .LP
 258 The required behavior of a start method is to delay exiting until the service
 259 instance is ready to answer requests or is otherwise functional.
 260 .sp
 261 .LP
 262 The following exit status codes are defined in \fB<libscf.h>\fR and in the
 263 shell support file.
 264 .sp
 265 
 266 .sp
 267 .TS
 268 l l l
 269 l l l .
 270 \fBSMF_EXIT_OK\fR       \fB0\fR T{
 271 Method exited, performing its operation successfully.
 272 T}
 273 \fBSMF_EXIT_NODAEMON\fR \fB94\fR        T{
 274 Method exited successfully but purposefully leaves no processes remaining in
 275 the contract; it should be treated as if it had a transient service model.
 276 T}
 277 \fBSMF_EXIT_ERR_FATAL\fR        \fB95\fR        T{
 278 Method failed fatally and is unrecoverable without administrative intervention.
 279 T}
 280 \fBSMF_EXIT_ERR_CONFIG\fR       \fB96\fR        T{
 281 Unrecoverable configuration error. A common condition that returns this exit status is the absence of required configuration files for an enabled service instance.
 282 T}
 283 \fBSMF_EXIT_ERR_NOSMF\fR        \fB99\fR        T{
 284 Method has been mistakenly invoked outside the \fBsmf\fR(5) facility. Services that depend on \fBsmf\fR(5) capabilities should exit with this status value.
 285 T}
 286 \fBSMF_EXIT_ERR_PERM\fR \fB100\fR       T{
 287 Method requires a form of permission such as file access, privilege, authorization, or other credential that is not available when invoked.
 288 T}
 289 \fBSMF_EXIT_ERR_OTHER\fR        \fBnon-zero\fR  T{
 290 Any non-zero exit status from a method is treated as an unknown error. A series of unknown errors can be diagnosed as a fault by the restarter or on behalf of the restarter.
 291 T}
 292 .TE
 293 
 294 .sp
 295 .LP
 296 Use of a precise exit code allows the responsible restarter to categorize an