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

Gary Mills gary_mills at fastmail.fm
Mon Nov 18 19:02:25 UTC 2013


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?

>   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.

>   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.

-- 
-Gary Mills-		-refurb-		-Winnipeg, Manitoba, Canada-



More information about the OpenIndiana-discuss mailing list