Hello
I happen to have two network interfaces on my new, up-to-date, CentOS 6.2, named eth0 and virbr0 (3 of them if I include the lo interface).
However the system APIs like getaddrinfo() only return the address for the virbr0 interface (which was created by the CentOS installation), when I would like to have them both.
Even if I give the configured eth0 address explicitly to getnameinfo(), it can not perform the reverse lookup to my hostname, and returns a string with the same numeric IP address given as argument. I also can not get the list of samba name aliases for my host name.
I can happily ping my host from a different computer on the eth0 network, so the nmb service binds on eth0 and works as expected.
I have installed and configured smb, nmb and winbind services, and I have added 'wins' to /etc/nsswitch.conf, so my hosts line there looks like: hosts: files wins mdns4_minimal [NOTFOUND=return] dns
Is there something I should do for wins name service to return all IP addresses ?
Are there some similar settings that I need to do in order to get the reverse lookup to work ?
For reference here are my system information and application output, as follows.
Here are my interfaces: [adrian@adrian projects]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:1C:C0:DA:63:75 inet addr:10.0.0.154 Bcast:10.255.255.255 Mask:255.0.0.0 inet6 addr: fe80::21c:c0ff:feda:6375/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1222539 errors:0 dropped:0 overruns:0 frame:0 TX packets:708669 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1491421614 (1.3 GiB) TX bytes:136206085 (129.8 MiB) Interrupt:20 Memory:d0600000-d0620000
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:751048 errors:0 dropped:0 overruns:0 frame:0 TX packets:751048 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:208785657 (199.1 MiB) TX bytes:208785657 (199.1 MiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:92:B0:1A inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:4038 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:393067 (383.8 KiB)
And here is how my applications behave: [adrian@adrian projects]$ python Python 2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import socket socket.gethostbyname_ex('adrian')
('adrian', [], ['192.168.122.1'])
for a in socket.getaddrinfo('adrian', None, 0, 0, 0,
socket.AI_CANONNAME) : ... print a ... (2, 1, 6, 'adrian', ('192.168.122.1', 0)) (2, 2, 17, '', ('192.168.122.1', 0)) (2, 3, 0, '', ('192.168.122.1', 0))
[adrian@adrian projects]$
As you can see there are no name aliases returned, and there is only one IP address given for my host name.
You can see my samba name aliases here: [adrian@adrian projects]$ nmblookup -A -T 10.0.0.154 Looking up status of 10.0.0.154 ADRIAN <00> - B <ACTIVE> ADRIAN <03> - B <ACTIVE> ADRIAN <20> - B <ACTIVE> ..__MSBROWSE__. <01> - <GROUP> B <ACTIVE> TERMINATORUL <00> - B <ACTIVE> TERMINATORUL <03> - B <ACTIVE> TERMINATORUL <20> - B <ACTIVE> TIMOTHY <00> - B <ACTIVE> TIMOTHY <03> - B <ACTIVE> TIMOTHY <20> - B <ACTIVE> TOUGHY <00> - B <ACTIVE> TOUGHY <03> - B <ACTIVE> TOUGHY <20> - B <ACTIVE> WORKGROUP <1d> - B <ACTIVE> WORKGROUP <1e> - <GROUP> B <ACTIVE> WORKGROUP <00> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
(namely adrian, terminatorul, timothy, toughy). Trying to resolve my hostname to an IP address with nmblookup also returns just one of the IP addresses:
[adrian@adrian projects]$ nmblookup adrian querying adrian on 192.168.122.255 192.168.122.1 adrian<00> [adrian@adrian projects]$
For some times I'm loosing graphical applications usage as pirut and system-config-users, Yum auto update is not working too but I can update with command lin yum update
Versions instlalled pirut-1.3.28-19.el5.centos.noarch.rpm system-config-users-1.2.51-7.el5.rpm
Do somebody have an idea for a solution
--- Michel Donais
On 05/05/2012 03:44 AM, Michel Donais wrote:
For some times I'm loosing graphical applications usage as pirut and system-config-users, Yum auto update is not working too but I can update with command lin yum update
Versions instlalled pirut-1.3.28-19.el5.centos.noarch.rpm system-config-users-1.2.51-7.el5.rpm
Do somebody have an idea for a solution
Run both commands from terminal and see what error is being reported.
On 05/05/2012 03:44 AM, Michel Donais wrote:
For some times I'm loosing graphical applications usage as pirut and system-config-users, Yum auto update is not working too but I can update with command lin yum update
Versions instlalled pirut-1.3.28-19.el5.centos.noarch.rpm system-config-users-1.2.51-7.el5.rpm
Do somebody have an idea for a solution
Run both commands from terminal and see what error is being reported.
Thak's to care, For pirut I get: Unable to import modules. Maybe yoy'r not running undr X? But I'm under X with KDE
For system-config-users I get: Trace back (most recent call last): File "/usr/share/system-config-users/system-config-users.py",linne 25, in? import libuser ImportError: no module name libuser
I checked and libsepol-1.15.2-3.el5 is there also /user/lib/libuser and .so , .so.1, .so.1.1.6 etc are there
If I type at command line import libuser I get the same reaction as running "system-config-users" the program seem to turn round but no execution and tnhen stop But if I look in /etc/libuser.conf I see a line as: # The default (/usr/lib*/libuser) is actually correct Do I have to think that the modules should be in /user/lib/libuser/ instead of /usr/lib/
What should be my next move? --- Michel Donais
Yum auto update is not working too but I can update with command lin yum update
import libuser
ImportError: no module name libuser
Hi. Both the issue and the message are similar to some errors I receive if
I forget to change to CentOS default Python before using yum & Co. You probably already checked for this but anyway: Do you have more than one Python intallation, or did you compile Python from source, or used a package that installed a Non-CentOS-default Python version? Regards, Jesus
Yum auto update is not working too but I can update with command lin yum update
import libuser
ImportError: no module name libuser
Hi. Both the issue and the message are similar to some errors I receive if
I forget to change to CentOS default Python before using yum & Co. You probably already checked for this but anyway: Do you have more than one Python intallation, or did you compile Python from source, or used a package that installed a Non-CentOS-default Python version?
Where should be default python Packages are only installed by yum update usually CR but I also have some updates been made from epel but can't remember wich
--- Michel Donais
Where should be default python
Hi Michel. Type python --version on the command prompt. CentOS 6.2 has Python 2.6.6, CentOS 5.6, 5.7, 5.8 have Python 2.4.3. Epel should not have installed a different python. Maybe you only need to reinstall the library so Python recognizes it???
On 05/06/2012 04:18 PM, Michel Donais wrote:
On 05/05/2012 03:44 AM, Michel Donais wrote:
For some times I'm loosing graphical applications usage as pirut and system-config-users, Yum auto update is not working too but I can update with command lin yum update
Versions instlalled pirut-1.3.28-19.el5.centos.noarch.rpm system-config-users-1.2.51-7.el5.rpm
Do somebody have an idea for a solution
Run both commands from terminal and see what error is being reported.
Thak's to care, For pirut I get: Unable to import modules. Maybe yoy'r not running undr X? But I'm under X with KDE
For system-config-users I get: Trace back (most recent call last): File "/usr/share/system-config-users/system-config-users.py",linne 25, in? import libuser ImportError: no module name libuser
I checked and libsepol-1.15.2-3.el5 is there also /user/lib/libuser and .so , .so.1, .so.1.1.6 etc are there
If I type at command line import libuser I get the same reaction as running "system-config-users" the program seem to turn round but no execution and tnhen stop But if I look in /etc/libuser.conf I see a line as: # The default (/usr/lib*/libuser) is actually correct Do I have to think that the modules should be in /user/lib/libuser/ instead of /usr/lib/
What should be my next move?
Try "yum reinstall libuser", or "yum install libuser"
actual re-installed version is libuser.i386 0:0.54.7-2.1.el5_5.2
Hi Michel. Maybe something related to root / non-root? Or: Can you check your Python version? Can you enter into Pythons cli (just type python) and then type "import libuser"? If you don't get an error message, I don't know. If you do, type "print (sys.path)", one of the paths should be something like "/usr/lib/python2.4/site-packages/". After exiting the python cli, you can check if your libusermodule.so can be found under this path or one of python's sys.path? Regards, Jesus
First trial from root
[root@serveur ~]# python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import libuser
"no error there; so it found it's way to libuser"
print (sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
"here it seem that there is no path defined
= = = = = = = = = = = = = = = = = = = = = = = = = = = = Second trial (non-root) /usr/michel
[michel@serveur ~]$ python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
inport libuser
File "<stdin>", line 1 inport libuser ^ SyntaxError: invalid syntax
print(sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
I think we are near a solution
--- Michel Donais
On Sun, May 6, 2012 at 3:45 PM, Michel Donais donais@telupton.com wrote:
First trial from root
[root@serveur ~]# python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import libuser
"no error there; so it found it's way to libuser"
print (sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
"here it seem that there is no path defined
You need to import sys
= = = = = = = = = = = = = = = = = = = = = = = = = = = = Second trial (non-root) /usr/michel
[michel@serveur ~]$ python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
inport libuser
import not inport
File "<stdin>", line 1 inport libuser ^ SyntaxError: invalid syntax
print(sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
I think we are near a solution
Michel Donais _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 05/06/2012 11:45 PM, Michel Donais wrote:
inport libuser
its: import libuser, M instead of N
From root
[root@serveur ~]# python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import libuser print (sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
import sys print (sys.path)
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']
import libuser
Larry Martell seem's to have the right way. sys is not defined.
Where should I pout it to get it permanent aund use pirut under X
[root@serveur ~]# su michel
[michel@serveur root]$ python Python 2.4.3 (#1, Feb 22 2012, 16:06:13) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import libuser print (sys.path)
Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'sys' is not defined
import sys print (sys.path)
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']
[michel@serveur root]$ >>> import sys bash: syntax error near unexpected token `>' [michel@serveur root]$ >>> print (sys.path) bash: syntax error near unexpected token `>' [michel@serveur root]$ ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages'] [michel@serveur root]$ >>> import libuser bash: syntax error near unexpected token `>' [michel@serveur root]$ >>> bash: syntax error near unexpected token `>'
[michel@serveur root]$ [root@serveur ~]# su michel [michel@serveur root]$ [michel@serveur root]$ python bash: [michel@serveur: command not found [michel@serveur root]$ Python 2.4.3 (#1, Feb 22 2012, 16:06:13) bash: syntax error near unexpected token `(' [michel@serveur root]$ [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 bash: syntax error near unexpected token `(' [michel@serveur root]$ Type "help", "copyright", "credits" or "license" for more information. [michel@serveur root]$ >>> import libuser bash: syntax error near unexpected token `>' [michel@serveur root]$ >>> print (sys.path) bash: syntax error near unexpected token `>' [michel@serveur root]$ Traceback (most recent call last): bash: syntax error near unexpected token `most' [michel@serveur root]$ File "<stdin>", line 1, in ? bash: File: command not found [michel@serveur root]$ NameError: name 'sys' is not defined bash: NameError:: command not found [michel@serveur root]$ >>> import sys bash: syntax error near unexpected token `>' [michel@serveur root]$ >>> print (sys.path) bash: syntax error near unexpected token `>' [michel@serveur root]$ ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']
Larry Martell seem's to have the right way. sys is not defined.
Where should I pout it to get it permanent aund use pirut under X
Hi Michel. This is only to print a sys variable; you don't need to do anything there. So your default python finds the libuser library, the error you saw before with import libuser is not coming from this python, at least as root. Does it make sense to remove pirut and re-install it? I don't use it, I have absolutely no idea which consequences it may have removing and reinstalling pirut for software that was already installed under pirut.
Hi Michel. This is only to print a sys variable; you don't need to do anything there. So your default python finds the libuser library, the error you saw before with import libuser is not coming from this python, at least as root. Does it make sense to remove pirut and re-install it? I don't use it, I have absolutely no idea which consequences it may have removing and reinstalling pirut for software that was already installed under pirut.
It's already been done, uninstall and re-install pirut without success. The version removed end the re-installed one were at the same level
For Centos-5.8 I've a test machine both are at the same level of update. If I do >>>print (sys.path) on the production machine, I get
import sys print (sys.path)
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']
And on the test machine I get
import sys print (sys.path)
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/gtk-2.0']
If I refer at Larry Martell message, he pointed that the problem was with sys.path
If I look in ?usr/lib/python2.4/site-packages/ numeric in there on the test machine but absent on the production one
I tried to re-install python-numeric.i386 0:23.7-2.2.2.el5_6.1 and nothig change; numeric is still not there
On these facts, can somebody point me a solution?
--- Michel Donais