i want to use vzctl to execute a script in a VPS.
this script use a variable exported in /etc/profile in the VPS.
But when i excute the vzctl command, the script don't see the variable.
if it's not clear :
#vzctl exec 710 sh /app/systeme/jboss-4.0.3SP1/bin/shutdown.sh -S
/app/systeme/jboss-4.0.3SP1/bin/shutdown.sh: line 76: exec: java: not found
kir Messages: 1625 Registered: August 2005 Location: Moscow, Russia
Senior Member
From: *sw.ru
Note that /etc/profile is for interactive shells. From the bash(1) man page:
Quote:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists.
So, /etc/profile is not the correct file to set up environment used by non-interactive scripts. See man bash or info bash for more info.