Edit: This should still be useful.
Originally posted October 13, 2009 on AIXchange
Recently I worked with a customer who was frustrated with the VIO server. When he logged in as padmin, he was faced with a $ prompt. When he ran oem_setup_env and became root, he had a # prompt. Whenever he switched users, he had to remember to run set –o vi to get access to his command history. He would log into two VIO servers and couldn’t easily keep track of the one he was working in. For all of the other machines in his environment, he had customized his .profile to his liking. He customized his prompt and the name on his title bar, and would automatically run set –o vi, etc. However, those oddball VIO servers weren’t playing nice.
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.