Halton Huo wrote:
> I'm going to get auth_attr for give SMF service dynamically. I found
> most SMF service like nwam, snmp have property
> general/value_authorization.
> 
> $svcprop nwam|grep general/value_authorization
> general/value_authorization astring solaris.smf.manage.nwam
> $svcprop snmp|grep general/value_authorization
> general/value_authorization astring
> solaris.smf.manage.discovery.printers.snmp
> 
> ???Is it a right way to get auth_attr for a SMF service dynamically? If
> not, please ignore rest content.
> 
> So I wrote code to get this prop dynamically, see the attachment. I
> found two problems:
> 
> 1. scf_scope_get_service seems have problem. svc:/network/physical:nwam
> fail, while network/physical.
> 
> 2. Only can get entity_stability for group general. svcprop can get all.
> $svcprop nwam|grep ^general
> general/action_authorization astring solaris.smf.manage.nwam
> general/enabled boolean false
> general/value_authorization astring solaris.smf.manage.nwam
> general/entity_stability astring Unstable

To get the property group in question, you want to use 
scf_instance_get_pg_composed(), rather than the set of functions you 
used.  Then you'll have the same view that svcprop has by default: the 
*composed* view of the running snapshot.

In general, if your service is reading properties from SCF, it should 
*always* be using the composed view.

That's the same view of properties that startd uses on your service when 
it's started.  (Note that view is created when you or an admin either 
does a "svcadm refresh" explicitly, or it's done implicitly by "svccfg 
import" of your manifest.)

I'm not sure what your requirements are that lead to needing to read 
auth_attr, but that's probably a better discussion to have with the 
security group, if you haven't already.

liane

Reply via email to