How to setup environment variables per user in /etc/auto.profile?

Document ID : KB000052576
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

We have jobs which run under different user accounts. When setting ulimits in /etc/auto.profile it will be in effect for all the jobs running via AUTOSYS regardless of the user account. We would like to run these jobs with the user's specified ulimit rather than a single ulimit entry defined in the /etc/auto.profile for all users and jobs.

Solution:

You may add the following lines in /etc/auto.profile:

ID='whoami'
export ID
 
case $ID in
user1)
ulimit -n 2000
;;
user2)
ulimit -n 4000
;;
esac