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
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
292 error response as likely to be intermittent and worth pursuing restart or
293 permanent and request administrative intervention.
294 .SS "Timeouts"
295 .LP
296 Each method can have an independent timeout, given in seconds. The choice of a
297 particular timeout should be based on site expectations for detecting a method
298 failure due to non-responsiveness. Sites with replicated filesystems or other
299 failover resources can elect to lengthen method timeouts from the default.
300 Sites with no remote resources can elect to shorten the timeouts. Method
301 timeout is specified by the \fBtimeout_seconds\fR property.
302 .sp
303 .LP
|
1 '\" te
2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2015 RackTop Systems.
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 "March 2, 2017"
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
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_ERR_FATAL\fR \fB95\fR T{
274 Method failed fatally and is unrecoverable without administrative intervention.
275 T}
276 \fBSMF_EXIT_ERR_CONFIG\fR \fB96\fR T{
277 Unrecoverable configuration error. A common condition that returns this exit status is the absence of required configuration files for an enabled service instance.
278 T}
279 \fBSMF_EXIT_ERR_NOSMF\fR \fB99\fR T{
280 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.
281 T}
282 \fBSMF_EXIT_ERR_PERM\fR \fB100\fR T{
283 Method requires a form of permission such as file access, privilege, authorization, or other credential that is not available when invoked.
284 T}
285 \fBSMF_EXIT_TEMP_TRANSIENT\fR \fB101\fR T{
286 Method that is normally non-transient is temporarily transient. This is not an error condition and a service returning this value will not be restarted.
287 T}
288 \fBSMF_EXIT_ERR_OTHER\fR \fBnon-zero\fR T{
289 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.
290 T}
291 .TE
292
293 .sp
294 .LP
295 Use of a precise exit code allows the responsible restarter to categorize an
296 error response as likely to be intermittent and worth pursuing restart or
297 permanent and request administrative intervention.
298 .SS "Timeouts"
299 .LP
300 Each method can have an independent timeout, given in seconds. The choice of a
301 particular timeout should be based on site expectations for detecting a method
302 failure due to non-responsiveness. Sites with replicated filesystems or other
303 failover resources can elect to lengthen method timeouts from the default.
304 Sites with no remote resources can elect to shorten the timeouts. Method
305 timeout is specified by the \fBtimeout_seconds\fR property.
306 .sp
307 .LP
|