Running piaware non-root


#1

I’m interested in running piaware, but I’d rather it not run as a root user. I’ve installed data uploaders for a few other flight tracking sites and was able to get them to work running as their own users pretty easily, but piaware appears to have its config file location hard-coded in /root. Is there any way to pass a config file location parameter to piaware?


#2

ads-b-flight-tracking-f21/why-does-piaware-run-as-root-t19485.html


#3

That doesn’t address my question (is there a way to pass the config file location rather than use the default of /root/.piaware), and I disagree with all of the listed points in their reasoning for why they run it as root.

Doesn’t look like this adds a whole lot. Just need to create the user (via adduser) in the postinst script. See:
unix.stackexchange.com/questions … r-accounts
wiki.debian.org/AccountHandling … nerScripts

It adds very little in terms of issues to init scripts (either traditional SysV or systemd scripts), I have been able to get the data feed applications for two other sites running with minimal init script changes.

You already need to run piaware-config as root, so leave the instructions for this as “sudo piaware-config”.

Ooookay…

For users of the Debian package (who are most likely to be in the set-and-forget category), set up a repository for your packages so users can add it as a package source, then an apt-get update/apt-get upgrade will pull the latest packages (or even include a dependency on unattended-upgrades and include a config specifically for piaware so it gets updated automatically)

You are making assumptions about the use cases of my Pi.

So, FlightAware staff, if I rebuild the package for you incorporating these changes, will you fix the executable so the config file location can be specified on the command line?

*Edited for formatting


#4

I also don’t like running as root. You will need to use piaware-mutability, but it’s not MLAT ready…yet. There is a thread on here for it.


#5

Aha! ads-b-flight-tracking-f21/piaware-mutability-packages-released-t19751.html Very nice. I’ll grab that and keep watching the thread. Thanks!


#6

FWIW it seemed to me that piaware-mutability was a bit of an old fork so I’ve stopped looking at that, and instead found a fairly simple way to not run this stuff as root, using Debian’s fakeroot.

Just run piaware inside fakeroot and almost everything works. The only code that broke was the bit that calls netstat, because netstat sends a few warning lines to stderr about potentially incomplete results. I wrote a wrapper script around netstat that suppresses stdout output, put it first in PiAware’s search path, and now it works.

Still annoying that the conffile location is hardcoded to /root/.piaware but I’ve chmodded /root to 0711 and that was enough.


#7

Try piaware 3.0, it does not run as root and does more sensible things with config files.


#8

Good point! Are there any prebuilt .deb files yet or will I have to use the builder? I can only find full image (instead of .deb) downloads and PiAware 2 .debs. Searches like google.nl/search?q=piaware_3.0.3_armhf.deb also only give self-built files.


#9

Building from source is the way to go for now. There will be an apt repository soon.


#10

Please see also installation using jprochazka’s automated scripts to build dump1090-mutability and Piaware 3 from source code.

I am not sure, but as far as I know, this method prevents installation of Piaware as root, and blocks auto update & sending commands. Please ask for confirmation in the thread linked below:

http://discussions.flightaware.com/post197189.html#p197189.

On two of my Pi I have used it, while on third one I have installed Piaware 3.0.4 img yesterday. Please see below screnshot of my Pi using install by jprochazka’s script: