LinuxQuestions.org
Help answer threads with 0 replies.
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 07-20-2011, 03:11 AM   #1
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 293

Rep: Reputation: 31
Setting nofile kernel parameter using initscript


Dear all,
I'm trying to increase hard and soft limit of nofile kernel parameter by putting the following initscript into /sbin
Code:
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Increase the hardlimit for open files
ulimit -Hn 4096
ulimit -n 2048

# Execute the program.
eval exec "$4"
But the limits still don't change as if the script is not run during startup. Any idea where I might miss?

best regards,
ethereal1m

Last edited by ethereal1m; 07-20-2011 at 03:16 AM.
 
Old 07-20-2011, 03:31 AM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 228Reputation: 228Reputation: 228
Init scripts go into /etc/rc.d. By the looks of your script, it would be better if you do that in /etc/rc.d/rc.local.

Last edited by Diantre; 07-20-2011 at 03:33 AM. Reason: typo!
 
Old 07-20-2011, 05:11 AM   #3
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 293

Original Poster
Rep: Reputation: 31
could you tell me why the script is more suitable in rc.d not in initscript? Why it didn't work in initscript?
 
Old 07-20-2011, 11:11 AM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
http://slackwiki.org/Resource_Limits

According to that wiki topic, only the hard limit can be set within /sbin/initscript. The soft limit must be set from within the startup scripts.

I successfully tested setting the hard limit in /sbin/initscript. I tested the script with chmod -x, which had no effect --- the hard limit was still reset regardless of the executable bit.

Deleting the script and rebooting restored the default hard limit.

Probably all you need do is move the 'ulimit -n 2048' line to /etc/profile.d/ulimit.sh and set that script as executable.

Last edited by Woodsman; 07-20-2011 at 11:26 AM.
 
1 members found this post helpful.
Old 07-20-2011, 08:56 PM   #5
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 228Reputation: 228Reputation: 228
Quote:
Originally Posted by Woodsman View Post
[url]According to that wiki topic, only the hard limit can be set within /sbin/initscript. The soft limit must be set from within the startup scripts.
I stand corrected.
 
Old 07-22-2011, 02:53 AM   #6
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 293

Original Poster
Rep: Reputation: 31
Thumbs up

thanks you guys....
 
  


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
What is the difference btw. "soft nofile" and "hard nofile" by configuring open file? thomas2004ch Linux - Newbie 1 11-17-2009 05:33 AM
How to set nofile (open files) for a normal user robertjinx Linux - Server 0 11-18-2008 03:28 AM
setting XML attribute using parameter in XSLT mohtasham1983 Programming 2 01-03-2008 04:03 PM
setting up scp alias under bash - parameter passing problem gjr Linux - Newbie 4 06-08-2005 06:38 AM
Install Oracle 9i on slack 10: setting the max shared memory parameter permanently rsumbeling Linux - General 0 12-10-2004 11:21 AM

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

All times are GMT -5. The time now is 01:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration