Finally a Network Manager for FreeBSD!

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#26
Looks like the dependencies are not all listed. I am running a mostly stock system here with no python installs besides what xfce4 and some tools want to have. When trying to run the networkmgr, it simply quits and does nothing. Now before I hit you with several hundred KB worth of ktrace output, I will see if something jumps out at me, but it is some reading I need to do.
Indeed, network-manager (networkmgr) is a WIP. I simply made it in response to a request for it. It "works" just enough to say it does. To what degree, will (currently) vary from (user) system, to system. I requested feedback, right from the start (as seen in many of my previous posts) for just this/ese reasons.
But bashing/complaining without any (prior) initiation, isn't of any value to anyone. :)
sudo(8) is a pre-req, as root has no place on the desktop (Xorg(1). So all of the commands (if not already provided by the scripts) need to be prefaced by sudo(8). In a future version, I will add the option to make(1) for su(1), as well. But let's try to get this running smoothly, rather than adding additional variables, first. :)
 

Crivens

Moderator
Staff member
Moderator

Thanks: 689
Messages: 1,645

#27
Indeed, network-manager (networkmgr) is a WIP. I simply made it in response to a request for it. It "works" just enough to say it does. To what degree, will (currently) vary from (user) system, to system. I requested feedback, right from the start (as seen in many of my previous posts) for just this/ese reasons.
But bashing/complaining without any (prior) initiation, isn't of any value to anyone. :)
sudo(8) is a pre-req, as root has no place on the desktop (Xorg(1). So all of the commands (if not already provided by the scripts) need to be prefaced by sudo(8). In a future version, I will add the option to make(1) for su(1), as well. But let's try to get this running smoothly, rather than adding additional variables, first. :)
That is why I said I would look trough the dumps and see for myself if I can spot it. If there was a known dependency currently missing, "because everyone has that", it would have saved me the trouble to find that again. So that is why I gave that response. I made attempts to start the manager using sudo, starting it as root, ... no change. But fear not, I will not complain without enough data attached to prove me wrong ;) (if I am), as any good scientist should do.
 

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#29
That is why I said I would look trough the dumps and see for myself if I can spot it. If there was a known dependency currently missing, "because everyone has that", it would have saved me the trouble to find that again. So that is why I gave that response. I made attempts to start the manager using sudo, starting it as root, ... no change. But fear not, I will not complain without enough data attached to prove me wrong ;) (is I am), as any good scientist should do.
Meant no disrespect, Crivens. Just "telling it, like it is". ;) and am greatful for any useful feedback, and further investigation you'd be willing to provide. :)

Thanks!

--Chris
 

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#30
You should try to compile the port in a clean jail, self fabricated clean jail or with ports-mgmt/poudriere. That would very quickly reveal the missing dependencies.
Good advise, indeed, kpa!
But still doesn't provide as valuable information as actual usage feedback.
I'm pretty sure I know where the issue(s) lie. Mostly in the scripts call to the functions they (intend) to provide. I'm going to spend some time with them, today. In hopes of being able to overcome the current issue(s).

Thanks again, kpa.

--Chris
 

Crivens

Moderator
Staff member
Moderator

Thanks: 689
Messages: 1,645

#31
You should try to compile the port in a clean jail, self fabricated clean jail or with ports-mgmt/poudriere. That would very quickly reveal the missing dependencies.
That might not tell me much-there are no error messages or unresolved symbols. It simply returns to the console, doing nothing. maybe I need to update my ports tree, maybe it is something else. Time will tell.
 

chrbr

Aspiring Daemon

Thanks: 234
Messages: 650

