naxalnet gets stopped at boot in GNOME #21

Closed
opened 2021-10-22 07:29:09 +02:00 by pranav · 8 comments
Owner

naxalnet.service gets stopped when it is enabled.

It is caused when geoclue.service is started by gnome-shell. geoclue in turn starts wpa_supplicant, which conflicts with naxalnet and therefore systemd stops naxalnet.

Here is some data from the systemd journal:

12:08:02  systemd[1]: Starting Setup mesh networks...
...
12:08:22  systemd[1]: Started Setup mesh networks.
12:08:22  /usr/bin/naxalnet[503]: Checking for internet connection
12:08:22  /usr/bin/naxalnet[503]: Adding temporary config /usr/share/naxalnet/networkd/tmp.01-eth.network
12:08:30  systemd[1]: Starting Location Lookup Service...
...
12:08:30  systemd[1]: Stopping Setup mesh networks...
12:08:31  systemd[1]: naxalnet.service: Deactivated successfully.
12:08:31  systemd[1]: Stopped Setup mesh networks.
...
12:08:31  systemd[1]: Starting WPA supplicant...
12:08:31  systemd[1]: Started WPA supplicant.
12:08:30  dbus-daemon[406]: [system] Activating via systemd: service name='org.freedesktop.GeoClue2' unit='geoclue.service' requested by ':1.18' <- :1.18 is gnome-shell
12:08:31  systemd[1]: Started Location Lookup Service.
`naxalnet.service` gets stopped when it is enabled. It is caused when `geoclue.service` is started by gnome-shell. geoclue in turn starts wpa_supplicant, which conflicts with naxalnet and therefore systemd stops naxalnet. Here is some data from the systemd journal: ``` 12:08:02 systemd[1]: Starting Setup mesh networks... ... 12:08:22 systemd[1]: Started Setup mesh networks. 12:08:22 /usr/bin/naxalnet[503]: Checking for internet connection 12:08:22 /usr/bin/naxalnet[503]: Adding temporary config /usr/share/naxalnet/networkd/tmp.01-eth.network 12:08:30 systemd[1]: Starting Location Lookup Service... ... 12:08:30 systemd[1]: Stopping Setup mesh networks... 12:08:31 systemd[1]: naxalnet.service: Deactivated successfully. 12:08:31 systemd[1]: Stopped Setup mesh networks. ... 12:08:31 systemd[1]: Starting WPA supplicant... 12:08:31 systemd[1]: Started WPA supplicant. 12:08:30 dbus-daemon[406]: [system] Activating via systemd: service name='org.freedesktop.GeoClue2' unit='geoclue.service' requested by ':1.18' <- :1.18 is gnome-shell 12:08:31 systemd[1]: Started Location Lookup Service. ```
pranav added the
bug
label 2021-10-22 07:29:09 +02:00
Author
Owner

This does not occur when I mask wpa_supplicant.service

This does not occur when I mask `wpa_supplicant.service`
pranav started working 2021-10-22 07:32:22 +02:00
pranav referenced this issue from a commit 2021-10-22 07:34:11 +02:00
Author
Owner

I added a temporary fix in the README. See the commit referenced above

I added a temporary fix in the README. See the commit referenced above
pranav added a new dependency 2021-10-22 08:30:42 +02:00
Author
Owner

I'm working on a fix by adding a Conflicts=wpa_supplicant.service line to iwd.service and removing the same from naxalnet.service. This will cause naxalnet to exit with an error, which will make systemd restart naxalnet again.

I'm working on a fix by adding a `Conflicts=wpa_supplicant.service` line to iwd.service and removing the same from naxalnet.service. This will cause naxalnet to exit with an error, which will make systemd restart naxalnet again.
pranav referenced this issue from a commit 2021-10-22 08:37:16 +02:00
Author
Owner

Added a sleep(2) to the setup_device function. When iwd is stopped, it signals interface removed to naxalnet. naxalnet tries to reload the wireless configuration and exits with error because iwd is stopped. This makes systemd restart naxalnet and it lives on happily ever after :)

Added a sleep(2) to the setup_device function. When iwd is stopped, it signals interface removed to naxalnet. naxalnet tries to reload the wireless configuration and exits with error because iwd is stopped. This makes systemd restart naxalnet and it lives on happily ever after :)
Author
Owner

Unfortunately, this could cause some problem with NetworkManager when iwd is used as the backend instead of wpa_supplicant.

Maybe we could revert the sleep(2) and add ExecStartPost=systemctl try-restart naxalnet.service to wpa_supplicant.service

Unfortunately, this could cause some problem with `NetworkManager` when iwd is used as the backend instead of wpa_supplicant. Maybe we could revert the sleep(2) and add `ExecStartPost=systemctl try-restart naxalnet.service` to wpa_supplicant.service
Author
Owner

Or, we could revert the commits and just remove the Conflicts=wpa_supplicant.service from naxalnet.service, thus saving the complexity of maintaining service overrides and preventing other conflicts. Anyway, on a machine used by non-devs, only NetworkManager configures wpa_supplicant, not some other program. Since NetworkManager conflicts with naxalnet, it will be stopped when naxalnet starts. And geoclue does not configure any wifi connections with wpa_supplicant, so we are probably better off without the Conflicts=wpa_supplicant.service line

Or, we could revert the commits and just remove the `Conflicts=wpa_supplicant.service` from naxalnet.service, thus saving the complexity of maintaining service overrides and preventing other conflicts. Anyway, on a machine used by non-devs, only NetworkManager configures wpa_supplicant, not some other program. Since NetworkManager conflicts with naxalnet, it will be stopped when naxalnet starts. And geoclue does not configure any wifi connections with wpa_supplicant, so we are probably better off without the `Conflicts=wpa_supplicant.service` line
Author
Owner

Deleted all the overrides and just removed all references to wpa_supplicant from naxalnet.service.

naxalnet is supposed to create a mesh without too much configuration from the non-hacker. And the non-hacker probably won't have any wpa_supplicant config files configured (the wifi is probably setup by NetworkManager via D-Bus). So we assume starting wpa_supplicant without starting NetworkManager won't cause any harm (are we confused yet?)

Deleted all the overrides and just removed all references to wpa_supplicant from naxalnet.service. naxalnet is supposed to create a mesh without too much configuration from the non-hacker. And the non-hacker probably won't have any wpa_supplicant config files configured (the wifi is probably setup by NetworkManager via D-Bus). So we assume starting wpa_supplicant without starting NetworkManager won't cause any harm (are we confused yet?)
Author
Owner

Finished. I'll make a new minor release

Finished. I'll make a new minor release
pranav stopped working 2021-10-22 09:54:49 +02:00
2h 22min 27s
pranav referenced this issue from a commit 2021-10-22 10:00:15 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 2 hours 22 minutes
pranav
2 hours 22 minutes
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
#22 fix for issue #21
pranav/pybatmesh
Reference: pranav/pybatmesh#21
No description provided.