On Tue, 27 Mar 2007, David Finberg wrote:

I'm answering myself since I want to piece together a few responses in 
case someone else is looking for answers.

> say I have some service, and I do
>        prop = scf_simple_prop_get(NULL, NULL, "config", "testval");
>        if (prop) {
>                if ((val = scf_simple_prop_next_boolean(prop)) != NULL)
>
> inside my service's executable.  What happens if svccfg is used to change 
> config/testval, the change is not committed via a refresh, but my service 
> dies and restarts.
>
> What I expected was that the old, i.e. the running (svcprop -s running -p 
> config/testval) state would be returned.  But instead, the current state of 
> the repository is returned.  Is this the right behavior?  And is there some 
> simple explanation of why I want that in this case, since I guess my 
> intuition is way off here.

I guess my intuition was better than I thought, since this behavior is 
incorrect.  See http://bugs.opensolaris.org/view_bug.do?bug_id=6539436 
There might be a use case for returning the repository state instead of 
the running snapshot, but I can't think of a good one.

This does mean that code in Solaris that uses these interfaces is probably 
doing the wrong thing, like bind, rmvolmgr, etc.  I see a few places where 
code is checking general/enabled, I think that works since general/enabled 
is a bit odd.  But as a service getting my configuration properties I 
would think I would essentially always want the running snapshot.

It might be nice to place this into the FAQ as well, in case developers 
are tempted to use these interfaces.

-- Dave

Reply via email to