summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-09-07Improve handling of verbosityJosé Bollo3-11/+82
The macros VERBOSE_NO_DATA and VERBOSE_NO_DETAILS can be used to tune what verbose parts are to be emitted: If VERBOSE_NO_DATA is defined then the macro will only report the file and the line that emitted the message. This mode is intended to reduce the count of static data in the binary. If VERBOSE_NO_DATA is not defined and VERBOSE_NO_DETAILS is defined, this is the opposite: the messages are emitted but not the file, line and function. When none of these 2 are difened, everything is emitted: the message and the details (file, line and function). At the same time the emission of the details (file, line, function) is not done for levels NOTICE, INFO, DEBUG on the console Change-Id: Ibb83cd435797fadf90626cb06bbda77f0f8b3cde Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-ditf: track daemon stateJosé Bollo7-5/+61
Change-Id: Ic21c79dcd9908919a1a8d13e8747ef0bd2490477 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-hook: change output formatJosé Bollo1-4/+4
Putting HOOK: in front is better because other outputs are also prefixed with SOMETHING: It greatly improves readability Change-Id: I591126198b630e3b7977ecb2501bc59163fd0c11 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-hook: output hooks to stderr directlyJosé Bollo1-3/+36
Change-Id: Ife66db644c62ea4a3e7be11e7f454234c093a824 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Implement afb_req_has_permissionJosé Bollo8-31/+99
This new verb is available in bindings to check whether the client identified by a request has a given permission or not. Change-Id: I5eaa0892d8260d26bd76f37123251c103c981e10 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: improve afb_auth_check_permissionJosé Bollo1-6/+12
The test was previously done in the caller but because afb_auth_check_permission can now be called by other callers, the test must be relocated. Change-Id: I08a3a92afbe0b4dcfb223335b1e76b2d4aff005f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: export method to check a single permissionJosé Bollo2-5/+5
Change-Id: I45c4872f34ff8f25c14872d7b3610fa15f48062e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: revert order of arguments (minor)José Bollo3-10/+10
Change-Id: I29140a3c047799ee600051fb62998e7bb73d45f5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-api-so: take care of SIGSEGV in dlopenJosé Bollo1-3/+32
In some case, dlopen raise a segmentation fault. This commit takes care of this. Change-Id: I6cbe59de2422dafcdf3714d0539b1757511c100b Bug-AGL: SPEC-662 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07sig-monitor: handle SIGSEGV in backtraceJosé Bollo1-11/+37
There was cases were the backtrace raised a segmentation fault. This commit also improves unblocking of signals in handler. Change-Id: I09493d3ecc4b477660366ea213bf451c9ae7d517 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05Fix segmentation fault when random tokenJosé Bollo3-2/+10
Change-Id: I98795f71dfab1fbc86d694d7ed357ae8387abd5d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05sig-monitor: Dump stack atomicallyJosé Bollo3-8/+27
Emitting the stack as a single string avoids its accidental split and is better when receiving monitoring events. Change-Id: I74c16f36f026b4af4a42064f694ac1f4a342cc1f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05afb-apiset: Refactor and cleanJosé Bollo3-25/+22
Change-Id: I063329b23f4476e2570e99dfc639b11320df41d2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05AFB.js: fix bug (minor)José Bollo2-7/+23
Change-Id: I37ee5f599cf49a6a1c6b1e27cf3fcdd29b280c4a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05afb-api-ws: Fix bug introduced by 2e83db0José Bollo1-1/+1
Change-Id: Ia73d2d49ac888770f78d65a6258c0184b6aaa2da Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-01Give priority to option --bindingJosé Bollo1-1/+1
Change-Id: I822f2d50a35fdffae82678c67be0e017d54cebff Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31Make noconcurrency more efficientJosé Bollo6-41/+16
The previous handling of noconcurrency suffered of inefficiency, was complicated and dedicated to api-so-v2. Change-Id: I32aea9187663ac533819496e9dc9b944db0d89ec Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-apiset: refactor access to apisJosé Bollo6-64/+38
Change-Id: If003067ada5802b7d77f06f560a5d07464909a61 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-trace: use constants for verbosity levelJosé Bollo1-1/+2
Change-Id: I0908c5057efe5360cccd3b2e1e3f926f48453bd2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31update monitoring into packagingRonan Le Martret2-2/+2
Change-Id: Ib03f56bbc148e87a0153a5a48073237c3f34e6ee Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2017-08-31verbosity: fixes split verbosity level 1 in 2 levelsJosé Bollo3-35/+41
The names wasn't correctly reported by monitor Change-Id: Id382d7fdc3bb56c8c11c865439e7e18c257df3a2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-svc: make service existing during its initialisationJosé Bollo4-94/+71
The initialisation of services is splitted in two parts: - the creation and allocation of the structure for the service. - the initialisation once the structure is ready and recorded. Change-Id: I05c89fb513869d45e6b8413699fba234f00ce6b1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31jobs: optimized version of fix starveJosé Bollo1-28/+19
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-30jobs: fix starveJosé Bollo1-13/+33
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-30afb-api-ws: check that the ws-server API existJosé Bollo1-0/+7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29monitor-base.css: fix overflowJosé Bollo1-0/+1
Change-Id: I075be34d5f29c12c3306d16b3c14ccd40b9a98ff Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hooking: Add hook at global scopeJosé Bollo9-12/+271
Actually the global scope only allows to trace log messages. Change-Id: Ib73edf2e3168311b2ad694d857e6647e34884313 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29verbosity: split verbosity level 1 in 2 levelsJosé Bollo2-9/+10
Change-Id: I32a96f1863caffa6a17c25f52d06538f8eb60555 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29verbosity: Prepare hooking of log messagesJosé Bollo2-21/+61
Change-Id: Icfe96d2fee2d3b699dfa9105fcfe62d4eced2557 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29main: set name even for syslogJosé Bollo1-2/+2
Change-Id: I67d74cc2d539651101e82b17d50c8afb8dde621a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hook+trace: add a unique timestampJosé Bollo3-175/+187
A same event must have a unique time stamp. Change-Id: Id33351a97f62c04a84d26995a2cf9ae80613c613 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hook+trace: adds hookid and typeJosé Bollo4-219/+236
The hookid is a unic identifier for a hook event. Its purpose is to distinguish events that could match different filters: a same event has a same id. Also integrate the field "type" (of the event) in the trace event. Change-Id: I90b0b2d3a0846b673b993110d2752cc54db75bd8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29afb-config Copies the values of option --execJosé Bollo1-2/+27
Not copying is not possible if the name of the process is changed. Change-Id: I52122c84234ac275975dae47c23c9d7240b82df8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29process-name: fix a warningJosé Bollo1-1/+0
Change-Id: I1e70cded34b080215b53b8bb28945303d4e5f3e6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29Add option --name for naming the processJosé Bollo6-1/+113
This option allows to set the command line and the thread name of the main process. The value can contain spaces that will be replaced by nulls. Change-Id: I895270a24663467b16fb3cd8fc3218b7b003b6bb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29afb-config: update the output of the configJosé Bollo2-1/+11
Change-Id: I1dbc3c0b0c84cb34da1c8851044a6e72e4dfbd34 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29Rework CMakeList.txtJosé Bollo1-0/+9
Explicit options and add a definition for AGL_DEVEL Change-Id: I8419f0b0dfecc1e0171c282573cdf32ae3f09704 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29Merge "Update packaging"José Bollo2-2/+7
2017-08-28build config: remove forced AGL_DEVEL from src/CMakelists.txtStephane Desneux1-1/+0
Change-Id: I6fd44469b148732103d4b903f94c355f2bd231ee Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2017-08-28monitor: disable monitoring by defaultStephane Desneux1-1/+0
Change-Id: I8e76e9c184dd913a5040578366c8783ac4b3efaa Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2017-08-28fix typoStephane Desneux2-7/+7
Change-Id: Ifb2de3c13f814f16f23ead9357f4fec97b3e675c Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2017-08-28Update packagingRonan Le Martret2-2/+7
* add libmicrohttpd dependency for deb packaging * add monitoring packaging to spec file Change-Id: I228907183640f4edda9bcc3ca634043d5e22e811 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2017-08-27monitoring: add default page index.htmlJosé Bollo2-1/+2
This allows to acces monitoring interface using url HOST/monitoring/ when option --monitoring is set. Change-Id: If7dfc89e4c4db0d87ec5c8e74f9243691a3ec0e8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-27afb-config: rework on option --random-tokenJosé Bollo2-22/+8
When set, this option will enforce a random token in any cases. Not using the option --token has the same effect asking for a random token. So the option now serves to enforce a random token. Change-Id: Iea2cee44b95d5479c36217d312ab6e8ce6726005 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-27monitoring: Add option --monitoringJosé Bollo2-0/+33
Installs basic interface for monitoring and add the option --monitoring / -M to activate the alias /monitoring. This makes the page /monitoring/monitor.html available. Change-Id: Iebe0959f0a5e7c396fe7ce6862d0f9c883733824 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-27afb-config: Add short -p option for --portJosé Bollo2-3/+6
Change-Id: Iae8475559ee2381ee7d687c6afc2e6ce7145ebf3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-27monitoring: improvementsJosé Bollo9-228/+231
- use flex/css for correct layout - handles disconnection nicely - handles initial token - fix typo in afb-api-so Change-Id: I386b98f9d6a2182029d39a373a9820478f97cfa6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-26src/afb-api-so.c: fix uninitialized variableStephane Desneux1-1/+1
Change-Id: If7f576e8f4bdc613d836c158df6e5f0bbfea87b7 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2017-08-26monitoring: add copyrightsJosé Bollo6-6/+102
Also still improve colours Change-Id: I2afc2dc7bf22ef65e39c18c9397ae6c7cd2df1d4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-26monitoring: fix colorJosé Bollo1-2/+2
Change-Id: I73481b5a7d509c7f6640fc8b0c21c502667a657e Signed-off-by: José Bollo <jose.bollo@iot.bzh>