# something defined by another module, you can list them in order
# here, and ensure that the configuration will be OK.
#
+# After the modules listed here have been loaded, all of the modules
+# in the "mods-enabled" directory will be loaded. Loading the
+# "mods-enabled" directory means that unlike Version 2, you usually
+# don't need to list modules here.
+#
instantiate {
#
- # Allows the execution of external scripts.
- # The entire command line (and output) must fit into 253 bytes.
- #
- # e.g. Framed-Pool = `%{exec:/bin/echo foo}`
- exec
-
- #
- # The expression module doesn't do authorization,
- # authentication, or accounting. It only does dynamic
- # translation, of the form:
- #
- # Session-Timeout = `%{expr:2 + 3}`
- #
- # So the module needs to be instantiated, but CANNOT be
- # listed in any other section. See 'doc/rlm_expr' for
- # more information.
- #
- expr
-
- #
- # The DHCP module currently just registers some DHCP related
- # expansions, but will eventually contain all the code necessary
- # for encoding and decoding DHCP packets.
- #
- dhcp
-
-
- #
- # We add the counter module here so that it registers
+ # We list the counter module here so that it registers
# the check-name attribute before any module which sets
# it
# daily
- expiration
- logintime
# subsections here can be thought of as "virtual" modules.
#
cf_log_info(cs, " }");
} /* if there's an 'instantiate' section. */
+ /*
+ * Now that we've loaded the explicitly ordered modules,
+ * load everything in the "modules" section. This is
+ * because we've now split up the modules into
+ * mods-enabled.
+ */
+ for (ci=cf_item_find_next(modules, NULL);
+ ci != NULL;
+ ci=next) {
+ const char *name;
+ module_instance_t *module;
+ CONF_SECTION *subcs;
+
+ next = cf_item_find_next(modules, ci);
+
+ if (!cf_item_is_section(ci)) continue;
+
+ subcs = cf_itemtosection(ci);
+ name = cf_section_name2(subcs);
+ if (!name) name = cf_section_name1(subcs);
+
+ module = find_module_instance(modules, name, 1);
+ if (!module) return -1;
+ }
+
/*
* Loop over the listeners, figuring out which sections
* to load.