LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   'ulimit -l unlimited' for user (http://www.linuxquestions.org/questions/slackware-14/ulimit-l-unlimited-for-user-4175443725/)

kfn 01-01-2013 05:53 PM

'ulimit -l unlimited' for user
 
Hello,

I'm trying to set unlimited memory lock for a regular user. (slackware64 14)

I already added
Code:

ulimit -Hl unlimited
in /sbin/initscript
and
Code:

ulimit -l unlimited
in /etc/profile

At this point, when logged in as root, 'ulimit -l' returns unlimited.

When logged in as user however, it returns again 64...

Any suggestions?

Also, if i use set_rlimits.conf, is it possible to somehow set 'memlock=unlimited' in the file?
set_rlimits gives me a 'corruct file' error if i just replace the Kb number with unlimited.

beder 01-01-2013 06:02 PM

Not sure if it's related to your problem, but /etc/profile is only executed on login shells. You should add a call to it on ~/.bashrc for non-login shells

kfn 01-01-2013 06:09 PM

Actually gives me 64 in both runlevels 3 and 4.

Also adding it to .bashrc, got me in the same place.

The thing is that
Code:

ulimit -Hl
also returns 64 as regular user, while unlimited as root.
Shouldn't the hard limit be the same in both cases?

beder 01-01-2013 07:29 PM

I just created an /etc/initscript file with the following, no profile or bashrc involved
Code:

  ulimit -l unlimited
  PATH=/bin:/sbin:/usr/bin:/usr/sbin
  export PATH

  # Execute the program.
  eval exec "$4"

And rebooted, and running ulimit -l as user returns "unlimited"
So instead of creating /sbin/initscript, create /etc/initscript and things should work

DO NOT FORGET TO INCLUDE THE LAST LINE FOR "EXECUTE THE PROGRAM" OR YOU'LL MESS UP OUR SYSTEM AND WILL HAVE TO MANUALLY DELETE /ETC/INITSCRIPT THROUGH A LIVE CD OR SOMETHING

Edit: initscript was moved from sbin to etc but Slackware have not reflected the change yet http://www.linuxquestions.org/questi...pt-4175434367/

kfn 01-01-2013 09:11 PM

This did the trick indeed

thanks beder!


All times are GMT -5. The time now is 11:18 PM.