A. Introduction This document proposes the addition of a new environment variable to smf_method(5) which describes the current zone[1] context of the method. This case seeks patch release binding, although we only have plans to put it into a minor release at this time. B. Interface Table Interface Stability Binding -------------------------------------------------- SMF_ZONENAME Evolving Patch C. Discussion The Zones project added the undocumented _INIT_ZONENAME variable to init(1m), but with the introduction of SMF, this variable was preserved only for legacy RC scripts. However, today there are still a large number of SMF method scripts of the form: if [ "${_INIT_ZONENAME:=`/sbin/zonename`}" = "global" ]; then ... fi Discussions between the SMF I-team and Zones I-team resulted in this proposal to make the current zonename available as the SMF_ZONENAME environment, which slots into the SMF_* namespace described in smf_method(5). The purpose of SMF_ZONENAME is to enable scripts to not call out to /sbin/zonename, reducing the number of exec's during a typical boot or a typical zone boot by roughly 30. Scripts which today use _INIT_ZONENAME will be updated to use this new variable. D. Man Page Diffs smf_method(5): --- /tmp/xx Tue Mar 7 13:05:00 2006 +++ /tmp/yy Tue Mar 7 13:07:30 2006 @@ -43,7 +43,7 @@ identical to those given here. Environment Variables | The restarter provides four environment variables to the method that determine the context in which the method is invoked. ... | SMF_ZONENAME The name of the zone in which the method is | running. This can also be obtained | by using the zonename(1) command. E. References 1. PSARC 2002/174 Virtualization and Namespace Isolation in Solaris OS