PATH problem when vzctl called from crontab [message #39456] |
Mon, 26 April 2010 12:05 |
dooblem
Messages: 1 Registered: April 2010
|
Junior Member |
|
|
Hello,
Just in case it can help somebody else...
We ran into the following problem :
When calling "/usr/sbin/vzctl stop VM" from crontab, the stop initscripts in the VM are not called. VM is automatically force-stopped after a 2 minutes timeout.
To test it, I added a "echo test >/root/test" in the stop section of the /etc/init.d/cron initscript.
When stopping the VM from an interactive shell : no problem, the initscripts are called.
When stopping the VM from the crontab : initscripts are not called.
Simply setting the PATH corrected the problem :
# if we do not set the path, vzctl stop do no stop vms correctly when called from crontab
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
It seems that the vzctl command depends on the $PATH envvar.
Is it a bug or not ?
I don't think so bug I'm not sure.
---------
Debian 5.0.4
vzctl version 3.0.22
2.6.26-2-openvz-amd64
|
|
|