Print this page
7928 Add support for SMF_EXIT_TEMP_TRANSIENT


 167            the particular service implementation.
 168 
 169 
 170    Exiting and Exit Status
 171        The required behavior of a start method is to delay exiting until the
 172        service instance is ready to answer requests or is otherwise
 173        functional.
 174 
 175 
 176        The following exit status codes are defined in <libscf.h> and in   the
 177        shell support file.
 178 
 179 
 180 
 181 
 182        SMF_EXIT_OK           0          Method exited, performing its operation successfully.
 183        SMF_EXIT_ERR_FATAL    95         Method failed fatally and is unrecoverable without administrative intervention.
 184        SMF_EXIT_ERR_CONFIG   96         Unrecoverable configuration error. A common condition that returns this exit status is the absence of required configuration files for an enabled service instance.
 185        SMF_EXIT_ERR_NOSMF    99         Method has been mistakenly invoked outside the smf(5) facility. Services that depend on smf(5) capabilities should exit with this status value.
 186        SMF_EXIT_ERR_PERM     100        Method requires a form of permission such as file access, privilege, authorization, or other credential that is not available when invoked.

 187        SMF_EXIT_ERR_OTHER    non-zero   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.
 188 
 189 
 190 
 191        Use of a precise exit code allows the responsible restarter to
 192        categorize an error response as likely to be intermittent and worth
 193        pursuing restart or permanent and request administrative intervention.
 194 
 195    Timeouts
 196        Each method can have an independent timeout, given in seconds. The
 197        choice of a particular timeout should be based on site expectations for
 198        detecting a method failure due to non-responsiveness. Sites with
 199        replicated filesystems or other failover resources can elect to
 200        lengthen method timeouts from the default.  Sites with no remote
 201        resources can elect to shorten the timeouts. Method timeout is
 202        specified by the timeout_seconds property.
 203 
 204 
 205        If you specify 0 timeout_seconds for a method, it declares to the
 206        restarter that there is no timeout for the service. This setting is not


 387            Definitions of exit status codes.
 388 
 389 
 390 SEE ALSO
 391        zonename(1), coreadm(1M), inetd(1M), svccfg(1M), svc.startd(1M),
 392        exec(2), fork(2), getdefaultproj(3PROJECT), exec_attr(4), project(4),
 393        service_bundle(4), attributes(5), privileges(5), rbac(5), smf(5),
 394        smf_bootstrap(5), zones(5), security-flags(5)
 395 
 396 NOTES
 397        The present version of smf(5) does not support multiple repositories.
 398 
 399 
 400        When a service is configured to be started as root but with privileges
 401        different from limit_privileges, the resulting process is privilege
 402        aware.  This can be surprising to developers who expect seteuid(<non-
 403        zero UID>) to reduce privileges to basic      or less.
 404 
 405 
 406 
 407                                  June 6, 2016                    SMF_METHOD(5)


 167            the particular service implementation.
 168 
 169 
 170    Exiting and Exit Status
 171        The required behavior of a start method is to delay exiting until the
 172        service instance is ready to answer requests or is otherwise
 173        functional.
 174 
 175 
 176        The following exit status codes are defined in <libscf.h> and in   the
 177        shell support file.
 178 
 179 
 180 
 181 
 182        SMF_EXIT_OK               0          Method exited, performing its operation successfully.
 183        SMF_EXIT_ERR_FATAL        95         Method failed fatally and is unrecoverable without administrative intervention.
 184        SMF_EXIT_ERR_CONFIG       96         Unrecoverable configuration error. A common condition that returns this exit status is the absence of required configuration files for an enabled service instance.
 185        SMF_EXIT_ERR_NOSMF        99         Method has been mistakenly invoked outside the smf(5) facility. Services that depend on smf(5) capabilities should exit with this status value.
 186        SMF_EXIT_ERR_PERM         100        Method requires a form of permission such as file access, privilege, authorization, or other credential that is not available when invoked.
 187        SMF_EXIT_TEMP_TRANSIENT   101        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.
 188        SMF_EXIT_ERR_OTHER        non-zero   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.
 189 
 190 
 191 
 192        Use of a precise exit code allows the responsible restarter to
 193        categorize an error response as likely to be intermittent and worth
 194        pursuing restart or permanent and request administrative intervention.
 195 
 196    Timeouts
 197        Each method can have an independent timeout, given in seconds. The
 198        choice of a particular timeout should be based on site expectations for
 199        detecting a method failure due to non-responsiveness. Sites with
 200        replicated filesystems or other failover resources can elect to
 201        lengthen method timeouts from the default.  Sites with no remote
 202        resources can elect to shorten the timeouts. Method timeout is
 203        specified by the timeout_seconds property.
 204 
 205 
 206        If you specify 0 timeout_seconds for a method, it declares to the
 207        restarter that there is no timeout for the service. This setting is not


 388            Definitions of exit status codes.
 389 
 390 
 391 SEE ALSO
 392        zonename(1), coreadm(1M), inetd(1M), svccfg(1M), svc.startd(1M),
 393        exec(2), fork(2), getdefaultproj(3PROJECT), exec_attr(4), project(4),
 394        service_bundle(4), attributes(5), privileges(5), rbac(5), smf(5),
 395        smf_bootstrap(5), zones(5), security-flags(5)
 396 
 397 NOTES
 398        The present version of smf(5) does not support multiple repositories.
 399 
 400 
 401        When a service is configured to be started as root but with privileges
 402        different from limit_privileges, the resulting process is privilege
 403        aware.  This can be surprising to developers who expect seteuid(<non-
 404        zero UID>) to reduce privileges to basic      or less.
 405 
 406 
 407 
 408                                  March 2, 2017                   SMF_METHOD(5)