#32
Dear Crivens,
I think most of the part is python code. It is quite likely that just some python stuff is missing. If you like to have an early look on the software I suggest to proceed as below:
find ./ -name "*.py" | xargs grep import | sort | uniq digs for the parts which python likes to import from external extensions. It gave me
Code:
./networkmgr.py:from subprocess import call
./networkmgr.py:from sys import path
./networkmgr.py:from trayicon import trayIcon
./networkmgr/authentication.py:from net_api import openinfo, bssidinfo, lockinfo, findRSN, enableWifi, findWPA
./networkmgr/authentication.py:import gtk
./networkmgr/net_api.py:# import os
./networkmgr/net_api.py:# import re
./networkmgr/net_api.py:from subprocess import Popen, PIPE, STDOUT, call
./networkmgr/net_api.py:from sys import path
./networkmgr/netcardmgr.py:from subprocess import Popen, PIPE, call
./networkmgr/trayicon.py:from authentication import Authentication, Open_Wpa_Supplicant
./networkmgr/trayicon.py:from net_api import ifWlanInRc, disableWifi, enableWifi
./networkmgr/trayicon.py:from net_api import netstate, ssidliste, barpercent, keyinfo, get_ssid
./networkmgr/trayicon.py:from net_api import startwirednetwork, wifidisconnection, ifWlan, ifStatue
./networkmgr/trayicon.py:from net_api import stopallnetwork, startallnetwork, connectToSsid
./networkmgr/trayicon.py:from net_api import wiredonlineinfo, wiredconnectedinfo, stopwirednetwork
./networkmgr/trayicon.py:from sys import path
./networkmgr/trayicon.py:from time import sleep
./networkmgr/trayicon.py:import gobject as GObject
./networkmgr/trayicon.py:import gtk
./networkmgr/trayicon.py:import locale
./networkmgr/trayicon.py:import threading
./setup.py:import os
./setup.py:import shutil
The import xxx and from xxx import zzz loads extensions of python. Please open a python shell by python -i and launch import gtk and so on. Errors should guide you which python extension might be missing. trayicon should be related to the software itself. I am just not sure about net_api. I think
Chris_H can tell which extension is related to that extension. It fails on my system. Regarding the shell scripts ./networkmgr/functions-networking.sh refers to kde4 as it tries to access run /usr/local/kde4/bin/pc-nettray. I am not sure if this can be a show stopper. I focused on python.
 

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#33
Dear Crivens,
...
Regarding the shell scripts ./networkmgr/functions-networking.sh refers to kde4 as it tries to access run /usr/local/kde4/bin/pc-nettray. I am not sure if this can be a show stopper. I focused on python.
The original (GhostBSD) version was based/ran on x11/kde4.
I'm pretty sure, it isn't a "show stopper", but only an additional option.
:)

--Thanks

--Chris
 

Crivens

Moderator
Staff member
Moderator

Thanks: 689
Messages: 1,645

#34
Dear Crivens,
I think most of the part is python code. It is quite likely that just some python stuff is missing. If you like to have an early look on the software I suggest to proceed as below:
find ./ -name "*.py" | xargs grep import | sort | uniq digs for the parts which python likes to import from external extensions. It gave me ...
Running that command line gives me
Code:
/usr/local/share/networkmgr % find ./ -name "*.py" | xargs grep import | sort | uniq
./authentication.py:from net_api import openinfo, bssidinfo, lockinfo, findRSN, enableWifi, findWPA
./authentication.py:import gtk
./net_api.py:# import os
./net_api.py:# import re
./net_api.py:from subprocess import Popen, PIPE, STDOUT, call
./net_api.py:from sys import path
./netcardmgr.py:from subprocess import Popen, PIPE, call
./trayicon.py:from authentication import Authentication, Open_Wpa_Supplicant
./trayicon.py:from net_api import ifWlanInRc, disableWifi, enableWifi
./trayicon.py:from net_api import netstate, ssidliste, barpercent, keyinfo, get_ssid
./trayicon.py:from net_api import startwirednetwork, wifidisconnection, ifWlan, ifStatue
./trayicon.py:from net_api import stopallnetwork, startallnetwork, connectToSsid
./trayicon.py:from net_api import wiredonlineinfo, wiredconnectedinfo, stopwirednetwork
./trayicon.py:from sys import path
./trayicon.py:from time import sleep
./trayicon.py:import gobject as GObject
./trayicon.py:import gtk
./trayicon.py:import locale
./trayicon.py:import threading
This is very different from what you got. I have used the .shar file which was attached by Lars Engels to the report as my starting point, which was the newest one. I hope that was the correct to pick. The imports listed above work, no problem there.
 

