Commit Graph

23 Commits

Author SHA1 Message Date
Pranav Jerry 710da18af9
moved naxalnet.service to the main directory 2021-12-01 21:34:40 +05:30
Pranav Jerry 1f8be50dd6
moved systemd service to a dir
This is to add another service file alongside naxalnet.service
2021-10-22 11:11:11 +05:30
Pranav Jerry 61a96ea3b3
updated documentation and some other changes
Made messages printed in Makefile more understandable. Removed full path
of naxalnet from the systemd service. Now you can start naxalnet even if
it is installed in /usr/local/bin, if systemd allows (I have not tested
it). Many comments were made to respect the 80 chars per line rule.
And, of course, added some political commentary to insult the global
superpower (superpower in terms of money, military and something else I
forgot). And removed MANIFEST.in, which probably haven't changed anything.
2021-10-02 14:13:53 +05:30
Pranav Jerry 87612fac2c
delete interface during cleanup
Read the previous commit for some unhelpful remarks.
2021-09-27 22:48:13 +05:30
Pranav Jerry 2e4c3a70a4
cleanup before exit
This was previously done by the systemd service. But since we allowed
changing the name of bat0 and bridge0, we can't expect systemd to still
do that job. Commented out some lines in the systemd service and made it
send SIGINT instead of the default SIGTERM to kill naxalnet. I
accidentally used to increment a2, a3, a4, ... in the __version__
instead of dev1, dev2, &c. a few commits back. Removed some print()
lines lurking somewhere in the code. The cleanup is still not completed.
We still have to delete the interfaces bridge0 and bat0, or whatever
name the user gives it. Just out of boredom, I added some description to
some network configuration, though so I doubt if anyone will understand
it more because of that.
2021-09-27 22:30:07 +05:30
Pranav Jerry a81449b898
changed how network config is done
We now use NetworkD() to configure systemd-networkd.
Path.glob doesn't return things in alphabetical order, which is needed
to configure networkd without any error. Need a fix for that.
2021-09-27 10:00:59 +05:30
Pranav Jerry 2a8930ce00
remove ipfs url from README.md
I don't use IPFS anymore. If anyone if willing to maintain a copy of
this repo on ipfs, send me an email.

Small change in CHANGELOG, and edited comments in systemd service.
And added a docstring to setup.py so the editor won't complain of
missing docstring anymore.
2021-09-10 11:42:18 +05:30
Pranav Jerry 68b53ccad1
implemented daemon
naxalnet is now a daemon! When run from systemd, it checks for new
devices or removal of devices and reloads the wifi configuration.
Updated the systemd service and changed Type to notify. Unfortunately,
there is some problem with logging. The messages from naxalnet.iwd could
not be found in the systemd journal or while running without --systemd.
2021-09-07 11:19:14 +05:30
Pranav Jerry 2d9aee4d3a
added --systemd and --verbose arguments
When run without --systemd, naxalnet will log to stderr.
Otherwise, it will log to systemd journal.

log.py is no longer needed.
2021-09-06 14:57:54 +05:30
Pranav Jerry e4a7fa5d3f
renamed systemd-networkd config files 2021-09-04 12:59:26 +05:30
Pranav Jerry 4ea53e5a35
implemented logging
- New dependency -- python-systemd for logging to journal
- Changed service file to start after networkd
- New submodule which contains "logger" for use by all other submodules
- Removed bus argument from Device and Adapter classes
2021-08-25 15:52:46 +05:30
Pranav Jerry 7e0fe5ef4c
many changes -- see full commit message
The config file is now installed as /etc/naxalnet/naxalnet.conf.example
by default.
make uninstall now does not ask for confirmation. Added rule purge in
Makefile.
Updated the README.
Changed order of stop commands in service file.
Updated setup.cfg and docstrings.
2021-08-18 17:33:46 +05:30
Pranav Jerry d1ec77dc69
clean up runtime files when stopped
This only applies to the systemd service
2021-08-17 09:49:16 +05:30
Pranav Jerry e99b3222e1
simplified systemd-networkd reload in naxalnet.service 2021-08-16 21:29:27 +05:30
Pranav Jerry d18160c46c
disabled buffering in python
Buffering makes the systemd journal not show the logs at the right time.
And changed the systemd service file so that the new batman and bridge
interfaces are deleted when naxalnet.service is stopped. Also simplified
the Stopping section in the README because of this change.
2021-08-16 18:56:17 +05:30
Pranav Jerry 397269823d
almost ready for merge
* Improved CHANGELOG, README, HACKING
* Added naxalnet.conf containing default values. This will be installed
along with the package.
2021-08-15 15:02:28 +05:30
Pranav Jerry 19137faab3
reduced 5s delay in the systemd service to 2s 2021-07-26 15:58:50 +05:30
Pranav Jerry 79b9a161f1
Now supports AP!
Fixed error when already connected to ad-hoc or ap.
Removed some print() lines I had forgot to remove after debugging.
But we can't close #1 yet (need to update the README)
2021-06-15 14:00:48 +05:30
Pranav Jerry 0fb8b6a8ab
stopped messing with resolv.conf
Completely removed the part that symlinks resolv.conf
to systemd-resolved's conf. Instead, added an optional
dependency of resolved in README.md
2021-06-12 19:28:59 +05:30
Pranav Jerry 1d2d4b2d88
many changes
Looks like issue #3 is fixed. Added an AUR package
to the README. Fixed another bug related to linking
resolv.conf (I didn't know Path.exsts() checks the destination
if Path was a symlink). Changed how it deals with resolv.conf if
it is a symlink or normal files. Also, added a 'RestartSec=5sec'
to the systemd service.
2021-06-11 10:15:35 +05:30
Pranav Jerry 7e513b8475
temporary fix for issue #3
Added a Restart=on-failure on the systemd service.
Now, after an error, the service will restart,
and this time it should not exit with an error.
This will make naxalnet.service work until #3
is fixed.
2021-06-10 09:15:58 +05:30
Pranav Jerry e28a0f7583 Changed systemd service
Fixed permissions in install lines in Makefile.
The systemd service now stops NetworkManager and
wpa_supplicant before starting naxalnet. It also
starts systemd-{networkd,resolved} and iwd alongside
naxalnet.service.
2021-06-06 11:25:37 +05:30
Pranav Jerry 45e4326e31 Changed systemd service 2021-05-22 15:14:16 +05:30
Renamed from naxalnet@.service (Browse further)