Seite 1 von 1

Command 'ifconfig' not found in PATH

Verfasst: 08 Mär 2011, 16:57
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

Re: Command 'ifconfig' not found in PATH

Verfasst: 09 Mär 2011, 08:51
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.