ffnord / ffmap-backend

THIS PROJECT DOESN'T HAVE A MAINTAINER!
Other
20 stars 59 forks source link

running as unprivileged user doesn't work as documented #81

Open rotanid opened 8 years ago

rotanid commented 8 years ago

running ffmap-backend on Debian 8 as unprivileged user doesn't work like it is documented. as far as i remember it was strange, with the solution from the readme, the alfred socket access wasn't possible most of the time, worked only once in a while

we solved it by

  1. creating wrapper scripts that run batctl, batadv-vis, alfred-json via sudo
  2. create sudo entries for these
  3. change the PATH for the cronjob to include the directory containing the wrapper scripts
  4. change backend.py to copy/use the parent environment variables, see https://github.com/tecff/ffmap-backend/commit/15553b88d00faf722c4dfc6fd44c0fa6867a5857 and https://github.com/tecff/ffmap-backend/commit/a2a5fcbb7b39edca9f3e233ced52c1c06364ed05

maybe there's a better way, but the readme should be updated regarding this

jplitza commented 8 years ago

In what way "doesn't it work"? Error messages? Log entries?

rotanid commented 8 years ago

i had this problem back in november and worked hours to solve it. sorry, i don't have the time and motivation to go through all this again, so i just shared what i still remember to help others experiencing the same. i added a few details above that i can remember.

rotanid commented 8 years ago

i did some debugging and came to the following results:

the problem is that the last command isn't persistent...

so there's a simpler solution than the one i described above, but information in the README isn't enough to get ffmap-backend running as an unprivileged user

sidenote: couldn't get alfred 2015.2 from jessie-backports to work at all, so i'm stuck with 2014.4 - freifunk pinneberg seems to have the same problem (but that's not the issue here imho, just additional information)

jplitza commented 8 years ago

Your side note may actually hint at what is the difference in our setups. How/wherefrom did you install alfred? Because I'm using the repository at debian.draic.info by @tcatm, and the version installed from there is automatically run as root:alfred and sets 660 on the socket.

rotanid commented 8 years ago

We're running 2014.4 from ffmuc/fpletz repository at the moment, but as the "more official" one in debians repositories also doesn't use root:alfred and 660 we should either work hard to change it there, too or (even better) change it so it doesn't need full root. short term it should at least be noted that it relies on that specific build/package of alfred