I know that we're supposed to treat the VIO server like an appliance. We're supposed to set it up and let it run. But in this instance, we were still in the middle of setup. We were mapping LUNs to different vhost adapters for different clients, and we were going into oem_setup_env to install additional drivers.
Often I see customers set up their .profile with things like set –o vi, or customize their prompts with things like the user ID they're logged in with, their current working directory, their hostname, etc.
While you can certainly make changes to the /home/padmin/.profile file, they will usually go away whenever you upgrade your VIO server. That's fine; since we're supposed to treat it like an appliance, I understand that we shouldn't change things. In reality though, I continually find customers who alter the padmin .profile.
Even when customers change the .profile, those changes don't carry over when running the oem_setup_env command. For the sake of usability, something had to give in this case. Whenever we ran the oem_setup_env command, we had to run manually run /.profile. This customer was getting fed up.
After asking around for a more elegant solution, someone reminded me to just use a .kshrc file.
I was told to create a /home/padmin/.kshrc file. I put set –o vi and my other desired prompt settings into that file. Then at the end of the /home/padmin/.profile, I added:
export ENV=/home/padmin/.kshrc
This allowed the customer's desired environment to be set up automatically when he logged in as padmin. Then when he switched over to root by running the oem_setup_env command, that was set up as he wanted it.
Yes, I realize that .profile and .kshrc will have to be revisited when this customer upgrades his VIO server. But in the meantime, this technique allowed us to customize the environment to his liking. It helped me keep a customer happy. Maybe it will make you happy as well.




It did!!... it made me very happy!!!... since I spent a lot of time deploying solutions using many VIOS for many IBM customers...
Thanks a lot!
Posted by: Alfonso Jara | October 13, 2009 at 10:05 AM
Maybe I am a naughty admin but I enabled root login and augmented the root .profile with the contents of the padmin .profile and my preferred customizations (PS1 and set -o vi). I can now ssh to root run ioscli commands as root and never login as padmin. I hope the VIO Police don't get me.
Posted by: Caleb | October 27, 2009 at 01:29 PM
I also like to add an alias called 'aix' for the lengthy command oem_setup_env - I run the command 'aix' and it's much faster to type.
I add this line to /home/padmin/.profile
alias aix="oem_setup_env"
I suppose you could add it in .kshrc instead.
Posted by: Anthony English | November 03, 2009 at 04:04 AM
If it is just 'set -o vi', then another option is to add EDITOR=vi to /etc/environment.
Posted by: Dave | November 16, 2009 at 02:07 PM
Nice!
I put oem_setup_env in the profile also:
.profile:
export ENV=/home/padmin/.kshrc
oem_setup_env
and in .kshrc:
PS1="VIO3 # "
set -o vi
export PATH=$PATH:/usr/ios/cli
alias psef='ps -ef | grep -i $1'
alias backup="ioscli backup"
alias restore="ioscli restore"
alias chbdsp="ioscli chbdsp"
Now after logging in as padmin, I'm placed into oem_setup_env and can run everything as root.
Posted by: Paul Clifton | December 08, 2009 at 10:53 AM