Changed plugin_init() backend return semantics: If returns NULL, _without_ calling clicon_err(), the module is disabled.
Also, example documentation corrected according to: https://github.com/clicon/clixon/issues/33
This commit is contained in:
parent
60ce7b12bd
commit
ee946a00f5
7 changed files with 52 additions and 17 deletions
|
|
@ -23,7 +23,7 @@ routing example. It contains the following files:
|
|||
```
|
||||
Start backend:
|
||||
```
|
||||
clixon_backend -f /usr/local/etc/example.xml -I
|
||||
sudo clixon_backend -f /usr/local/etc/example.xml -s init
|
||||
```
|
||||
Edit cli:
|
||||
```
|
||||
|
|
|
|||
|
|
@ -114,6 +114,13 @@ static clixon_plugin_api api = {
|
|||
clixon_plugin_api *
|
||||
clixon_plugin_init(clicon_handle h)
|
||||
{
|
||||
char *nacm_mode;
|
||||
|
||||
clicon_debug(1, "%s backend nacm", __FUNCTION__);
|
||||
nacm_mode = clicon_option_str(h, "CLICON_NACM_MODE");
|
||||
if (nacm_mode==NULL || strcmp(nacm_mode, "disabled") == 0){
|
||||
clicon_debug(1, "%s CLICON_NACM_MODE not enabled: example nacm module disabled", __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
return &api;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue