It seems to be a problem with the .adef file and sandbox write/rewrite permissions, since when I fist install the httpServer it seems to work, even if I had to change de .adef because of 500 internal error mentioned in the linked post. However, when I stop and restart the app, it doesn’t work anymore and I get this error :
Nov 25 11:22:40 fx30s user.err Legato: =ERR= | supervisor[24135]/supervisor T=main | app.c CreateFileLink() 2258 | Could not create file '/legato/systems/current/appsWriteable/webserver/bin/lighttpd'. Read-only file system
Nov 25 11:22:40 fx30s user.err Legato: =ERR= | supervisor[24135]/supervisor T=main | app.c CreateFileLink() 2277 | Failed to create link at '/bin/lighttpd' in app 'webserver'.
I’ve looked on your work and found the differences with my setup and yours in unsandboxed mode.
I’ve integrated the changes, mostly just referencing the full paths to /legato/systems/current/appsWriteable/ and setting unsandboxed mode, along with deleting the now unneeded “bundles” and “requires” blocks in .adef, and I got it to work.
Yet I think this is more a workaround than a solution, as it would seem preferable to run this webserver with the least amount of privilege possible in a sandboxed environment.
I have the feeling that it is just a matter of rules and defining the requires and bundles the correct way to get it to work sandboxed. Could you help me with that ?
This is the .adef file that got it working in my own environment, which is pretty much the same as in the link you sent.
${LEGATO_ROOT}/components/3rdParty/lighttpd will install in /legato/systems/current/appsWriteable/httpServer/bin/
And “/bin /” will make /legato/systems/current/appsWriteable/httpServer/bin/ read-only.
So the next time running the application, we cannot create link in /legato/systems/current/appsWriteable/httpServer/bin/
Workaround could be one of the followings:
using unsandboxed application
OR using sandboxed application but remove it (i.e. app remove httpServer) and reinstall it (i.e. update httpServer.wp76xx.update) if you need to restart the application
OR using sandboxed application but restart the whole legato framework by “legato restart” instead of restarting single application by “app restart httpserver”
OR using sandboxed application and do an overlay operation on those read-only folder:
For now I guess the best option is to keep the app unsandboxed. I just have to keep in mind to work with the /legato/systems/current/appsWriteable/ path for everything app related.