3 title: Options of afb-daemon
5 https://git.automotivelinux.org/src/app-framework-binder/plain/docs/afb-daemon-options.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-framework-binder-developer-guides-api-services-book.yml -->
10 # Launching options of afb-daemon
12 The launch options for binder **afb-daemon** are:
15 -v, --verbose Verbose Mode, repeat to increase verbosity
16 -c, --color Colorize the ouput
17 -q, --quiet Quiet Mode, repeat to decrease verbosity
18 -l, --log=xxxx Tune log level
19 --foreground Get all in foreground mode
20 --background Get all in background mode
21 -D, --daemon Get all in background mode
22 -n, --name=xxxx Set the visible name
23 -p, --port=xxxx HTTP listening TCP port [default 1234]
24 --roothttp=xxxx HTTP Root Directory [default no root http (files not served but apis still available)]
25 --rootbase=xxxx Angular Base Root URL [default /opa]
26 --rootapi=xxxx HTML Root API URL [default /api]
27 --alias=xxxx Multiple url map outside of rootdir [eg: --alias=/icons:/usr/share/icons]
28 --apitimeout=xxxx Binding API timeout in seconds [default 20]
29 --cntxtimeout=xxxx Client Session Context Timeout [default 32000000]
30 --cache-eol=xxxx Client cache end of live [default 100000]
31 -w, --workdir=xxxx Set the working directory [default: $PWD or current working directory]
32 -u, --uploaddir=xxxx Directory for uploading files [default: workdir] relative to workdir
33 --rootdir=xxxx Root Directory of the application [default: workdir] relative to workdir
34 --ldpaths=xxxx Load bindings from dir1:dir2:... [default: path of afb-dbus-binding.so]
35 -b, --binding=xxxx Load the binding of path
36 --weak-ldpaths=xxxx Same as --ldpaths but ignore errors
37 --no-ldpaths Discard default ldpaths loading
38 -t, --token=xxxx Initial Secret [default=random, use --token= to allow any token]
39 -r, --random-token Enforce a random token
40 -V, --version Display version and copyright
41 -h, --help Display this help
42 --ws-client=xxxx Bind to an afb service through websocket
43 --ws-server=xxxx Provide an afb service through websockets
44 -A, --auto-api=xxxx Automatic load of api of the given directory
45 --session-max=xxxx Max count of session simultaneously [default 200]
46 --tracereq=xxxx Log the requests: no, common, extra, all
47 --traceevt=xxxx Log the events: no, common, extra, all
48 --traceses=xxxx Log the sessions: no, all
49 --traceapi=xxxx Log the apis: no, common, api, event, all
50 --traceglob=xxxx Log the globals: none, all
51 --traceditf=xxxx Log the daemons: no, common, all
52 --tracesvc=xxxx Log the services: no, all
53 --call=xxxx call at start, format of val: API/VERB:json-args
54 --no-httpd Forbid HTTP service
55 -e, --exec Execute the remaining arguments
56 -M, --monitoring Enable HTTP monitoring at <ROOT>/monitoring/
57 -C, --config=xxxx Load options from the given config file
58 -Z, --dump-config Dump the config to stdout and exit
59 -s, --set=xxxx Set parameters ([API]/[KEY]:JSON or {"API":{"KEY":JSON}}
60 -o, --output=xxxx Redirect stdout and stderr to output file (when --daemon)
61 --trap-faults=xxxx Trap faults: on, off, yes, no, true, false, 1, 0 (default: true)
66 Prints help with available options
70 Display version and copyright
74 Increases the verbosity, can be repeated
78 Add basic colorization to the ouput.
82 Decreases the verbosity, can be repeated
86 Tune the log level mask. The levels are:
94 The level can be set using + or -.
96 | Examples | descritpion
97 |-----------------|-------------------
98 | error,warning | selects only the levels error and warning
99 | +debug | adds level debug to the current verbosity
100 | -warning | remove the level warning from the current verbosity
101 | +warning-debug,info | Adds error and remove errors and warnings
105 HTTP listening TCP port [default 1234]
109 Directory where the daemon must run [default: $PWD if defined
110 or the current working directory]
114 Directory where uploaded files are temporarily stored [default: workdir]
118 Root directory of the application to serve [default: workdir]
122 Directory of HTTP served files. If not set, files are not served
123 but apis are still accessible.
127 Angular Base Root URL [default /opa]
129 This is used for any application of kind OPA (one page application).
130 When set, any missing document whose url has the form /opa/zzz
131 is translated to /opa/#!zzz
135 HTML Root API URL [default /api]
137 The bindings are available within that url.
141 Maps a path located anywhere in the file system to the
142 a subdirectory. The syntax for mapping a PATH to the
143 subdirectory NAME is: --alias=/NAME:PATH.
145 Example: --alias=/icons:/usr/share/icons maps the
146 content of /usr/share/icons within the subpath /icons.
148 This option can be repeated.
152 binding API timeout in seconds [default 20]
154 Defines how many seconds maximum a method is allowed to run.
159 Client Session Timeout in seconds [default 32000000 that is 1 year]
163 Client cache end of live [default 100000 that is 27,7 hours]
167 Maximum count of simultaneous sessions [default 200]
171 Load bindings from given paths separated by colons
172 as for dir1:dir2:binding1.so:... [default = $libdir/afb]
174 You can mix path to directories and to bindings.
175 The sub-directories of the given directories are searched
178 The bindings are the files terminated by '.so' (the extension
179 so denotes shared object) that contain the public entry symbol.
183 Same as --ldpaths but instead of stopping on error, ignore errors and continue.
187 Load the binding of given path.
191 Initial Secret token to authenticate.
193 If not set, no client can authenticate.
195 If set to the empty string, then any initial token is accepted.
199 Generate a random starting token. See option --exec.
203 Transparent binding to a binder afb-daemon service through a WebSocket.
205 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
206 or an internet socket, of the form "host:port/api".
210 Provides a binder afb-daemon service through WebSocket.
212 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
213 or an internet socket, of the form "host:port/api".
217 Get all in foreground mode (default)
221 Get all in background mode
229 Must be the last option for afb-daemon. The remaining
230 arguments define a command that afb-daemon will launch.
231 The sequences @p, @t and @@ of the arguments are replaced
232 with the port, the token and @.
236 Trace the processing of requests in the log file.
238 Valid values are 'no' (default), 'common', 'extra' or 'all'.
242 Trace the accesses to functions of class api.
244 Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
248 Trace the accesses to functions of class event.
250 Valid values are 'no' (default), 'common', 'extra' or 'all'.
254 Call a binding at start (can be be repeated).
255 The values are given in the form API/VERB:json-args.
257 Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
261 Enable HTTP monitoring at <ROOT>/monitoring/
269 Automatic activation of api of the given directory when the api is missing.
273 Load options from the given config file
275 This can be used instead of arguments on the command line.
281 --binding /home/15646/bindings/binding45.so \
282 --binding /home/15646/bindings/binding3.so \
286 --set api45/key:54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72 \
287 --exec /home/15646/bin/test654 @p @t
291 afb-daemon --config /home/15646/config1
293 when the file **/home/15646/config1** is:
298 "\/home\/15646\/bindings\/binding45.so",
299 "\/home\/15646\/bindings\/binding3.so"
301 "tracereq": "common",
306 "key": "54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72"
310 "\/home\/15646\/bin\/test654",
316 The options are the keys of the config object.
318 See option --dump-config
322 Output a JSON representation of the configuration resulting from
323 environment and options.
327 Redirect stdout and stderr to output file
331 Set values that can be retrieved by bindings.
333 The set value can have different formats.
335 The most generic format is **{"API1":{"KEY1":VALUE,"KEY2":VALUE2,...},"API2":...}**
337 This example set 2 keys for the api *chook*:
339 afb-daemon -Z --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
343 "account": "urn:chook:b2ca5ddb97679",
349 An other format is: **[API]/[KEY]:VALUE**.
350 When API is omitted, it take the value "*".
351 When KEY is ommitted, it take the value of "*".
353 The settings for the API \* are globals and apply to all bindings.
355 The settings for the KEY \* are mixing the value for the API.
357 The following examples are all setting the same values:
359 afb-daemon --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
360 afb-daemon --set 'chook/*:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
361 afb-daemon --set 'chook/:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
362 afb-daemon --set 'chook/account:"urn:chook:b2ca5ddb97679"' --set chook/delay:500