Seite 1 von 1

opsi-setup [Errno -2] Name or service not known

Verfasst: 27 Feb 2014, 16:55
von rkauskh
Hallo

Wenn ich opsi 4.0.4 nach Anleitung auf einem OpenSuse 12.2 installiere, bekomme ich beim Ausführen von

Code: Alles auswählen

opsi-setup --configure-mysql
zwar das Konfigurationsfenster für die MySQL-Datenbank (Getting started auf Seite 23) zu sehen, aber nach OK kommt:

Code: Alles auswählen

[2] [Feb 27 16:47:03] Traceback: (Logger.py|754)
[2] [Feb 27 16:47:03]      line 3192 in '<module>' in file '/usr/bin/opsi-setup' (Logger.py|754)
[2] [Feb 27 16:47:03]      line 3144 in 'main' in file '/usr/bin/opsi-setup' (Logger.py|754)
[2] [Feb 27 16:47:03]      line 2255 in 'configureMySQLBackend' in file '/usr/bin/opsi-setup' (Logger.py|754)
[2] [Feb 27 16:47:03]      line 118 in 'getSysConfig' in file '/usr/bin/opsi-setup' (Logger.py|754)
[2] [Feb 27 16:47:03]      ==>>> [Errno -2] Name or service not known (opsi-setup|3196)
Versuche ich mich mit

Code: Alles auswählen

mysql -u root -p
auf der DB einzuloggen, kommt erwartungsgemäß die Paßwortabfrage und danach steht die Verbindung.

Hat jemand eine Idee was die Fehlermeldung im Setup auslöst und wie ich das beheben kann?

Re: opsi-setup [Errno -2] Name or service not known

Verfasst: 27 Feb 2014, 17:17
von SisterOfMercy
/usr/bin/opsi-setup is a python script.

When you look at it, around line 118 you see this:

Code: Alles auswählen

	sysConfig['hostname'] = sysConfig['fqdn'].split(u'.')[0]
	sysConfig['domain'] = u'.'.join(sysConfig['fqdn'].split(u'.')[1:])
	if 'ipAddress' not in sysConfig:
		sysConfig['ipAddress'] = socket.gethostbyname(sysConfig['fqdn'])
		if sysConfig['ipAddress'].split(u'.')[0] in ('127', '169'):
			sysConfig['ipAddress'] = None
	sysConfig['hardwareAddress'] = None
So, my guess is your hostname is not correctly set. What is the output of hostname -f ?

Re: opsi-setup [Errno -2] Name or service not known

Verfasst: 27 Feb 2014, 19:32
von rkauskh
Hello

hostname -f return the correct fqdn opsi.mydomain.de
getent $(hostname -f) return correct IP and fqdn 192.168.1.150 opsi.mydomain.de

EDIT: if I assign hostname to loopback address by adding

Code: Alles auswählen

127.0.0.2 opsi.mydomain.de
to /etc/hosts mysql setup runs without errors. Can't believe this is right.