* clixon_restconf and clixon_netconf now take -D <level> as command-line option\

instead of just -D
  * This aligns to clixon_cli and clixon_backend
This commit is contained in:
Olof Hagsand 2018-08-03 13:24:41 +02:00
parent 10ada483e5
commit 7c94991fe9
10 changed files with 18 additions and 14 deletions

View file

@ -5,6 +5,8 @@
### Major New features
### API changes on existing features (you may need to change your code)
* clixon_restconf and clixon_netconf now take -D <level> as command-line option instead of just -D
* This aligns to clixon_cli and clixon_backend
* Application command option -S to clixon_netconf is obsolete. Use `clixon_netconf -l s` instead.
### Minor changes

View file

@ -206,7 +206,7 @@ usage(clicon_handle h,
"where commands is a CLI command or options passed to the main plugin\n"
"where options are\n"
"\t-h \t\tHelp\n"
"\t-D <level> \tDebug\n"
"\t-D <level> \tDebug level\n"
"\t-f <file> \tConfig-file (mandatory)\n"
"\t-x\t\tDump configuration file as XML on stdout (migration utility)\n"
"\t-F <file> \tRead commands from file (default stdin)\n"

View file

@ -296,7 +296,7 @@ usage(clicon_handle h,
fprintf(stderr, "usage:%s\n"
"where options are\n"
"\t-h\t\tHelp\n"
"\t-D\t\tDebug\n"
"\t-D <level>\tDebug level\n"
"\t-q\t\tQuiet: dont send hello prompt\n"
"\t-f <file>\tConfiguration file (mandatory)\n"
"\t-l <e|o|s|f<file>> \tLog on std(e)rr, std(o)ut, (s)yslog, (f)ile (syslog is default)\n"
@ -345,7 +345,8 @@ main(int argc,
usage(h, argv[0]);
break;
case 'D' : /* debug */
debug = 1;
if (sscanf(optarg, "%d", &debug) != 1)
usage(h, argv[0]);
break;
case 'f': /* override config file */
if (!strlen(optarg))

View file

@ -66,7 +66,7 @@ curl -sX POST -d '{"interfaces":{"interface":{"name":"eth1","type":"eth","enable
Start the restconf fastcgi program with debug flag:
```
sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml" -s /bin/sh www-data
sudo su -c "/www-data/clixon_restconf -D 1 f /usr/local/etc/example.xml" -s /bin/sh www-data
```
Look at syslog:
```

View file

@ -39,7 +39,7 @@
* sudo apt-get install libfcgi-dev
* gcc -o fastcgi fastcgi.c -lfcgi
* sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml " -s /bin/sh www-data
* sudo su -c "/www-data/clixon_restconf -D 1 -f /usr/local/etc/example.xml " -s /bin/sh www-data
* This is the interface:
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>
@ -74,7 +74,7 @@
#include "restconf_methods.h"
/* Command line options to be passed to getopt(3) */
#define RESTCONF_OPTS "hDf:l:p:y:a:u:"
#define RESTCONF_OPTS "hD:f:l:p:y:a:u:"
/* RESTCONF enables deployments to specify where the RESTCONF API is
located. The client discovers this by getting the "/.well-known/host-meta"
@ -488,7 +488,7 @@ usage(clicon_handle h,
fprintf(stderr, "usage:%s [options]\n"
"where options are\n"
"\t-h \t\tHelp\n"
"\t-D \t\tDebug. Log to syslog\n"
"\t-D <level>\tDebug level\n"
"\t-f <file>\tConfiguration file (mandatory)\n"
"\t-l <s|f<file>> \tLog on (s)yslog, (f)ile (syslog is default)\n"
"\t-d <dir>\tSpecify restconf plugin directory dir (default: %s)\n"
@ -533,7 +533,8 @@ main(int argc,
usage(h, argv[0]);
break;
case 'D' : /* debug */
debug = 1;
if (sscanf(optarg, "%d", &debug) != 1)
usage(h, argv[0]);
break;
case 'f': /* override config file */
if (!strlen(optarg))

View file

@ -39,7 +39,7 @@
* sudo apt-get install libfcgi-dev
* gcc -o fastcgi fastcgi.c -lfcgi
* sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml " -s /bin/sh www-data
* sudo su -c "/www-data/clixon_restconf -D 1 f /usr/local/etc/example.xml " -s /bin/sh www-data
* This is the interface:
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>

View file

@ -15,8 +15,8 @@ clixon_cli=clixon_cli
clixon_netconf=clixon_netconf
# How to run restconf stand-alone and using valgrind
#sudo su -c "/www-data/clixon_restconf -f $cfg -D" -s /bin/sh www-data
#sudo su -c "valgrind --leak-check=full --show-leak-kinds=all /www-data/clixon_restconf -f $cfg -D" -s /bin/sh www-data
#sudo su -c "/www-data/clixon_restconf -f $cfg -D 1" -s /bin/sh www-data
#sudo su -c "valgrind --leak-check=full --show-leak-kinds=all /www-data/clixon_restconf -f $cfg -D 1" -s /bin/sh www-data
#clixon_backend="valgrind --leak-check=full --show-leak-kinds=all clixon_backend"
clixon_backend=clixon_backend

View file

@ -72,7 +72,7 @@ new "kill old restconf daemon"
sudo pkill -u www-data clixon_restconf
new "start restconf daemon"
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D 1
sleep 1

View file

@ -92,7 +92,7 @@ new "kill old restconf daemon"
sudo pkill -u www-data clixon_restconf
new "start restconf daemon"
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang -D
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D 1
sleep 1

View file

@ -60,7 +60,7 @@ new "kill old restconf daemon"
sudo pkill -u www-data clixon_restconf
new "start restconf daemon"
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg # -D
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg # -D 1
sleep 1