chrbr

Aspiring Daemon

Thanks: 234
Messages: 650

#35
I have used the tgz file, sorry I should have mentioned that. And I have overlooked the link to Bugzilla. Now I have used the shar file and run the installer. Checking the imput files (slightly different) gives
Code:
chris@esprimo:/usr/local/share/networkmgr $ find ./ -name "*.py" -exec grep import {} \; | sort | uniq
# import os
# import re
from authentication import Authentication, Open_Wpa_Supplicant
from net_api import ifWlanInRc, disableWifi, enableWifi
from net_api import netstate, ssidliste, barpercent, keyinfo, get_ssid
from net_api import openinfo, bssidinfo, lockinfo, findRSN, enableWifi, findWPA
from net_api import startwirednetwork, wifidisconnection, ifWlan, ifStatue
from net_api import stopallnetwork, startallnetwork, connectToSsid
from net_api import wiredonlineinfo, wiredconnectedinfo, stopwirednetwork
from subprocess import Popen, PIPE, STDOUT, call
from subprocess import Popen, PIPE, call
from sys import path
from time import sleep
import gobject as GObject
import gtk
import locale
import threading
Now from net_api import xxx relates to /usr/local/share/networkmgr/net_api.py and from authentication import xxx relates to /usr/local/share/networkmgr/authentication.py. The module gobject should be provided by installing devel/py-gobject and gtk should be handled by x11-toolkits/py-gtk2. The others as subprocess, sys, time, locale and threading should be provided by the standard python installation. On my system using x11-wm/i3 sudo networkmgr.py causes a small blue icon appear at the right lower part of the i3 bar. I have not noticed it in the first place.

I am just not sure about your setup. I now assume that the installation works. You have files as
Code:
chris@esprimo:/usr/local/share/networkmgr $ ls -altrG
total 136
-rw-r--r--  1 root  wheel  10073 14 Mär 04:56 trayicon.py.bak
-r-xr-xr-x  1 root  wheel  3976 14 Mär 04:56 authentication.py
-rw-r--r--  1 root  wheel  4355 20 Mär 22:06 netcardmgr.py.bak
-rw-r--r--  1 root  wheel  6892 12 Apr 18:59 net_api.py.bak
-r-xr-xr-x  1 root  wheel  4355 12 Apr 18:59 netcardmgr.py
-r-xr-xr-x  1 root  wheel  10073 12 Apr 18:59 trayicon.py
-r-xr-xr-x  1 root  wheel  6708 12 Apr 18:59 net_api.py
drwxr-xr-x  94 root  wheel  2560 12 Apr 18:59 ..
-r-xr-xr-x  1 root  wheel  400 12 Apr 18:59 detect-nics.sh
-r-xr-xr-x  1 root  wheel  119 12 Apr 18:59 detect-wifi.sh
-r-xr-xr-x  1 root  wheel  789 12 Apr 18:59 enable-net.sh
-r-xr-xr-x  1 root  wheel  12601 12 Apr 18:59 functions-networking.sh
-r-xr-xr-x  1 root  wheel  498 12 Apr 18:59 test-netup.sh
drwxr-xr-x  2 root  wheel  1536 12 Apr 18:59 icons
-r--r--r--  1 root  wheel  9001 12 Apr 19:00 net_api.pyc
-r--r--r--  1 root  wheel  4721 12 Apr 19:00 authentication.pyc
-r--r--r--  1 root  wheel  9590 12 Apr 19:07 trayicon.pyc
drwxr-xr-x  3 root  wheel  512 12 Apr 19:07 .
and in a python shell import gtk and import gobject give no error. Do I miss anything?
Regarding the version, does python27 appear as
Code:
chris@esprimo:/usr/local/share/networkmgr $ python
Python 2.7.9 (default, Apr  8 2015, 19:02:20)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>>
?
Now the post might be longer than it should be. I hope it is ok and I hope it helps.
 

