what sripts runs when you vzctl into a ve?
Hi, Is there a particular script that runs and sets the environment, etc. for the shell when you vzctl into a server. I notice that when I'm in the hardware node I have my regular bash enviroment but when I vzctl enter into a ve it is all set to blank: bash-3.00# env TERM=screen PWD=/ SHLVL=1 HOME=/ HISTFILE=/dev/null _=/bin/env Can I edit this to set a preferred set of vars? Thanks!
Re: what sripts runs when you vzctl into a ve?
Below is the excerpt from vzctl sources, file src/enter.c. You can see that all environment variables and their values are hardcoded. If you want your normal environment, you should ssh to your VPS as you would do with a normal remote server -- vzctl enter is designed to be used as a "last resort" or "quick and dirty way of accessing your VPS". char *arg[] = {"bash", "--login", "-i", NULL}; char *env[] = {"HOME=/", "HISTFILE=/dev/null", "PATH=/bin:/sbin:/usr/bin:/usr/sbin:", NULL, NULL}; ... if ((term = getenv("TERM")) != NULL) { snprintf(buf, sizeof(buf), "TERM=%s", term); env[2] = buf; }
Just type: su - When you're at the bash prompt. Problem solved