FlightAware Discussions

Piaware dpkg-query threads in background

I’ve noticed that piaware is running FOUR dpkg-query processes in the background CONTINUALLY. My system is already setup with the FlightAware repos and I keep the machine up to date using apt. So what is piaware doing here? And why four threads?
Raspberyy Pi 4 running Buster 64 bit

Sounds like something’s got stuck there, try restarting piaware? Usually on initial connection to the FlightAware servers, it’ll run dpkg-query to get package details on what version of piaware / dump1090 / etc is installed:

what are the details of these processes? Normally using top/htop you can see what exactly dpkg is trying to install

dpkg-query is not the same as dpkg

2 Likes

dpkg-query

dpkg-query is a tool to show information about packages listed in the dpkg database.

 

dpkg

dpkg is a tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude.

dpkg itself is controlled entirely via command line parameters, which consist of exactly one action and zero or more options. The action-parameter tells dpkg what to do and options control the behavior of the action in some way.

dpkg can also be used as a front-end to dpkg-deb and dpkg-query. If any such action is encountered dpkg just runs dpkg-deb or dpkg-query with the parameters given to it, but no specific options are passed to them. To use any such option the back-ends need to be called directly.

I just rebooted the machine and the four dpkg-query processes returned. atop shows that they were owned by piaware. Looking at them closer, they are RESTARTING. The PID numbers are increasing and atop is showing the previous remnants. atop display is recycling about every five seconds, so piaware seems to be reprocessing dpkg-query about every second??? What for??? atop also shows that each is chewing up about 1% CPU utilization. I wonder what the developer was thinking? Comparing software package versions occasionally may be appropriate, but every second is probably not.

Hi! That’s me, you just need to ask.

It’s only meant to do it once on login, in theory. Let me have a look tomorrow to see whether something’s gone awry there.

What’s your setup, exactly?

1 Like

For the purposes of this discussion… This is a Raspberyy Pi 4B w/ 4GB ram and Buster running 64 bit. piaware and piaware-repository packages are both at version 6.1. I also have Webmin installed that very reliably informs me when any package is available to be installed. I hope that your code isn’t going to attempt an upgrade on its own.

What distribution, specifically? What image did you start from?

Did you install from the prebuilt packages or did you build your own?

Depends if you told it to or not (see the allow-manual-updates and allow-auto-updates options, which default to disabled for non-piaware-sdcard-image installs)

I can’t reproduce that here, and I don’t have any long-lived dpkg-query processes, but I can reproduce that piaware is forking 2 dpkg-query processes every 5 seconds. They each complete within ~50ms so I’ve never caught them on top so far, just in strace:

