baycom / tfrec

SDR tool for receiving wireless sensor data (TFA IT+ KlimaLogg Pro, LaCrosse, WeatherHub)
GNU General Public License v2.0
68 stars 19 forks source link

Exit or restart on failure #3

Closed git-developer closed 6 years ago

git-developer commented 7 years ago

I'm running tfrec on Debian as a systemd service with argument -e so that it runs forever and calls an executable every time it receives a message. In the last weeks I observed a few times that the service is alive but does not call the executable anymore. I found the following messages in the log system:

Aug  9 18:01:35 hostname tfrec[31202]: cb transfer status: 1, canceling...
Aug  9 18:01:36 hostname kernel: [9355422.616497] usb 1-1.3.2: USB disconnect, device number 53
Aug  9 18:01:36 hostname kernel: [9355422.850214] usb 1-1.3.2: new high-speed USB device number 54 using dwc_otg
Aug  9 18:01:36 hostname kernel: [9355422.962243] usb 1-1.3.2: New USB device found, idVendor=0bda, idProduct=2838
Aug  9 18:01:36 hostname kernel: [9355422.962266] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug  9 18:01:36 hostname kernel: [9355422.962280] usb 1-1.3.2: Product: RTL2838UHIDIR
Aug  9 18:01:36 hostname kernel: [9355422.962293] usb 1-1.3.2: Manufacturer: Realtek
Aug  9 18:01:36 hostname kernel: [9355422.962305] usb 1-1.3.2: SerialNumber: 00000001

I suppose that the connection to the DVB-T stick is unstable (maybe a weak power supply). Thus I configured the systemd service to restart on failure:

[Service]
Type=simple
ExecStart=/usr/bin/tfrec -q -e /path/to/executable
Restart=on-failure
RestartSec=5

Unfortunately, this does not help. the tfrec process does not die but keeps running without function. This is uncomfortable since the system is not able to detect and handle the failure.

Thus I request to either exit the process on such a failure, or handle it somehow.

git-developer commented 7 years ago

Different tool, same problem: dump1090 issue #41

git-developer commented 6 years ago

Fixed in commit 65c85ab.