mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2025-01-30 02:19:37 +05:30
simplified systemd-networkd reload in naxalnet.service
This commit is contained in:
parent
d18160c46c
commit
e99b3222e1
@ -10,6 +10,7 @@ After=iwd.service
|
|||||||
# Stops NetworkManager and wpa_supplicant if already running
|
# Stops NetworkManager and wpa_supplicant if already running
|
||||||
Conflicts=NetworkManager.service
|
Conflicts=NetworkManager.service
|
||||||
Conflicts=wpa_supplicant.service
|
Conflicts=wpa_supplicant.service
|
||||||
|
# This stops networkmanager and wpa_supplicant when naxalnet is enabled
|
||||||
After=NetworkManager.service
|
After=NetworkManager.service
|
||||||
After=wpa_supplicant.service
|
After=wpa_supplicant.service
|
||||||
|
|
||||||
@ -21,17 +22,21 @@ RestartSec=2sec
|
|||||||
# IWD takes some time to find devices.
|
# IWD takes some time to find devices.
|
||||||
# If naxalnet is run before iwd finds devices,
|
# If naxalnet is run before iwd finds devices,
|
||||||
# naxalnet cannot start a mesh network but exits without errors.
|
# naxalnet cannot start a mesh network but exits without errors.
|
||||||
# TODO: Remove this line when naxalnet becomes a daemon.
|
# So, we give a 2s delay.
|
||||||
ExecStartPre=/usr/bin/sleep 2
|
ExecStartPre=/usr/bin/sleep 2
|
||||||
ExecStart=/usr/bin/naxalnet
|
ExecStart=/usr/bin/naxalnet
|
||||||
# Reload systemd-networkd after naxalnet exits
|
# Reload systemd-networkd after naxalnet exits
|
||||||
ExecStartPost=/usr/bin/systemctl reload-or-restart systemd-networkd.service
|
ExecStartPost=/usr/bin/networkctl reload
|
||||||
# Delete the interfaces created
|
# Delete the interfaces created
|
||||||
ExecStopPost=/usr/bin/networkctl delete bridge0 bat0
|
ExecStopPost=/usr/bin/networkctl delete bridge0 bat0
|
||||||
# Make python flush messages the moment print() is called.
|
# Make python flush messages instead of buffering.
|
||||||
# Without this env variable, python stores output in a
|
# When reading the systemd journal, we need to see the messages
|
||||||
# buffer before flushing to stdout. But this is not needed
|
# in the exact order. There will suddenly be a lot of messages
|
||||||
# when naxalnet runs as a systemd service.
|
# from naxalnet, networkd, iwd and resolved. When buffering is on,
|
||||||
|
# we won't see the messages from naxalnet in the order they were
|
||||||
|
# printed. This, among other problems, make it hard while debugging.
|
||||||
|
# This will no longer be needed when naxalnet sends its messages
|
||||||
|
# directly to the systtemd journal instead of stdout.
|
||||||
Environment=PYTHONUNBUFFERED=1
|
Environment=PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user