LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2005, 01:36 PM   #1
rmount
LQ Newbie
 
Registered: Oct 2003
Distribution: CentOS
Posts: 22

Rep: Reputation: 15
ulimit changes and /etc/profile


Hello,

I've got a process that is running out of RAM. I've made a special account for the process so it's not running as root. The process runs perfectly as root (doesn't run out of memory).

So i'm down to making some tweaks to my users ulimit. I think these are done in /etc/profile. I've found the lines, changes them, yet my user is not getting the new settings i've entered.

Firstly, is this the proper way to make changes to ulimit settings?
Secondly, how do i make the changes take effect?

Thanks in advance!
 
Old 11-01-2005, 03:09 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Changes in /etc/profile will only be pulled if the shell
from which you operate is a login-shell.

If it's not you won't get the ulimit values. To find out
what ulimit is (in the environment you're running it, e.g.
from a xterm or a script) do a ulimit -a (or a
ulimit -a > /tmp/ulimits.$$ from a script)



Cheers,
Tink
 
Old 11-02-2005, 07:35 AM   #3
rmount
LQ Newbie
 
Registered: Oct 2003
Distribution: CentOS
Posts: 22

Original Poster
Rep: Reputation: 15
Hi Tink,

Thanks for the reply. I'm trying to bump up non-root user ulimits. I'm running a game server that needs more ram. I use a shell script to start the process, it's using /bin/sh for processing.

ulimit -a when logged in as a non-root user shows:
Code:
core file size        (blocks, -c) 200000
data seg size         (kbytes, -d) 200000
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) 4
max memory size       (kbytes, -m) 200000
open files                    (-n) 100
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 20
virtual memory        (kbytes, -v) 200000
I'd like to double all the numbers. I *thought* that would mean editing the /etc/profile file . There's a ulimit line in there like this:
Code:
ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v 200000 2>/dev/null
That line seems to be the source of the settings, i've changed it to this:
Code:
ulimit -n 200 -u 40 -m 400000 -d 400000 -s 8192 -c 400000 -v 400000 2>/dev/null
And rebooted the server and they aren't taking effect. Can anyone tell me why these aren't taking effect?

This is RHE 3.0, running cPanel

Thanks!
 
Old 11-02-2005, 07:43 AM   #4
rmount
LQ Newbie
 
Registered: Oct 2003
Distribution: CentOS
Posts: 22

Original Poster
Rep: Reputation: 15
I got it working...

I did a grep for "ulimit" and found it in /etc/bashrc

/etc/bashrc has the same lines and those seem to be the ones doing the work. I adjusted those lines and now my ulimit -a as a user reflects the new limits.

Answered my own question
 
  


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 Serena Linux - Software 6 12-18-2014 12:04 AM
ulimit -t juanbobo Linux - Security 3 06-10-2005 10:43 AM
ulimit settings in /etc/profile darn Linux - Newbie 1 02-10-2005 12:11 PM
Ulimit -v Help !!!!!!!!!!!!!!!!!!!!!! raees Linux - Software 1 07-04-2004 11:01 AM
ulimit -n evilrico Linux - Distributions 0 03-14-2003 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:24 PM.

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