flightaware/dump1090_mr — pull request #6 by mutability (2014-11-19 22:15:53+00:00)
Title: dump1090 packaging - run as an unprivileged user

This builds on #5 - most of the commits are from that pull request and will disappear if/when #5 is merged.

Most of the new changes are in 41dd7f2736eab18d8c6652c6023b3d8f01f078aa.

This adds a new init.d file that follows the standard debian skeleton (only used when packaging for Debian); the new init.d file reads options from /etc/default/fadump1090 and defaults to running the daemon as the user "fa1090".

Also it adds a step in postinst that creates fa1090 as a system user if not already present.

Finally, the init.d file is installed using the debhelper mechanisms, so we get the correct rc.d-updating and service start/stop hooks in postinst/prerm for free.

The net effect is this:

```
$ sudo dpkg -i ../fadump1090_1.0-2_armhf.deb
Selecting previously unselected package fadump1090.
(Reading database ... 79345 files and directories currently installed.)
Unpacking fadump1090 (from ../fadump1090_1.0-2_armhf.deb) ...
Setting up fadump1090 (1.0-2) ...
[ ok ] Starting FlightAware dump1090 daemon: dump1090.
Processing triggers for man-db ...
$ ps auwxf
...
fa1090 12304 46.8 1.2 15828 6056 ? Rl 22:03 0:50 /usr/bin/dump1090 --quiet --net --net-ro-size 500 --net-ro-rate 5 --net-buffer 5
$ sudo dpkg -r fadump1090
(Reading database ... 79366 files and directories currently installed.)
Removing fadump1090 ...
[ ok ] Stopping FlightAware dump1090 daemon: dump1090.
Processing triggers for man-db ...
```