fredvs

Active Member

Thanks: 17
Messages: 199

#36
Hello and congrats for that absolutely must package.

Does it needs GTK or Qt to work or is it "pure" xorg ?

Does it work with JWM window manager ?

Thanks.

Fre;D
 

ericturgeon

Well-Known Member

Thanks: 65
Messages: 367

#37
Networkmgr need Operator to work, but since Operator might be the most unsecured peace of software I have written, I am writting gbsudo, this would act a bit like gksu, but for sudo only and it should alow us to save some software to be exempt of sudo password for the current session or permanently until the user remove it from the list.
 

vermaden

Son of Beastie

Thanks: 1,078
Messages: 2,710

#38
Networkmgr need Operator to work, but since Operator might be the most unsecured peace of software I have written, I am writting gbsudo, this would act a bit like gksu, but for sudo only and it should alow us to save some software to be exempt of sudo password for the current session or permanently until the user remove it from the list.
Why not use BSD licensed 'doas' from Ports?
 

905mickeym

New Member


Messages: 1

#42
I switched from PCBSD to FreeBSD after 2 years since it did not want to use z file system and an updater that messed up my boot manager. FreeBSD is a very good client and server.

I have 2 nics and found that PCBSD Network Mgr is not needed to switch between them as a simple script will do it.

Here is the steps in root or sudo wheel and followup each step with netstat and ifconfig ::

NOTE : Desktop is client not server.

TO SWITCH TO THE ALTERNATE NIC ::

1.) ifconfig default-nic down

2.) route flush

3.) hostname alternate-nic-hostname

4.) ifconfig alternate-nic inet alternate-nic-static-address netmask 255.255.255.0 up

5.) route add default router-gateway-address

DONE. Default nic is down and alternate nic is up. Routing table checks out OK.

TO SWITCH BACK TO THE DEFAULT NIC ::

1.) /etc/rc.d/netif stop

2,) route flush

3.) hostname default-hostname(in rc.conf)

4.) /etc/netstart

DONE. Default nic is up and alternate nic is down since netstart uses the default network specified in rc.conf.
Routing table checks out OK.


Make sure that all of your nic hostnames appear in the user .Xauthority file. Check this file open with emacs.
If needed run xauth then xauth add to list it.

GUI NOTE : For all those who like X buttons , annunciators and control panels then a simple Gtk widget factory has simplicity. FreeBSD has it all.
 
Last edited:

ericturgeon

Well-Known Member

Thanks: 65
Messages: 367

#43
vermaden I have a ports ready for testing. I would appreciate if anyone would try it and even look at the port code.

Code:
git clone https://github.com/GhostBSD/ports.git
Code:
cd ports/net-mgmt/networkmgr
Code:
sudo make install clean
Basically what I am looking for is if there is any error when compiling the port and if NetworkMgr work well after the port installation.
 

lme@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 290
Messages: 767

#44
Thanks for the port!

I think you should run portlint -AC in sysutils/networkmgr.

There are a lot of warnings.
 

weyland-yutani

New Member

Thanks: 2
Messages: 16

#47
First and foremost, thank you for your work. The question is whether to run networkmgr I need to have wifimgr. If you uninstall wifimgr networkmgr does not work.

Also can networkmgr save the keys of different networks?

thanks for everything
 

Phishfry

Son of Beastie

Thanks: 1,062
Messages: 3,106

#49
ericturgeon
I want to say good job on this program. I have had the wireless bug for a while.
I was previously using wifimgr which does work, but I do like your program much more.
I create multiple FreeBSD AP's and switching back and forth on your program works well. Been using it since it hit pkg on Xfce4.

Now what would it take to add cell modem connections for a mobile warrior?
I want auto switching between PPP/MPD5 and Wifi depending on Wifi availability.

Keep up the great work.
 
Top