Quoth Riny Qian on Tue, Aug 01, 2006 at 02:07:09PM +0800:
> I tried a service (manifest) using the inheritance, but found that the
> inherited property cannot be specified by svccfg though svcprop does
> show it in the property list. The test service is attached.
> 
> #> svcprop test-fmri:porta | grep data/port
> data/port astring /dev/%i
> 
> (here token is only effective in method! Is it possible to add the
> support into property?)

It's possible, but you'd need a way to turn it off.  It would be better
to add %i interpretation to the semantic consumer of the value, probably
/lib/svc/method/test-fmri in this case.

> #> svccfg -s test-fmri:porta setprop data/port="/dev/porta"
> svccfg: No such property group "data".

This is because your manifest has the data property_group element inside
the service element, not the instance element.  Therefore svccfg import
created the property group on the service.  This command tries to set
the property in the property group on the instance (test-fmri:porta),
but the property group doesn't exist.

        svccfg -s test-fmri setprop data/port="/dev/porta"

or

        svccfg -s test-fmri:porta addpg data application
        svccfg -s test-fmri:porta setprop data/port="/dev/porta"

should work.

> #> svccfg -s test-fmri add portc
> #> svccfg -s test-fmri:portc setprop data/port="/dev/portc"
> svccfg: No such property group "data".
> 
> What's wrong here?

When you create an instance, it doesn't have any property groups.  You
must add the property group before you can set any properties in it.

> I also want to make adding another instance easier by just
> invoking "svccfg -s test-fmri add portx" and passing %i (instance
> name) into the svc method, thus users don't even need to set the port
> property.
> #> svcprop test-fmri:portc | grep start/exec
> start/exec astring /lib/svc/method/test-fmri\ %i

That should work.  (Note that it's svc.startd which expands the %i, not
svcprop or svccfg.)


Quoth Riny Qian on Tue, Aug 01, 2006 at 05:30:23PM +0800:
> It seems that the listprop/setprop subcommands of svccfg does not
> support the composed property?

Indeed, svccfg doesn't know anything about property composition, but
svcprop uses composition by default.  This is because svccfg is meant to
provide access to the bare metal of the repository, but unfortunately
right now it is also the only supported way to set properties.


David

Reply via email to