Resources are used to delineate different name spaces and are also used in provisioning. Resources are implement as a bit mask in a 32 bit field and as such there may be 32 resources. Values for Resources are 1,2,4,8,...

Each Service Definition may be defined with one or more Resource bit set. When a Service is created, the Resources of the associated Service Definition is copied to the Service.
If after a Service is created the Resources on the Service Definition are modified, warnings will be printed in the nighty processing logs. Either the Service Definition Resources will have to be reset or the Service Resources updated. As Resources are tied to provisioning, caution should be take when making Resource changes.

Name spaces

Resources are used in name space delineation. By default, two non-closed Services that have a Resource bit in common many not have the same value for the Service d01 field.


Resources are use in the example Provisioning script /usr/local/billmax/local/service_hook-example. They are used to determine which systems are provisioned. The following is example code fragment that uses Resource 1:
#         ----- The billmax resource number (1-31)
#         |
#         V
$SERVICES{1}{name}              = "radius";
$SERVICES{1}{provision}         = "yes";

$SERVICES{1}{data}              = [ "-p", "{NEW_d02}" ];  # NOTE HOW THE PASSWORD FIELD IS INDICATED!!!

$SERVICES{1}{cmd}{create}       = "/usr/sbin/useradd -M -g radius -s /bin/true -c " . escR("$ENV{USER_fname} $ENV{USER_lname}") .
                                        " -p " . escR($ENV{NEW_d02}) . " " . $ENV{NEW_d01};

$SERVICES{1}{cmd}{delete}       = "/usr/sbin/userdel $ENV{NEW_d01}";

$SERVICES{1}{cmd}{disable}      = "/usr/sbin/usermod -L $ENV{NEW_d01}";

$SERVICES{1}{cmd}{enable}       = "/usr/sbin/usermod -U $ENV{NEW_d01}";

$SERVICES{1}{cmd}{rename}       = "/usr/sbin/usermod -l $ENV{NEW_d01} $ENV{OLD_d01}";

$SERVICES{1}{cmd}{update}       = "/usr/sbin/usermod";

$SERVICES{1}{remotecmd}         = "/usr/bin/ssh";