LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-26-2007, 09:11 AM   #1
223
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Rep: Reputation: 0
interpretate limits.conf in crontab


Hi there,

i like to raise my open files limit. this can be done in /etc/security/limits.conf.

when i start my script from the command line, (my script reads the ulimit -n from the system), then, it reads the new open files limit from limits.conf correct.

but when i run the same script in the crontab, it reads the default value of "max. open files" => 1024

i know, that crontabs don't load system config files. normally i use the command "source" to load a specific config file, but that doesn't work for the file limits.conf. the error i get is this one:


# source /etc/security/limits.conf
-bash: root: command not found
-bash: root: command not found
-bash: myuser: command not found
-bash: myuser: command not found


does somebody know how crontab can interpretate limits.conf correct?

thanks for helping.

greetings 223
 
Old 09-26-2007, 03:28 PM   #2
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
The easiest way to set file limit in your shell configuration file. Add line in .bashrc
ulimit -S -c 0

which means unlimited, and no core file.
 
Old 10-01-2007, 02:55 AM   #3
223
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rsashok View Post
The easiest way to set file limit in your shell configuration file. Add line in .bashrc
ulimit -S -c 0

which means unlimited, and no core file.

ulimit -S -c 0 ..this doesn't work. there is even the default value 1024. (i rebooted the system after adding the line in .bashrc)


greetings 223
 
Old 10-01-2007, 10:32 AM   #4
223
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
i wonder that there is no solution for that..
 
Old 10-01-2007, 11:45 AM   #5
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
I don't know then: when I type "ulimit" at the command prompt, it gives me "unlimited", and as far as I could see it is set in .bashrc as I mentioned above.
 
Old 10-01-2007, 11:49 AM   #6
223
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rsashok View Post
I don't know then: when I type "ulimit" at the command prompt, it gives me "unlimited", and as far as I could see it is set in .bashrc as I mentioned above.
i don't know what kind of settings are read by typing "ulimit" at the command prompt. to read the "file max open limit", you have to type "ulimit -n" ;-)


cheers
 
Old 10-05-2007, 02:27 AM   #7
223
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
i got the soluteion!

the problem was, that the system config of a "normal" user can't be read by a "normal" users crontab.
Now, i ran the crontab as user root, and added an "su [user] -c" in the front of each command, which means that the command will be executed as [user].
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 11:14 AM
meaning of /etc/security/limits.conf commands marceluda Linux - Security 1 05-11-2006 12:01 PM
fedora core 2 /etc/secutiry/limits.conf dsharples Linux - Security 1 08-31-2004 08:44 PM
/etc/security/limits.conf documentation? crazyeddie740 Linux - Security 1 06-19-2004 04:02 AM
Wierd PAM limits.conf behavior Kostko Linux - Software 0 08-26-2003 06:55 AM


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