Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change netcat-maint script to be started via a systemd service #1

Merged
merged 2 commits into from Sep 9, 2019

Conversation

wiedehopf
Copy link
Collaborator

Hey James,

i've been wondering if you would be interested to change over the scripts to be started via systemd service.

Raspbian per default logs systemd service to the systemd journal, which is held in memory.
This is nice as no log rotation or anything is needed while still having the ability to check the log.

pi@pi ~ % sudo journalctl -fu adsbexchange-feed
-- Logs begin at Sat 2019-07-20 03:38:09 CEST. --
Jul 24 23:49:11 pi systemd[1]: adsbexchange-feed.service: Succeeded.
Jul 24 23:49:11 pi systemd[1]: Stopped adsbexchange-feed.
Jul 24 23:49:11 pi systemd[1]: Started adsbexchange-feed.
Jul 24 23:49:41 pi adsbexchange-feed[1155]: Connected to feed.adsbexchange.com:30005

In this PR i've only changed over the netcat maint script, but changing over MLAT as well would be easy, but wanted to ask first if you are interested.

@adsbxchange
Copy link
Owner

adsbxchange commented Sep 9, 2019

I think I might create a separate systemd installer script.

systemd tends to create more problems than it solves.

@wiedehopf wiedehopf closed this Sep 9, 2019
@adsbxchange adsbxchange reopened this Sep 9, 2019
@adsbxchange adsbxchange merged commit 67ef994 into adsbxchange:master Sep 9, 2019
@adsbxchange
Copy link
Owner

I think I resolved the conflict and merged the request correctly.

@wiedehopf
Copy link
Collaborator Author

Oh you decided to use it.

I can make the same changes for the mlat-client as well so the logs for that are accessible as well.

@adsbxchange
Copy link
Owner

adsbxchange commented Sep 9, 2019

Yeah might as well make it support systemd going forward.

I haven't testing to see if it works from scratch.
mlat-client fails to build Ubuntu 18.04 using dpkg .. something is missing pyversions

$ dpkg-buildpackage -b -uc
dpkg-buildpackage: info: source package mlat-client
dpkg-buildpackage: info: source version 0.2.6
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Oliver Jowett oliver@mutability.co.uk
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build mlat-client
fakeroot debian/rules clean
dh clean --with python3
dh: Compatibility levels before 9 are deprecated (level 8 in use)
debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/ryzen/adsb-exchange/mlat-client'
dh_auto_clean
dh_auto_clean: Compatibility levels before 9 are deprecated (level 8 in use)
Can't exec "pyversions": No such file or directory at /usr/share/perl5/Debian/Debhelper/Buildsystem/python_distutils.pm line 121.
dh_auto_clean: failed to run pyversions
debian/rules:31: recipe for target 'override_dh_auto_clean' failed
make[1]: *** [override_dh_auto_clean] Error 2
make[1]: Leaving directory '/home/ryzen/adsb-exchange/mlat-client'
debian/rules:36: recipe for target 'clean' failed
make: *** [clean] Error 2

@adsbxchange
Copy link
Owner

dh clean --with python3 --buildsystem=pybuild

seems to work ..

@adsbxchange
Copy link
Owner

Hopefully Debian/Ubuntu specific and not Raspbian

@adsbxchange
Copy link
Owner

forcing

sudo apt install --reinstall python-minimal python3-minimal

fixed it

@adsbxchange
Copy link
Owner

sudo systemctl status adsbexchange-feed.service
● adsbexchange-feed.service - adsbexchange-feed
Loaded: loaded (/lib/systemd/system/adsbexchange-feed.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-09-09 09:17:48 MST; 31s ago
Main PID: 4961 (adsbexchange-fe)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/adsbexchange-feed.service
├─4961 /bin/sh /usr/local/bin/adsbexchange-feed.sh
└─5034 ping -q -c 2 -W 5 feed.adsbexchange.com

Sep 09 09:17:48 ryzen-MS-7A38 systemd[1]: Started adsbexchange-feed.
Sep 09 09:18:19 ryzen-MS-7A38 adsbexchange-feed[4961]: Connected to feed.adsbexchange.com:30005
Sep 09 09:18:19 ryzen-MS-7A38 adsbexchange-feed[4961]: 2019/09/09 09:18:19 socat[5038] E connect(5, AF=2 127.0.0.1:30005, 16): Connection refused
Sep 09 09:18:19 ryzen-MS-7A38 adsbexchange-feed[4961]: Disconnected

Seems to work on my Ubuntu desktop.

If you want to convert ADSBx MLAT to a service as well. That would be great! Thanks!

@wiedehopf
Copy link
Collaborator Author

Why aren't you using mlat-client version 0.2.10 instead of 0.2.6?

In setup.sh
56 MLATCLIENTVERSION="0.2.6"
57 MLATCLIENTTAG="v0.2.6"

Probably doesn't make any difference.
0.2.10 is working fine for me with your server version just so you know.

You'd have to update your mlat-client fork to 0.2.10.

@adsbxchange
Copy link
Owner

adsbxchange commented Sep 9, 2019

Way back when there were significant bugs past 0.2.6

FlightAware hired Oliver and stopped all dev on these projects - we kept it at the stable version at the time

maybe 0.2.10 is just as good or better .. not sure

@wiedehopf
Copy link
Collaborator Author

I think it might solve some problems with the newer python versions.
For me 0.2.10 has been solid.

At least dump1090 is still open source even if the webinterface is branded.
(But i've made my own improved webinterface so that doesn't bother me)

The server version has an experimental branch which should help with synchronization when the feeders are clumped together. (tree sync instead of syncing every receiver pair individually)
But i have never tried and it would probably be quite a hassle to get that working.

@adsbxchange
Copy link
Owner

We can give it a go.

Recommendations for setting up the mlat-client as service?

@adsbxchange
Copy link
Owner

I tried the experimental branch on an MLAT slice and it seems to be non-functional.

@wiedehopf
Copy link
Collaborator Author

mlat-client as systemd service is in this pull request: #2
(made it 3 days ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants