From 1f8be50dd60259ab8b01ea1904c492a1b8f33aef Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 11:11:11 +0530 Subject: [PATCH 1/7] moved systemd service to a dir This is to add another service file alongside naxalnet.service --- naxalnet/__init__.py | 2 +- naxalnet.service => service/naxalnet.service | 0 setup.cfg | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename naxalnet.service => service/naxalnet.service (100%) diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 094ce96..a91face 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0" +__version__ = "0.5.0a1.dev1" diff --git a/naxalnet.service b/service/naxalnet.service similarity index 100% rename from naxalnet.service rename to service/naxalnet.service diff --git a/setup.cfg b/setup.cfg index 28a8a15..67829aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ console_scripts = [options.data_files] lib/systemd/system = - naxalnet.service + service/naxalnet.service # If installing with pip, this file will be copied to some other place. # This is the reason we use setup.py instead of pip in the Makefile. /etc/naxalnet = From 6fbebc51bb6e05c6155f657f1a40140f2582d745 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 11:58:41 +0530 Subject: [PATCH 2/7] almost fixed things --- Makefile | 2 +- naxalnet/__init__.py | 2 +- service/iwd.service.d/naxalnet.conf | 4 ++++ service/naxalnet.service | 8 +++++--- setup.cfg | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 service/iwd.service.d/naxalnet.conf diff --git a/Makefile b/Makefile index 3ccfaf7..133d4c1 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ install: uninstall: $(PIP) uninstall -y naxalnet - rm -rf /usr/share/naxalnet /usr/lib/systemd/system/naxalnet.service + rm -rf /usr/share/naxalnet /usr/lib/systemd/system/naxalnet.service /usr/lib/systemd/system/iwd.service.d/naxalnet.conf @echo "make uninstall will not remove anything in /etc/naxalnet" && \ echo "Do 'sudo make purge' to remove it." diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index a91face..0af1e6f 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev1" +__version__ = "0.5.0a1.dev2" diff --git a/service/iwd.service.d/naxalnet.conf b/service/iwd.service.d/naxalnet.conf new file mode 100644 index 0000000..bc72d66 --- /dev/null +++ b/service/iwd.service.d/naxalnet.conf @@ -0,0 +1,4 @@ +[Unit] +# Fix for issue #21 +Conflicts=wpa_supplicant.service +After=wpa_supplicant.service diff --git a/service/naxalnet.service b/service/naxalnet.service index 2760618..1e04540 100644 --- a/service/naxalnet.service +++ b/service/naxalnet.service @@ -4,17 +4,19 @@ [Unit] Description=Setup mesh networks Requires=systemd-networkd.service -Requires=iwd.service +# See issue #21 to find out why we do not use Required for iwd +Wants=iwd.service Wants=systemd-resolved.service After=iwd.service After=systemd-networkd.service After=systemd-resolved.service # Stops NetworkManager and wpa_supplicant if already running Conflicts=NetworkManager.service -Conflicts=wpa_supplicant.service +# Commented out for testing +#Conflicts=wpa_supplicant.service # This stops networkmanager and wpa_supplicant when naxalnet is enabled After=NetworkManager.service -After=wpa_supplicant.service +#After=wpa_supplicant.service [Service] Type=notify diff --git a/setup.cfg b/setup.cfg index 67829aa..66b9760 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,8 @@ console_scripts = [options.data_files] lib/systemd/system = service/naxalnet.service +lib/systemd/system/iwd.service.d = + service/iwd.service.d/naxalnet.conf # If installing with pip, this file will be copied to some other place. # This is the reason we use setup.py instead of pip in the Makefile. /etc/naxalnet = From 270db3cf901c8906505be81464a05f1404b8be4d Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 12:06:17 +0530 Subject: [PATCH 3/7] added hack to fix #21 --- naxalnet/__init__.py | 2 +- naxalnet/scripts.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 0af1e6f..c5e7123 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev2" +__version__ = "0.5.0a1.dev3" diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index 89dd382..c3793c4 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -117,6 +117,8 @@ def setup_devices(): """ try: notify("STATUS=Setting up mesh...") + # This is a terrible hack to fix #21. See the issue for more details + time.sleep(2) iwd = IWD() devices = iwd.get_devices() adhoc_devices = [] From 295fde3f0b0d7126c37c1bd1de03ddcda972aad8 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 12:54:52 +0530 Subject: [PATCH 4/7] added override service for wpa_supplicant This probably isn't working like we want --- README.md | 2 ++ naxalnet/__init__.py | 2 +- naxalnet/scripts.py | 2 -- service/wpa_supplicant.service.d/naxalnet.conf | 3 +++ setup.cfg | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 service/wpa_supplicant.service.d/naxalnet.conf diff --git a/README.md b/README.md index a784eb8..1fa2411 100644 --- a/README.md +++ b/README.md @@ -219,12 +219,14 @@ sudo systemctl enable naxalnet.service Now naxalnet will start a mesh on every boot. + If you have NetworkManager enabled, which is the default in Ubuntu and Fedora, it should be disabled: diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index c5e7123..f51215a 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev3" +__version__ = "0.5.0a1.dev4" diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index c3793c4..89dd382 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -117,8 +117,6 @@ def setup_devices(): """ try: notify("STATUS=Setting up mesh...") - # This is a terrible hack to fix #21. See the issue for more details - time.sleep(2) iwd = IWD() devices = iwd.get_devices() adhoc_devices = [] diff --git a/service/wpa_supplicant.service.d/naxalnet.conf b/service/wpa_supplicant.service.d/naxalnet.conf new file mode 100644 index 0000000..44faf9c --- /dev/null +++ b/service/wpa_supplicant.service.d/naxalnet.conf @@ -0,0 +1,3 @@ +[Service] +# Fix for #21 +ExecStartPost=systemctl try-restart naxalnet.service diff --git a/setup.cfg b/setup.cfg index 66b9760..56b3dce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,6 +36,8 @@ lib/systemd/system = service/naxalnet.service lib/systemd/system/iwd.service.d = service/iwd.service.d/naxalnet.conf +lib/systemd/system/wpa_supplicant.service.d = + service/wpa_supplicant.service.d/naxalnet.conf # If installing with pip, this file will be copied to some other place. # This is the reason we use setup.py instead of pip in the Makefile. /etc/naxalnet = From aa079c7c297d8cb65eab2029ec7246bda305aa19 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 13:05:37 +0530 Subject: [PATCH 5/7] reverted the changes Instead, removed the wpa_supplicant "conflicts" line from naxalnet.service --- Makefile | 2 +- naxalnet/__init__.py | 2 +- service/iwd.service.d/naxalnet.conf | 4 ---- service/naxalnet.service | 8 ++------ service/wpa_supplicant.service.d/naxalnet.conf | 3 --- setup.cfg | 4 ---- 6 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 service/iwd.service.d/naxalnet.conf delete mode 100644 service/wpa_supplicant.service.d/naxalnet.conf diff --git a/Makefile b/Makefile index 133d4c1..3ccfaf7 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ install: uninstall: $(PIP) uninstall -y naxalnet - rm -rf /usr/share/naxalnet /usr/lib/systemd/system/naxalnet.service /usr/lib/systemd/system/iwd.service.d/naxalnet.conf + rm -rf /usr/share/naxalnet /usr/lib/systemd/system/naxalnet.service @echo "make uninstall will not remove anything in /etc/naxalnet" && \ echo "Do 'sudo make purge' to remove it." diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index f51215a..7bd9dda 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev4" +__version__ = "0.5.0a1.dev5" diff --git a/service/iwd.service.d/naxalnet.conf b/service/iwd.service.d/naxalnet.conf deleted file mode 100644 index bc72d66..0000000 --- a/service/iwd.service.d/naxalnet.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Unit] -# Fix for issue #21 -Conflicts=wpa_supplicant.service -After=wpa_supplicant.service diff --git a/service/naxalnet.service b/service/naxalnet.service index 1e04540..f8969e2 100644 --- a/service/naxalnet.service +++ b/service/naxalnet.service @@ -4,19 +4,15 @@ [Unit] Description=Setup mesh networks Requires=systemd-networkd.service -# See issue #21 to find out why we do not use Required for iwd -Wants=iwd.service +Requires=iwd.service Wants=systemd-resolved.service After=iwd.service After=systemd-networkd.service After=systemd-resolved.service -# Stops NetworkManager and wpa_supplicant if already running +# Stops NetworkManager if already running Conflicts=NetworkManager.service -# Commented out for testing -#Conflicts=wpa_supplicant.service # This stops networkmanager and wpa_supplicant when naxalnet is enabled After=NetworkManager.service -#After=wpa_supplicant.service [Service] Type=notify diff --git a/service/wpa_supplicant.service.d/naxalnet.conf b/service/wpa_supplicant.service.d/naxalnet.conf deleted file mode 100644 index 44faf9c..0000000 --- a/service/wpa_supplicant.service.d/naxalnet.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -# Fix for #21 -ExecStartPost=systemctl try-restart naxalnet.service diff --git a/setup.cfg b/setup.cfg index 56b3dce..67829aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,10 +34,6 @@ console_scripts = [options.data_files] lib/systemd/system = service/naxalnet.service -lib/systemd/system/iwd.service.d = - service/iwd.service.d/naxalnet.conf -lib/systemd/system/wpa_supplicant.service.d = - service/wpa_supplicant.service.d/naxalnet.conf # If installing with pip, this file will be copied to some other place. # This is the reason we use setup.py instead of pip in the Makefile. /etc/naxalnet = From 704fe646f81815f48eff7479c42b06df98474017 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 13:09:15 +0530 Subject: [PATCH 6/7] renamed systemd-networkd/ to network/ Nothing big. And naxalnet needs a new maintainer or I will keep screwing up things. --- naxalnet/__init__.py | 2 +- .../mesh.01-batman.netdev | 0 .../mesh.02-bridge.netdev | 0 .../mesh.03-wireless-ad-hoc.network | 0 .../mesh.04-batman.network | 0 .../mesh.05-wireless-ap.network | 0 .../mesh.06-eth.network | 0 .../mesh.07-bridge.network | 0 {systemd-networkd => network}/tmp.01-eth.network | 0 setup.cfg | 16 ++++++++-------- 10 files changed, 9 insertions(+), 9 deletions(-) rename {systemd-networkd => network}/mesh.01-batman.netdev (100%) rename {systemd-networkd => network}/mesh.02-bridge.netdev (100%) rename {systemd-networkd => network}/mesh.03-wireless-ad-hoc.network (100%) rename {systemd-networkd => network}/mesh.04-batman.network (100%) rename {systemd-networkd => network}/mesh.05-wireless-ap.network (100%) rename {systemd-networkd => network}/mesh.06-eth.network (100%) rename {systemd-networkd => network}/mesh.07-bridge.network (100%) rename {systemd-networkd => network}/tmp.01-eth.network (100%) diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 7bd9dda..67445cd 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev5" +__version__ = "0.5.0a1.dev6" diff --git a/systemd-networkd/mesh.01-batman.netdev b/network/mesh.01-batman.netdev similarity index 100% rename from systemd-networkd/mesh.01-batman.netdev rename to network/mesh.01-batman.netdev diff --git a/systemd-networkd/mesh.02-bridge.netdev b/network/mesh.02-bridge.netdev similarity index 100% rename from systemd-networkd/mesh.02-bridge.netdev rename to network/mesh.02-bridge.netdev diff --git a/systemd-networkd/mesh.03-wireless-ad-hoc.network b/network/mesh.03-wireless-ad-hoc.network similarity index 100% rename from systemd-networkd/mesh.03-wireless-ad-hoc.network rename to network/mesh.03-wireless-ad-hoc.network diff --git a/systemd-networkd/mesh.04-batman.network b/network/mesh.04-batman.network similarity index 100% rename from systemd-networkd/mesh.04-batman.network rename to network/mesh.04-batman.network diff --git a/systemd-networkd/mesh.05-wireless-ap.network b/network/mesh.05-wireless-ap.network similarity index 100% rename from systemd-networkd/mesh.05-wireless-ap.network rename to network/mesh.05-wireless-ap.network diff --git a/systemd-networkd/mesh.06-eth.network b/network/mesh.06-eth.network similarity index 100% rename from systemd-networkd/mesh.06-eth.network rename to network/mesh.06-eth.network diff --git a/systemd-networkd/mesh.07-bridge.network b/network/mesh.07-bridge.network similarity index 100% rename from systemd-networkd/mesh.07-bridge.network rename to network/mesh.07-bridge.network diff --git a/systemd-networkd/tmp.01-eth.network b/network/tmp.01-eth.network similarity index 100% rename from systemd-networkd/tmp.01-eth.network rename to network/tmp.01-eth.network diff --git a/setup.cfg b/setup.cfg index 67829aa..10e5e2f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,11 +39,11 @@ lib/systemd/system = /etc/naxalnet = naxalnet.conf.example share/naxalnet/networkd = - systemd-networkd/mesh.01-batman.netdev - systemd-networkd/mesh.02-bridge.netdev - systemd-networkd/mesh.03-wireless-ad-hoc.network - systemd-networkd/mesh.04-batman.network - systemd-networkd/mesh.05-wireless-ap.network - systemd-networkd/mesh.06-eth.network - systemd-networkd/mesh.07-bridge.network - systemd-networkd/tmp.01-eth.network + network/mesh.01-batman.netdev + network/mesh.02-bridge.netdev + network/mesh.03-wireless-ad-hoc.network + network/mesh.04-batman.network + network/mesh.05-wireless-ap.network + network/mesh.06-eth.network + network/mesh.07-bridge.network + network/tmp.01-eth.network From 26a907d90701af6e887dd83a1aafdd730437d901 Mon Sep 17 00:00:00 2001 From: Pranav Jerry Date: Fri, 22 Oct 2021 13:20:09 +0530 Subject: [PATCH 7/7] updated readme, changelog prepare to merge to master --- CHANGELOG.md | 4 ++++ README.md | 11 +---------- naxalnet/__init__.py | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba37af..aab9526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased][] - 2021-10-22 + +- Fixed stopping at boot when GNOME starts location service (#21) + ## [v0.5.0][] - 2021-10-10 - Better error messages diff --git a/README.md b/README.md index 1fa2411..624503c 100644 --- a/README.md +++ b/README.md @@ -219,15 +219,6 @@ sudo systemctl enable naxalnet.service Now naxalnet will start a mesh on every boot. - - If you have NetworkManager enabled, which is the default in Ubuntu and Fedora, it should be disabled: @@ -299,7 +290,7 @@ You can use the ap for connecting mobile phones and other devices to the mesh network. Read the code and the documentation in the code to learn the details. -See the directory [systemd-networkd](systemd-networkd) to see how +See the directory [network](network) to see how systemd-networkd configures the network. ## Use cases diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 67445cd..2cce3c2 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.0a1.dev6" +__version__ = "0.5.0a2"