Adding Metaknobs

To add a metaknob, edit , and Search for $FEATURE, (it's near the bottom). metaknobs are mostly ordered by their category: $ROLE, $FEATURE, $SECURITY, etc.

Your probably should probably be declared as a $FEATURE knob, so search for that.

The perl script that parses knows that something is a metaknob because the name begins with $. The code that uses metaknobs expects that they will be declared in the as $<category>.<knob>. Where categories can be added arbitrarily, (but not discovered). So you should be reluctant to add new categories.

Metaknobs usually have multiline values, but this is not required.

As of 8.5.6 metaknobs can have arguments, which opens exciting new possibilities. see,0

In metaknob statements any $(arg) where arg starts with a digit will be substituted as the use line is parsed. (valid param names can't start with a digit). The substitutions are

  • $(0) all of the args
  • $(0?) 1 if any arguments, 0 if no arguments
  • $(0#) the number of arguments (i.e. the number of commas+1)
  • $(1) the first argument
  • $(1?) 1 if the first argument is non-empty, 0 if it is empty
  • $(1+) all of the arguments, starting with the first one. equivalent to $(0)
  • $(2) the second argument
  • $(2?) 1 if the second argument is non-empty, 0 if it is empty
  • $(2+) all of the arguments, starting with the second one
  • $(3) the third argument
  • etc

For instance. The FEATURE : PerodicCronHook metaknob is declared thus:

friendly_name=Configure a Periodic Cron Hook, args: STARTD_CRON | SCHEDD_CRON , tag, period, exe [,hook_args]
default : @end
   $(1)_JOBLIST=$($(1)_JOBLIST) $(2)
   if $(5?)

And the FEATURE : StartdCronPeriodic metaknob uses it. it is declared

friendly_name=Configure a STARTD Cron periodic Hook, args: tag, period, exe [, hook_args]
default = use FEATURE : PeriodicCronHook(STARTD_CRON, $(0))