* Michael Shapiro <mws at zion.eng.sun.com> [2007-08-24 15:47]: > > 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). > > My ten cents: I noticed the same thing, I think it's completely busted, > and I think we should just change it. I can think of no reason why > the script pathname is useful, and I think the docs imply it should > have been start/stop/refresh.
Yep. It was initially proposed as the expanded exec property (i.e. the command line), but it was later recognized that the method name alone should be sufficient. I agree that the docs are right (although we should delete "full") and the implementation is wrong. - Stephen -- sch at sun.com http://blogs.sun.com/sch/