diff --git a/apps/restconf/restconf_lib.c b/apps/restconf/restconf_lib.c
index 500a07c3..fdf73f37 100644
--- a/apps/restconf/restconf_lib.c
+++ b/apps/restconf/restconf_lib.c
@@ -197,7 +197,7 @@ forbidden(FCGX_Request *r)
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
FCGX_FPrintF(r->out, "Status: 403\r\n"); /* 403 forbidden */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
- FCGX_FPrintF(r->out, "
Grideye Forbidden
\n");
+ FCGX_FPrintF(r->out, "Forbidden
\n");
FCGX_FPrintF(r->out, "The requested URL %s was forbidden.\n", path);
return 0;
}
@@ -267,7 +267,7 @@ internal_server_error(FCGX_Request *r)
path = FCGX_GetParam("DOCUMENT_URI", r->envp);
FCGX_FPrintF(r->out, "Status: 500\r\n"); /* 500 internal server error */
FCGX_FPrintF(r->out, "Content-Type: text/html\r\n\r\n");
- FCGX_FPrintF(r->out, "Grideye Internal server error when accessing %s
\n", path);
+ FCGX_FPrintF(r->out, "Internal server error when accessing %s
\n", path);
return 0;
}
diff --git a/apps/restconf/restconf_main.c b/apps/restconf/restconf_main.c
index d83f1a27..9060d2b9 100644
--- a/apps/restconf/restconf_main.c
+++ b/apps/restconf/restconf_main.c
@@ -504,7 +504,7 @@ usage(clicon_handle h,
exit(0);
}
-/*! Main routine for grideye fastcgi API
+/*! Main routine for fastcgi API
*/
int
main(int argc,
diff --git a/doc/FAQ.md b/doc/FAQ.md
index f39f7c4d..e1673808 100644
--- a/doc/FAQ.md
+++ b/doc/FAQ.md
@@ -59,12 +59,17 @@ Define a valid CLICON_SOCK_GROUP in the config file or via the -g option
or create the group and add the user to it. The default group is 'clicon'.
Add yourself and www-data, if you intend to use restconf.
-On linux:
+Using groupadd and usermod:
```
- sudo groupadd clicon
+ sudo groupadd clicon #
sudo usermod -a -G clicon
sudo usermod -a -G clicon www-data
```
+Using addgroup and adduser (eg on busybox):
+```
+ sudo addgroup clicon
+ sudo adduser clicon
+```
(you may have to restart shell)
Verify:
diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile
index 73dc1783..589beea2 100644
--- a/docker/base/Dockerfile
+++ b/docker/base/Dockerfile
@@ -37,11 +37,11 @@ MAINTAINER Olof Hagsand
# For clixon and cligen
RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev
-# For debug
-RUN apk add --update bash nano
# Create a directory to hold source-code, dependencies etc
RUN mkdir /clixon
+RUN mkdir /clixon/build
+
WORKDIR /clixon
# Clone cligen
@@ -49,7 +49,7 @@ RUN git clone https://github.com/olofhagsand/cligen.git
# Build cligen
WORKDIR /clixon/cligen
-RUN ./configure
+RUN ./configure --prefix=/clixon/build
RUN make
RUN make install
@@ -59,11 +59,33 @@ WORKDIR /clixon/clixon
COPY clixon .
# Build clixon (without restconf if you dont have nginx)
-RUN ./configure --without-restconf
+RUN ./configure --without-restconf --prefix=/clixon/build --with-cligen=/clixon/build
RUN make
RUN make install
RUN make install-include
+WORKDIR /clixon/clixon/example
+RUN DESTDIR=/clixon/build make
+RUN make install
+
+#
+# Stage 2
+#
+
+FROM alpine
+MAINTAINER Olof Hagsand
+
+# For clixon and cligen
+RUN apk add --update flex bison # fcgi-dev curl-dev
+
+# Run a clicon group - actually an application may want another
+RUN addgroup clicon
+
+COPY --from=0 /clixon/build/ /usr/local/
+
+# For debug
+#RUN apk add --update bash nano
+
diff --git a/docker/base/README.md b/docker/base/README.md
index 7b4fa61a..83f1407d 100644
--- a/docker/base/README.md
+++ b/docker/base/README.md
@@ -20,3 +20,28 @@ the docker runtime scripts there
(You may have to login for push with sudo docker login -u )
+## Example run
+
+The following shows a simple example of how to run the example
+application. First,the container is started, then the backend is startend in the background inside the container, and finally the CLI is started in the foreground.
+
+```
+ $ sudo docker run --name clixon --rm -td clixon/clixon
+ $ sudo docker exec -it clixon clixon_backend -s init -f /usr/local/etc/example.xml
+ $ sudo docker exec -it clixon clixon_cli -f /usr/local/etc/example.xml
+ > set interfaces interface e
+ > show configuration
+ interfaces {
+ interface {
+ name e;
+ enabled true;
+ }
+ }
+ > q
+ $ sudo docker kill clixon
+```
+
+Note that this is a special case since the example is
+already a part of the installation. If you want to add your own
+application, such as plugins, cli syntax files, yang models, etc, you
+need to extend the base container with your own additions.
diff --git a/docker/system/start.sh b/docker/system/start.sh
index 172c6f1e..af20ae1d 100755
--- a/docker/system/start.sh
+++ b/docker/system/start.sh
@@ -1,13 +1,10 @@
#!/bin/bash
-# Build grideye containers, start all containers, setup networking
# Usage: ./startup.sh
# Debug: DBG=1 ./startup.sh
# See also cleanup.sh
>&2 echo "Running script: $0"
-pwd
-
# Error function
# usage: err $msg
err(){
@@ -53,7 +50,6 @@ EOF
CONFIG=${CONFIG:-$CONFIG0}
# Start clixon-example backend
-# -p 4535 to access via cli from host
>&2 echo -n "Starting Backend..."
sudo docker run -p $PORT:80 --name clixon-system --rm -e DBG=$DBG -e CONFIG="$CONFIG" -e STORE="$STORE" -td clixon/clixon-system || err "Error starting clixon-system"
diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c
index 3dc5dc89..05b9a861 100644
--- a/lib/src/clixon_yang.c
+++ b/lib/src/clixon_yang.c
@@ -57,6 +57,7 @@
#include
#include
#define __USE_GNU /* strverscmp */
+#define _GNU_SOURCE
#include
#include
#include