OpenVZ Forum - RDF feed
type: channel
items: what sripts runs when you vzctl into a ve?
items: Re: what sripts runs when you vzctl into a ve?

what sripts runs when you vzctl into a ve?
type: item
description: 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!
creator: vmvmvm
date: 2006-01-07T05:33:22-00:00

Re: what sripts runs when you vzctl into a ve?
type: item
description: 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; }
creator: kir
date: 2006-01-07T13:16:17-00:00

Re: what sripts runs when you vzctl into a ve?
type: item
description: Just type: su - When you're at the bash prompt. Problem solved
creator: phpfreak
date: 2006-01-08T05:46:15-00:00