Added systemd example files under example/systemd

This commit is contained in:
Olof hagsand 2018-07-13 13:13:11 +02:00
parent ee946a00f5
commit fd19640579
6 changed files with 40 additions and 3 deletions

View file

@ -9,6 +9,7 @@
* Applications which have not strictly enforced the identities may now have problems with validation and may need to be modified. * Applications which have not strictly enforced the identities may now have problems with validation and may need to be modified.
### Minor changes: ### Minor changes:
* Added systemd example files under example/systemd
* Changed `plugin_init()` backend return semantics: If returns NULL, _without_ calling clicon_err(), the module is disabled. * Changed `plugin_init()` backend return semantics: If returns NULL, _without_ calling clicon_err(), the module is disabled.
* Dedicated standalone xml,json,yang and xsl parser utility test programs added under lib/src/. * Dedicated standalone xml,json,yang and xsl parser utility test programs added under lib/src/.
* CDATA xml support (patch by David Cornejo, Netgate) * CDATA xml support (patch by David Cornejo, Netgate)

View file

@ -2,7 +2,7 @@
### Installation using Nginx ### Installation using Nginx
Define nginx config file/etc/nginx/sites-available/default Define nginx config file: /etc/nginx/sites-available/default
``` ```
server { server {
... ...

View file

@ -24,7 +24,7 @@ Clixon is written in C. The plugins are written in C. The CLI
specification uses cligen (http://cligen.se) specification uses cligen (http://cligen.se)
## How to best understand Clixon? ## How to best understand Clixon?
Run the Clixon example, in the example directory. Run the Clixon example, in the [example](../example) directory.
## How do you build and install Clixon (and the example)? ## How do you build and install Clixon (and the example)?
Clixon: Clixon:
@ -178,6 +178,11 @@ You may also add a default method in the configuration file:
</config> </config>
``` ```
## Can I use systemd with Clixon?
Yes. Systemd example files are provide for the backend and the
restconf daemon as part of the [example](../example/systemd).
## How can I add extra XML? ## How can I add extra XML?
There are two ways to add extra XML to running database after start. Note that this XML is not "committed" into running. There are two ways to add extra XML to running database after start. Note that this XML is not "committed" into running.
@ -345,7 +350,7 @@ To authenticate, the callback needs to return the value 1 and supply a username.
See [../apps/example/example_restconf.c] example_restconf_credentials() for See [../apps/example/example_restconf.c] example_restconf_credentials() for
an example of HTTP basic auth. an example of HTTP basic auth.
## How do I write a CLI translator function ## How do I write a CLI translator function?
The CLI can perform variable translation. This is useful if you want to The CLI can perform variable translation. This is useful if you want to
prcess the input, such as hashing, encrypting or in other way prcess the input, such as hashing, encrypting or in other way

View file

@ -188,6 +188,10 @@ The example contains some stubs for authorization according to [RFC8341(NACM)](h
* A NACM backend plugin reporting the mandatory NACM state variables. * A NACM backend plugin reporting the mandatory NACM state variables.
## Systemd files
Example systemd files for backend and restconf daemons are found under the systemd directory. Install them under /etc/systemd/system for example.
## Run as docker container ## Run as docker container
(Note not updated) (Note not updated)

View file

@ -0,0 +1,13 @@
[Unit]
Description=Starts and stops a clixon example service on this system
Wants=example_restconf.service
[Service]
Type=forking
User=root
RestartSec=60
Restart=on-failure
ExecStart=/usr/local/sbin/clixon_backend -s running -f /usr/local/etc/example.xml
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,14 @@
[Unit]
Description=Starts and stops an example clixon restconf service on this system
Wants=example.service
After=example.service
[Service]
Type=simple
User=www-data
WorkingDirectory=/www-data
Restart=on-failure
ExecStart=/www-data/clixon_restconf -f /usr/local/etc/example.xml
[Install]
WantedBy=multi-user.target