04:28:10.167146 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f89078) = 24858
[...]
04:28:10.213824 wait4(24858, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24858

It’s fallout from a change to include the current dump1090/dump978 versions in the local status file that drives the piaware-web local status page; when reviewing those changes I missed that there was a relatively-expensive operation being called every time. We should definitely cache those results. Thanks for the bug report.

You might want to investigate why your system is so much slower to run dpkg-query compared to mine (Pi 4, piaware sdcard image), though.

My new dietpi/readsb system seems to have piaware but i cannot add to server flightaware
its just not there
would the above have something to do with the problem perhaps
heres return

root@DietPi:~# sudo systemctl status piaware
● piaware.service - FlightAware ADS-B uploader
     Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-10-07 08:12:27 BST; 1 day 13h ago
       Docs: https://flightaware.com/adsb/piaware/
   Main PID: 449 (piaware)
      Tasks: 3 (limit: 2153)
        CPU: 1h 19min 58.716s
     CGroup: /system.slice/piaware.service
             ├─   449 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
             └─768978 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout

Oct 08 20:33:23 DietPi piaware[449]: 1192126 msgs recv'd from readsb (2686 in last 5m); 1192126 msgs sent to FlightAware
Oct 08 20:38:23 DietPi piaware[449]: 1194835 msgs recv'd from readsb (2709 in last 5m); 1194835 msgs sent to FlightAware
Oct 08 20:43:23 DietPi piaware[449]: 1197580 msgs recv'd from readsb (2745 in last 5m); 1197580 msgs sent to FlightAware
Oct 08 20:48:23 DietPi piaware[449]: 1200279 msgs recv'd from readsb (2699 in last 5m); 1200279 msgs sent to FlightAware
Oct 08 20:53:23 DietPi piaware[449]: 1202808 msgs recv'd from readsb (2529 in last 5m); 1202808 msgs sent to FlightAware
Oct 08 20:58:23 DietPi piaware[449]: 1205264 msgs recv'd from readsb (2456 in last 5m); 1205264 msgs sent to FlightAware
Oct 08 21:03:23 DietPi piaware[449]: 1207812 msgs recv'd from readsb (2548 in last 5m); 1207812 msgs sent to FlightAware

Above two quotes. are self-contradictory.

What are outputs of following three commands?

sudo journalctl -u piaware | grep "site statistics URL"

sudo journalctl -u piaware | grep "logged in to FlightAware as user"

sudo journalctl -u piaware | grep "my feeder ID is"

 

root@DietPi:~# root@DietPi:~# sudo systemctl status piaware
-bash: root@DietPi:~#: command not found
root@DietPi:~# ● piaware.service - FlightAware ADS-B uploader
-bash: ●: command not found
root@DietPi:~#      Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
-bash: syntax error near unexpected token `('
root@DietPi:~#      Active: active (running) since Thu 2021-10-07 08:12:27 BST; 1 day 13h ago
-bash: syntax error near unexpected token `('
root@DietPi:~#        Docs: https://flightaware.com/adsb/piaware/
-bash: Docs:: command not found
root@DietPi:~#    Main PID: 449 (piaware)
-bash: syntax error near unexpected token `('
root@DietPi:~#       Tasks: 3 (limit: 2153)
-bash: syntax error near unexpected token `('
root@DietPi:~#         CPU: 1h 19min 58.716s
-bash: CPU:: command not found
root@DietPi:~#      CGroup: /system.slice/piaware.service
-bash: CGroup:: command not found
root@DietPi:~#              ├─   449 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
-bash: ├─: command not found
root@DietPi:~#              └─768978 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout
-bash: └─768978: command not found
root@DietPi:~#
root@DietPi:~# Oct 08 20:33:23 DietPi piaware[449]: 1192126 msgs recv'd from readsb (2686 in last 5m); 1192126 msgs sent to FlightAware
> Oct 08 20:38:23 DietPi piaware[449]: 1194835 msgs recv'd from readsb (2709 in last 5m); 1194835 msgs sent to FlightAware
-bash: syntax error near unexpected token `('
root@DietPi:~# Oct 08 20:43:23 DietPi piaware[449]: 1197580 msgs recv'd from readsb (2745 in last 5m); 1197580 msgs sent to FlightAware
> Oct 08 20:48:23 DietPi piaware[449]: 1200279 msgs recv'd from readsb (2699 in last 5m); 1200279 msgs sent to FlightAware
-bash: syntax error near unexpected token `('
root@DietPi:~# Oct 08 20:53:23 DietPi piaware[449]: 1202808 msgs recv'd from readsb (2529 in last 5m); 1202808 msgs sent to FlightAware
> Oct 08 20:58:23 DietPi piaware[449]: 1205264 msgs recv'd from readsb (2456 in last 5m); 1205264 msgs sent to FlightAware
-bash: syntax error near unexpected token `('
root@DietPi:~# Oct 08 21:03:23 DietPi piaware[449]: 1207812 msgs recv'd from readsb (2548 in last 5m); 1207812 msgs sent to FlightAware

root@DietPi:~# sudo journalctl -u piaware | grep "logged in to FlightAware as user"
Oct 07 08:12:42 DietPi piaware[449]: logged in to FlightAware as user guest

(1) Issue following TWO commands if you already have an existing feeder-id:

sudo piaware-config feeder-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

sudo systemctl restart piaware

 

NOTE: Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx by the 32 character Unique Identifier at your “My ADS-B” web page.

(2) If you want a brand new station number, then dont use method in (1) above. Go to claims page to claim a brand new station number:

https://flightaware.com/adsb/piaware/claim

 

i hit claim few times over 5 minute period no luck
will add above number
that dont seem to work either will keep trying

To be able to claim, the Computer or Tablet or Phone from which you are visiting the claims page must be on the same Local Network / Router to which the DietPi is connected.

only 1 network router all pi’s come off same dns box
i am using ssh on pc but its all same netwoprk
yes check ips network all correct
added lcd and keyboard/mouse so i got direct input
but no luck yet
i will reboot dns box tplink

none of that works
im on same network
i am on dietpi would that make any difference

No, it should not make any difcerence. I am myself using DietPi for my station #76000