Last active
December 14, 2019 09:34
-
-
Save wiedehopf/0f7691e536d5eb67da881a7a7afd46f9 to your computer and use it in GitHub Desktop.
readsb template systemd service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable start of all instances system startup: | |
systemctl enable readsb.service | |
# start/restart all instances: | |
systemctl restart readsb | |
# stop all: | |
systemctl stop readsb | |
# restart individual: | |
systemctl stop readsb@3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/default/readsb | |
# readsb configuration | |
# This is sourced by /etc/systemd/system/default.target.wants/readsb.service as | |
# daemon startup configuration. | |
RECEIVER_OPTIONS="" | |
DECODER_OPTIONS="" | |
NET_OPTIONS="--net-only --net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 0 --net-sbs-port 0 --net-bo-port 0" | |
JSON_OPTIONS="--json-location-accuracy 2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/systemd/system/readsb.service | |
# readsb service for systemd | |
# This service is actually a systemd target, | |
# but we are using a service since targets cannot be reloaded. | |
[Unit] | |
Description=readsb instances | |
Wants=network.target | |
After=network.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/systemctl --no-block start [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | |
ExecReload=/bin/true | |
[Install] | |
WantedBy=default.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/systemd/system/[email protected] | |
# readsb service for systemd | |
[Unit] | |
Description=readsb@%i | |
PartOf=readsb.service | |
ReloadPropagatedFrom=readsb.service | |
[Service] | |
EnvironmentFile=/etc/default/readsb | |
SyslogIdentifier=readsb%i | |
RuntimeDirectory=readsb%i | |
RuntimeDirectoryMode=0755 | |
ExecStart=/usr/local/bin/readsb \ | |
$RECEIVER_OPTIONS $DECODER_OPTIONS $NET_OPTIONS $JSON_OPTIONS --net-bi-port 2100%i --net-bo-port 430%i5 --net-vrs-port 381%i5\ | |
--write-json /run/readsb%i --quiet | |
Type=simple | |
Restart=on-failure | |
RestartSec=5 | |
RestartPreventExitStatus=64 | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment