LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-01-2013, 05:53 PM   #1
kfn
LQ Newbie
 
Registered: Sep 2012
Location: NYC
Distribution: Slackware64-current
Posts: 11

Rep: Reputation: Disabled
'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.

Last edited by kfn; 01-01-2013 at 09:11 PM.
 
Old 01-01-2013, 06:02 PM   #2
beder
Member
 
Registered: Apr 2011
Posts: 82

Rep: Reputation: 28
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
 
Old 01-01-2013, 06:09 PM   #3
kfn
LQ Newbie
 
Registered: Sep 2012
Location: NYC
Distribution: Slackware64-current
Posts: 11

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-01-2013, 07:29 PM   #4
beder
Member
 
Registered: Apr 2011
Posts: 82

Rep: Reputation: 28
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/

Last edited by beder; 01-01-2013 at 07:32 PM.
 
Old 01-01-2013, 09:11 PM   #5
kfn
LQ Newbie
 
Registered: Sep 2012
Location: NYC
Distribution: Slackware64-current
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thumbs up

This did the trick indeed

thanks beder!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ulimit -s 40960 vs ulimit ulimit -s 10240 centguy Linux - Software 2 10-22-2016 11:38 PM
How toChange ulimit -v to unlimited? linuxuser420 Linux - Newbie 1 09-02-2009 05:52 PM
core dump file size exceeds limit with ulimit -f unlimited. initpidzero Linux - Software 0 07-28-2009 02:08 AM
Change ulimit to unlimited for every user in redhat enterprise linux. ahmedsaeedkhan Linux - Newbie 2 02-11-2009 07:52 AM
Ulimit privilege for a user linuxfans Linux - General 3 04-16-2003 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration