On Wed, Mar 07, 2007 at 07:08:49AM -0800, Peter van Gemert wrote:
> Hi Bernd,
> 
> Thanks for the example scripts, but ...
> 
> # svcprop -p start/exec ssh
> /lib/svc/method/sshd\ start

Since method property values are actually shell scripts (i.e., they are
executed like this: execle("/sbin/sh", "/sbin/sh", "-c", method_propval,
NULL, nenv)), there's not much choice but to display the method property
values as a whole.

To get a command name out of a method property value is not as simple as
you might think -- consider this:

    /sbin/sh -c 'foo=;: ${foo:=bar}; echo $foo'

or

    /sbin/sh -c 'env FOO=bar /lib/svc/method/.../foo'

No, noone should be writing method property values of that sort, but it
is possible.  So you really need a human to look at the method property
values.

(Perhaps then using /sbin/sh -c to evaluate methods was a bad idea?  But
it's certainly in keeping with the way things work in a Unix
environment.)

Nico
-- 

Reply via email to