In my /etc/profile I already have an if block for root that looks like:
Code:
if [ `/usr/bin/whoami` = 'root' ]
then
#do stuff special for root
else
#do stuff only for !root
fi
You should just be able to add "ulimit -v 5000" to the else section of the if block. A quick check of this works on my local workstation, I see no reason why it would fail for a linode. However, when setting ulimit in /etc/profile I believe the limit is per process not per user.
If it seems to be failing, try bumping up the value as a test, when I was playing locally a setting of 2000 would not even let me spawn a shell.