* New process-control RPC feature in clixon-lib.yang to manage processes

* This is an alternative to manage a clixon daemon via sudtemd, containerd or other
  * One important special case is starting the clixon-restconf daemon internally
  * This is how it works:
    * Register a process via `clixon_process_register(h, name, namespace, argv, argc)`
    * Use process-control RPC defined in clixon-lib.yang to start/stop/restart or query status on that process
  * Example code in the main example
This commit is contained in:
Olof hagsand 2020-12-15 14:43:01 +01:00
parent 8540820698
commit 22adc58187
19 changed files with 971 additions and 47 deletions

View file

@ -126,7 +126,10 @@ backend_terminate(clicon_handle h)
/* Delete all backend plugin RPC callbacks */
rpc_callback_delete_all(h);
/* Delete all backend plugin upgrade callbacks */
upgrade_callback_delete_all(h);
upgrade_callback_delete_all(h);
/* Delete all process-control entries */
clixon_process_delete_all(h);
xpath_optimize_exit();
if (pidfile)
@ -529,6 +532,10 @@ main(int argc,
usage(h, argv[0]);
goto done;
}
/* Add some specific options from autotools configure NOT config file */
clicon_option_str_set(h, "CLICON_WWWUSER", WWWUSER);
clicon_option_str_set(h, "CLICON_WWWDIR", WWWDIR);
/* External NACM file? */
nacm_mode = clicon_option_str(h, "CLICON_NACM_MODE");
if (nacm_mode && strcmp(nacm_mode, "external") == 0)