diff options
author | José Bollo <jose.bollo@iot.bzh> | 2019-05-23 10:21:43 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-05-29 08:59:58 +0000 |
commit | d6f6df814d87b5d5f77570196576637c8deb9afe (patch) | |
tree | 4d1a83d59aa8ce27d1c6ac3eddb76378bad3d7ea | |
parent | f9c743046f94769c25ffc5bfd8d190c53cc4d613 (diff) |
afb-daemon: Add /tmp has fallback for uploadshalibut_7.99.1halibut/7.99.17.99.1
During its start, when implementing HTTP server,
afb-daemon checked that the upload directory was
accessible and writable and afb-daemon refused to
start when it was not the case.
When trying to use systemd's DynamicUser for platform
services, it had the effect to forbid service to run.
That commit add the directory /tmp as a fallback
upload directory.
Bug-AGL: SPEC-2446
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: Ib4ee456d71cb1aefa19e8eed6774ef5f77919366
-rw-r--r-- | src/main-afb-daemon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main-afb-daemon.c b/src/main-afb-daemon.c index d825d803..cc07e86f 100644 --- a/src/main-afb-daemon.c +++ b/src/main-afb-daemon.c @@ -358,8 +358,12 @@ static struct afb_hsrv *start_http_server() } if (afb_hreq_init_download_path(uploaddir)) { - ERROR("unable to set the upload directory %s", uploaddir); - return NULL; + static const char fallback_uploaddir[] = "/tmp"; + WARNING("unable to set the upload directory %s", uploaddir); + if (afb_hreq_init_download_path(fallback_uploaddir)) { + ERROR("unable to fallback to upload directory %s", fallback_uploaddir); + return NULL; + } } hsrv = afb_hsrv_create(); |