[OpenIndiana-discuss] Bug or feature in SMF? "svcadm restart" vs "disable+enable"

Jim Klimov jimklimov at cos.ru
Mon Nov 18 20:12:17 UTC 2013


Thanks for a response, replies inline.

On 2013-11-18 20:02, Gary Mills wrote:
> On Mon, Nov 18, 2013 at 03:27:42PM +0100, Jim Klimov wrote:
>>
>>    While testing my works on SMF inter-dependencies (such as with my
>> recent write-up on SMFization of local zones), I discovered that if
>> I run svcadm restart, then the dependency service (a zone) stops
>> first, and only when its state changes to "offline", the dependent
>> services (zones) begin to shut down. In the meanwhile, the dependency
>> service begins to start-up, allowing the dependents to restart later.
>
> Are you restarting the entire zone, or a service running within the
> zone?  According to svcadm(1M), a restart is equivalent to a full
> service "stop" followed by a "start".  Is `restart' mentioned in your
> manifest?  What do the logs say?

I am restarting the zone, which in the eyes of global zone's SMF
is now (after SMFization of the zones) jsut a slowly starting and
slowly stopping instance which displays the timing of interactions
with dependencies quite noticeably.

And as I said, for the dependent services there is a difference
which is my message's concern :(


>
>>    Apparently, this is not good: for example, if the dependency is a
>> database, and the dependent is a content-management server, the latter
>> will not be able to flush dirty data (if it must), close the database
>> connections and shut down cleanly - because the DBMS is no longer
>> available by the time the appserver begins to stop.
>
> The database should be dependant on the zone within which it runs, so
> that the database shuts down before the zone shuts down, and starts up
> after the zone starts up.  Short timeouts could be a problem too
> because the will prevent the database from shutting down properly.
> The logs should indicate if this happens.

Yes, of course. Being a service under its local zone's SMF control,
the database starts and stops correctly. And so does the appserver
in its zone. The problem is that when the appserver-zone depends on
the database-zone, and I do "svcadm restart database-zone" - this
zone does stop, and only afterwards does the appserver-zone begin
to stop (and the database-zone begins to start in the meanwhile).
This is different from "svcadm disable (-t) database-zone" which
stops the appserver-zone first and then begins the shutdown of
database-zone, and then restarts them both from cold state.

>
>>    So the question is: did I miss some intimate values of "restart_on"
>> or even some less documented options in "dependency" definitions,
>> which would cause "restart" to be processed as "disable; enable", or
>> is this a feature in SMF (can someone explain the rationale)? Or a bug?
>
> These are all documented in smf(5).  Last time I made use of them,
> they seemed to be correct.

Hence, if they are documented to be equivalent and act differently
in practice, the currently seen restart behavior is a bug. Right?

Thanks,
//Jim




More information about the OpenIndiana-discuss mailing list