OpenVZ Forum


Home » General » Support » PATH problem when vzctl called from crontab
PATH problem when vzctl called from crontab [message #39456] Mon, 26 April 2010 12:05
dooblem is currently offline  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
 
Read Message
Previous Topic: iptables shows 0 bytes at INPUT and OUTPUT
Next Topic: container connected to two subnets
Goto Forum:
  


Current Time: Mon Nov 18 14:23:31 GMT 2024

Total time taken to generate the page: 0.02772 seconds