What are the intended contents of SMF_METHOD in the method execution
environment?  The documentation just says:

     SMF_METHOD     The full method name of the  method  that  is
                    invoked

and later also describes property expansion:

     %m           Name of the method, such as start or stop

This seems to imply that SMF_METHOD should contain "start" or similar.
But in fact at usr/src/cmd/svc/startd/method.c:exec_method(), we have:

        setlog(inst->ri_logstem);
        log_instance(inst, B_FALSE, "Executing %s method (\"%s\")",
            method_names[type], method);
        ...
        nenv = set_smf_env(mcp->env, mcp->env_sz, NULL, inst, method);

So that when a method is invoked, SMF_METHOD actually contains
/lib/svc/method/foo (or whatever command we are invoking).

It's hard to know which is intended because nothing I can find
actually uses this variable (of course, if its purpose is to replicate
$0, that's understandable).

-- 
Keith M Wesolowski              "Sir, we're surrounded!" 
FishWorks                       "Excellent; we can attack in any direction!" 

Reply via email to