Command 'ifconfig' not found in PATH

Antworten
Ryukishi
Beiträge: 17
Registriert: 09 Sep 2010, 10:08

Command 'ifconfig' not found in PATH

Beitrag von Ryukishi »

Hey Leute,

ich hab schon wieder ein Problem: Ich hab auf dem Opsiserver (Debian 5.0.8) einen Cronjob eingerichtet, der einmal im Monat "opsi-product-updater -i -vv" und anschliessend "opsi-setup --set-rights" ausführt.

Beim ausführen von "opsi-setup --set-rights" kommt es allerdings zu einem Fehler:

Code: Alles auswählen

[5] [Feb 01 22:00:26] Setting rights (opsi-setup|392)
[5] [Feb 01 22:00:26] Getting current system config (opsi-setup|70)
[2] [Feb 01 22:00:26] Traceback: (Logger.py|710)
[2] [Feb 01 22:00:26]      line 2772 in '<module>' in file '/usr/bin/opsi-setup' (Logger.py|710)
[2] [Feb 01 22:00:26]      line 2731 in 'main' in file '/usr/bin/opsi-setup' (Logger.py|710)
[2] [Feb 01 22:00:26]      line 404 in 'setRights' in file '/usr/bin/opsi-setup' (Logger.py|710)
[2] [Feb 01 22:00:26]      line 84 in 'getSysConfig' in file '/usr/bin/opsi-setup' (Logger.py|710)
[2] [Feb 01 22:00:26]      line 376 in 'getNetworkDeviceConfig' in file '/usr/lib/pymodules/python2.5/OPSI/System/Posix.py' (Logger.py|710)
[2] [Feb 01 22:00:26]      line 593 in 'which' in file '/usr/lib/pymodules/python2.5/OPSI/System/Posix.py' (Logger.py|710)
[2] [Feb 01 22:00:26]      ==>>> Command 'ifconfig' not found in PATH (opsi-setup|2780)

ERROR: Command 'ifconfig' not found in PATH
Der Fehler tritt nur beim Cronjob auf, bei manueller Ausführung läuft alles sauber durch.
Der Cronjob wird von root ausgeführt. Root ist sowohl in der Gruppe "pcpatch" als auch in "opsiadmin".
"ifconfig" lässt sich auch so normal ausführen, ist also auch in "PATH" drin.

Viele Grüße
Ryukishi
Jimdo - Pages to the People
Jimdo GmbH

Create your own JimdoFree-Page at http://www.jimdo.com!
karni
Beiträge: 193
Registriert: 08 Okt 2009, 14:07

Re: Command 'ifconfig' not found in PATH

Beitrag von karni »

Cron kennt die environment variablen nicht.

So soll es funktionieren:
* * * * * export PATH=/bin:/sbin:/usr/bin:/usr/sbin; opsi-setup --set-rights

* - mit deinem schedule ersetzen. Zusätzliche Pfade kannst du auch konfigurieren.
Antworten