Project

General

Profile

Actions

Feature #15320

open

Add support for SMF_EXIT_TEMP_DISABLE

Added by Andy Fiddaman 26 days ago.

Status:
In Progress
Priority:
Low
Assignee:
Category:
smf
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Inspired by OpenSolaris bug 6245225 which has some more detail.

"smf(7) methods should be able to exit with a special code that indicates they wish to self-disable."

At present, services that wish to disable themselves from their own start method employ a trick of spawning a sleep 5 in the background before exiting. According to the bug referenced above, this is so that the effect of the svcadm disable propagates through to the repository. Otherwise the service may start up again before that change reaches visibility.
It's a hack and it's used in 7 separate SMF method scripts in gate.

We should follow the recommendation in that bug and implement a new exit status that a method script can use to indicate that it should be temporarily disabled. Temporary so that the script will run again on next boot (or administrator enable) in case the reason it decided to disable itself has changed. Solaris has SMF_EXIT_TEMP_DISABLE so it seems reasonable to use the same name here.

Solaris requires that this exit code is used via a wrapper that records the reason as a service property. That may also be something we wish to do, and we have general/reason that was introduced as part of #12721

No data to display

Actions

Also available in: Atom PDF