tsunghanliu / adsb-box.snap

a snap to build a ADS-B receiver station
28 stars 4 forks source link

overly verbose logging #55

Open dlasher opened 2 years ago

dlasher commented 2 years ago

While troubleshooting a crash issue on a pi3b+, I noticed that adsb-box is logging verbosely -- poked around for a while, couldn't figure out how to stop it.

Example:

Sep 2 18:43:24 localhost adsb-box.collectd[898]: + snapctl is-connected system-observe Sep 2 18:43:24 localhost adsb-box.collectd[898]: + '[' 0 -eq 1 ']' Sep 2 18:43:24 localhost adsb-box.collectd[898]: + for plug in $PLUGS Sep 2 18:43:24 localhost adsb-box.collectd[898]: + snapctl is-connected network-observe Sep 2 18:43:25 localhost adsb-box.collectd[898]: + '[' 0 -eq 1 ']' Sep 2 18:43:25 localhost adsb-box.collectd[898]: + for plug in $PLUGS Sep 2 18:43:25 localhost adsb-box.collectd[898]: + snapctl is-connected mount-observe Sep 2 18:43:25 localhost adsb-box.collectd[898]: + WAIT=1 Sep 2 18:43:25 localhost adsb-box.collectd[898]: + '[' 1 -eq 1 ']' Sep 2 18:43:25 localhost adsb-box.collectd[898]: + sleep 10 Sep 2 18:43:27 localhost adsb-box.piaware[922]: + break Sep 2 18:43:27 localhost adsb-box.piaware[922]: + '[' 1 -eq 0 ']' Sep 2 18:43:27 localhost adsb-box.piaware[922]: + true Sep 2 18:43:27 localhost adsb-box.piaware[922]: + WAIT=0 Sep 2 18:43:27 localhost adsb-box.piaware[922]: + for plug in $PLUGS Sep 2 18:43:27 localhost adsb-box.piaware[922]: + snapctl is-connected system-observe Sep 2 18:43:27 localhost adsb-box.piaware[922]: + '[' 0 -eq 1 ']' Sep 2 18:43:27 localhost adsb-box.piaware[922]: + for plug in $PLUGS Sep 2 18:43:27 localhost adsb-box.piaware[922]: + snapctl is-connected network-observe Sep 2 18:43:27 localhost adsb-box.piaware[922]: + '[' 0 -eq 1 ']' Sep 2 18:43:27 localhost adsb-box.piaware[922]: + for plug in $PLUGS Sep 2 18:43:27 localhost adsb-box.piaware[922]: + snapctl is-connected mount-observe Sep 2 18:43:27 localhost adsb-box.piaware[922]: + WAIT=1 Sep 2 18:43:27 localhost adsb-box.piaware[922]: + '[' 1 -eq 1 ']' Sep 2 18:43:27 localhost adsb-box.piaware[922]: + sleep 10

How do I shut that off?

dlasher commented 2 years ago

(wouldn't mind stopping all the apparmor spam while we're at it:

Sep 2 18:44:41 localhost kernel: [ 629.629231] audit: type=1400 audit(1662144281.899:145): apparmor="DENIED" operation="mknod" profile="snap.adsb-box.rbfeeder" name="/var/log/rbfeeder.log" pid=1711 comm="rbfeeder" requested_mask="c" denied_mask="c" fsuid=0 ouid=0 Sep 2 18:44:41 localhost kernel: [ 629.629341] audit: type=1400 audit(1662144281.899:146): apparmor="DENIED" operation="mknod" profile="snap.adsb-box.rbfeeder" name="/var/log/rbfeeder.log" pid=1711 comm="rbfeeder" requested_mask="c" denied_mask="c" fsuid=0 ouid=0 Sep 2 18:44:41 localhost kernel: [ 629.629475] audit: type=1400 audit(1662144281.899:147): apparmor="DENIED" operation="mknod" profile="snap.adsb-box.rbfeeder" name="/var/log/rbfeeder.log" pid=1711 comm="rbfeeder" requested_mask="c" denied_mask="c" fsuid=0 ouid=0 Sep 2 18:44:41 localhost kernel: [ 629.629595] audit: type=1400 audit(1662144281.899:148): apparmor="DENIED" operation="mknod" profile="snap.adsb-box.rbfeeder" name="/var/log/rbfeeder.log" pid=1711 comm="rbfeeder" requested_mask="c" denied_mask="c" fsuid=0 ouid=0

tsunghanliu commented 1 year ago

The logs in the 1st comment are because some of connections are not ready. I'm adding additional controls to disable this kind of logs. Meanwhile, you can check if the snap connections are properly connected like these:

$ snap connections adsb-box
Interface         Plug                       Slot               Notes
hardware-observe  adsb-box:hardware-observe  :hardware-observe  manual
mount-observe     adsb-box:mount-observe     :mount-observe     manual
network           adsb-box:network           :network           -
network-bind      adsb-box:network-bind      :network-bind      -
network-observe   adsb-box:network-observe   :network-observe   manual
process-control   adsb-box:process-control   :process-control   manual
raw-usb           adsb-box:raw-usb           :raw-usb           manual
system-observe    adsb-box:system-observe    :system-observe    manual

If not, you can use sudo snap connect adsb-box:[plug-name to connect. for instance: sudo snap connect adsb-box:system-observe.

For the logs in the 2nd comment, I will also fix it in the coming release.