Project

General

Profile

Plugin Load Options » History » Version 8

Tobias Brunner, 30.06.2016 18:17
Updated for 5.5.0 (disabling/reordering plugins)

1 6 Tobias Brunner
h1. Plugin Load Options
2 1 Martin Willi
3 6 Tobias Brunner
{{>toc}}
4 6 Tobias Brunner
5 1 Martin Willi
Many components of strongSwan have a modular design, features can be added or removed using a [[PluginList|growing list of plugins]]. This allows us to keep the footprint small while adding new functionality.
6 1 Martin Willi
7 7 Tobias Brunner
h2. Currently Loaded Plugins
8 7 Tobias Brunner
9 7 Tobias Brunner
The list of loaded plugins is [[LoggerConfiguration|logged]] by the daemon and can also be seen in the output of e.g. [[IpsecCommand|ipsec statusall]] or  [[IpsecPki|pki --help]].
10 7 Tobias Brunner
11 6 Tobias Brunner
h2. Compile Time Plugin Configuration
12 1 Martin Willi
13 6 Tobias Brunner
The recommended way to enable or disable plugins is during compile time. The [[AutoConf|./configure]] script has many --enable/--disable options to enable or disable specific plugins. The daemon and other tools automatically load the plugins enabled/disabled during ./configure; there is no need to manually specify the plugins to use during runtime. 
14 1 Martin Willi
15 1 Martin Willi
Using this compile-time generated plugin has some advantages, including:
16 6 Tobias Brunner
* Proper load order of all plugin (since version:5.1.0 this it not so important anymore, the order simply indicates the preference if two plugins provide the same feature)
17 1 Martin Willi
* Gets updated automatically with new strongSwan releases: This is very important, as we might move core functionality you rely on to plugins. 
18 1 Martin Willi
19 6 Tobias Brunner
h2. Runtime Plugin Configuration
20 1 Martin Willi
21 6 Tobias Brunner
The plugins to load can be specified in [[strongswan.conf]]. There are two options to do so.
22 1 Martin Willi
23 6 Tobias Brunner
h3. Modular Configuration
24 6 Tobias Brunner
25 6 Tobias Brunner
Since version:5.1.2 the _charon.load_modular_ option enables the dynamic construction of the list of plugins to load.
26 6 Tobias Brunner
27 8 Tobias Brunner
If the option is enabled the plugin loader uses the individual _load_ setting for each plugin (_charon.plugins.<plugin>.load_)
28 6 Tobias Brunner
to decide whether to load it or not.  Besides simply enabling/disabling plugins the _load_ setting accepts a numeric priority
29 6 Tobias Brunner
value, which the plugin loader uses to decide in which order plugins are loaded.  Plugins with the same priority are loaded
30 6 Tobias Brunner
according to the default load order, unknown plugins with the same priority are loaded first and in alphabetical order.
31 6 Tobias Brunner
The default priority is 1, and can also be negative to simplify moving a plugin to the end of the list.
32 6 Tobias Brunner
33 6 Tobias Brunner
The _load_modular_ option can also be enabled for other components, but only for charon are the default configuration snippets
34 6 Tobias Brunner
installed in [[strongswanDirectory|strongswan.d/charon]] and included in the default [[strongswan.conf]] file (see source:conf/strongswan.conf).
35 6 Tobias Brunner
But the default snippets are also installed in the @$prefix/share/strongswan/templates@ directory for reference.
36 1 Martin Willi
37 8 Tobias Brunner
Since version:5.5.0 _charon.plugins.<plugin>.load_ may also be used to modify the default plugin list (i.e. if _charon.load_modular_
38 8 Tobias Brunner
is disabled). Disabling the _load_ setting of a plugin will disable that plugin and, as described above, configuring a numeric
39 8 Tobias Brunner
priority allows reordering the plugin. However, unlike with _charon.load_modular_ enabled plugins for which _load_ is unspecified
40 8 Tobias Brunner
are loaded by default but unknown plugins are not, even if their _load_ setting is enabled (i.e. only with _charon.load_modular_
41 8 Tobias Brunner
enabled is the plugin list constructed completely dynamically based on only the explicitly enabled plugins).
42 8 Tobias Brunner
43 6 Tobias Brunner
h3. Static Load List
44 6 Tobias Brunner
45 6 Tobias Brunner
Most components can read the plugin list from [[strongswan.conf]], for example, the IKE daemon charon reads the _charon.load_
46 6 Tobias Brunner
key to load plugins (only if the _charon.load_modular_ option is disabled, see above). 
47 6 Tobias Brunner
48 1 Martin Willi
> It is *not* recommended to specify the plugin list manually, unless you exactly know the implications!
49 1 Martin Willi
50 1 Martin Willi
The load directive is helpful for developers or for testing frameworks. While you might get your scenario running 
51 1 Martin Willi
with a manually specified plugin list, it might not work anymore after a strongSwan update. Use the generated plugin list instead.
52 8 Tobias Brunner
53 8 Tobias Brunner
For example, you'll see such load statements in the strongswan.conf files of the [[ConfigurationExamples|example/test scenarios]] of our [[TestingEnvironment]].
54 8 Tobias Brunner
Refer to [[ConfigurationExamplesNotes]] for details.
55 1 Martin Willi
56 6 Tobias Brunner
h4. Disable Warning
57 1 Martin Willi
58 6 Tobias Brunner
If you really need to define a static plugin load directive, you can disable the warning by setting
59 6 Tobias Brunner
60 1 Martin Willi
<pre>
61 1 Martin Willi
starter {
62 1 Martin Willi
    load_warning = no
63 1 Martin Willi
}
64 1 Martin Willi
</pre>
65 1 Martin Willi
66 6 Tobias Brunner
in [[strongswan.conf]] or by providing the @--disable-load-warning@ option during [[InstallationDocumentation|configuration]].
67 1 Martin Willi
68 6 Tobias Brunner
h4. Strict Plugins
69 6 Tobias Brunner
70 6 Tobias Brunner
In the static load directive, you can mark specific plugins as critical: If loading a critical plugin fails, the daemon does not start. To mark a plugin as critical, append a ! to its name.