LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-10-2019, 06:21 PM   #1
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Rep: Reputation: Disabled
Problems setting ulimit fize size for user. File size exceeded


Hi all,

New Slacker in town! I apologize in advance for any mistakes/easy solutions that I somehow forgot. Slackware has been a journey, but I'm loving it.


I've search Google and forums for a few days now, but I'm having a really hard time figuring out how to set the ulimit for file size for a user. Currently, I cannot download a file that's more than 252MB (due to ulimit -f being set to 262144?) while I'm logged into my user. The error "File size limit exceeded" outputs after 252MB. As root, if I run
Code:
ulimit -f unlimited
I am able to download everything just fine. I can't figure out how to make it set to unlimited as a non-root user. I've tried setting ulimit -f unlimited in /etc/initscript as well as /etc/profile.d/limits.conf but this fails due to the user not being root (to set the limit).

Code:
ulimit -a

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) 262144
pending signals                 (-i) 62927
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 524288
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 62927
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Thank you so much.
 
Old 09-11-2019, 12:18 AM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Which version of Slackware are you using?
 
Old 09-11-2019, 02:20 AM   #3
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
-Current
 
Old 09-11-2019, 02:35 AM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I'm not running -current anywhere at the moment; I will say that Slackware64 14.2 defaults to...
Code:
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127575
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 127575
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
...for non-root users.
 
Old 09-11-2019, 02:39 AM   #5
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
That's odd. I did change ulimit -Hn to 524288 for Esync purposes but that was the only value I changed. I tried resetting it and I didn't see a change. Maybe I should just reinstall and stick with 14.2 for now until I know a little more.
 
Old 09-11-2019, 03:47 AM   #6
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
man initscript

I have an initscript to increase the amount of locked memory available - it contains the line 'ulimit -l unlimited'. My guess is that you could do the same with file size - include a line like 'ulimit -f XXXX' (then login again).

chris

Last edited by chris.willing; 09-11-2019 at 03:55 AM.
 
1 members found this post helpful.
Old 09-11-2019, 04:59 AM   #7
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chris.willing View Post
man initscript

I have an initscript to increase the amount of locked memory available - it contains the line 'ulimit -l unlimited'. My guess is that you could do the same with file size - include a line like 'ulimit -f XXXX' (then login again).

chris
I added a line 'ulimit -f unlimited' and rebooted but that did not resolve the issue. I also tried to add this line to /etc/profile and .bashrc to no avail
 
Old 09-11-2019, 05:05 AM   #8
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
You can try to track down first process with this limit by analyzing "/proc/PID/limits" files.
 
1 members found this post helpful.
Old 09-11-2019, 06:38 AM   #9
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by LD-50 View Post
I added a line 'ulimit -f unlimited' and rebooted but that did not resolve the issue.
Has it changed the result of running 'ulimit -f' (or 'ulimit -a')? i.e. has it changed from your previous file size limit of 262144 to unlimited? If so, it looks like your actual problem of downloading a large file is not due to the ulimit setting.

BTW have you tried downloading the file as root - just to check it isn't some user setting that is to blame?

chris
 
Old 09-11-2019, 06:55 AM   #10
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chris.willing View Post
Has it changed the result of running 'ulimit -f' (or 'ulimit -a')? i.e. has it changed from your previous file size limit of 262144 to unlimited? If so, it looks like your actual problem of downloading a large file is not due to the ulimit setting.

BTW have you tried downloading the file as root - just to check it isn't some user setting that is to blame?

chris
This did not change the result of running ulimit -f or ulimit -a.

As root, you cannot download/transfer files over 252MB UNTIL you run 'ulimit -f unlimited'. Once you set this, everything runs as normal. However, once you log out, you lose that settings and it has to be re-run next root log-in.
 
Old 09-11-2019, 07:08 AM   #11
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by LD-50 View Post
This did not change the result of running ulimit -f or ulimit -a.
In that case, something is wrong with your initscript. Did you use the provided sample as a basis? On -current, the sample is at /usr/doc/sysvinit-2.95/initscript.sample. You should make a copy of it as '/etc/initscript' and modify it to do what you want (ulimit -f unlimited); then restart the system.

chris
 
Old 09-11-2019, 07:22 AM   #12
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
I did use that as the basis (I used it from the a ulimit man page) and it made no difference. I deleted the initscript earlier to see if that would be the reason but nothing has changed. The only values I had set in the initscript were 'ulimit -Hn XXXX' and 'ulimit -c XXXX'. I have confirmed the initscript is removed and there are not lagging limit files.
 
Old 09-11-2019, 07:35 AM   #13
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by LD-50 View Post
I did use that as the basis (I used it from the a ulimit man page) and it made no difference. I deleted the initscript earlier to see if that would be the reason but nothing has changed. The only values I had set in the initscript were 'ulimit -Hn XXXX' and 'ulimit -c XXXX'. I have confirmed the initscript is removed and there are not lagging limit files.
Those particular ulimit commands don't have anything to do with file size limits so you wouldn't see any difference. They are just examples so you could just as well comment them out. However you do need to add the line 'ulimit -f unlimited' to that file to see any difference in your case.

chris
 
Old 09-11-2019, 08:06 AM   #14
LD-50
LQ Newbie
 
Registered: Sep 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
I did try with 'ulimit -f unlimited' is what I meant, but I did it again with output of initscript and ulimit -a

Code:
 ulimit -a
core file size          (blocks, -c) 1048575
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) 262144
pending signals                 (-i) 62927
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 62927
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Code:
cat /etc/initscript
#
# initscript    If this script is intalled as /etc/initscript,
#               it is executed by init(8) for every program it
#               wants to spawn like this:
#
#               /bin/sh /etc/initscript <id> <level> <action> <process>
#
#               It can be used to set the default umask and ulimit
#               of all processes. By default this script is installed
#               as /etc/initscript.sample, so to enable it you must
#               rename this script first to /etc/initscript.
#
# Version:      @(#)initscript 1.10 10-Dec-1995 MvS.
#
# Author:       Miquel van Smoorenburg, <miquels@cistron.nl>
#

  # Set umask to safe level, and enable core dumps.
  umask 022
  ulimit -c 2097151
  ulimit -f unlimited

  PATH=/bin:/sbin:/usr/bin:/usr/sbin
  export PATH

  # Execute the program.
  eval exec "$4"
 
Old 09-11-2019, 04:46 PM   #15
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
What would have been setting -f 262144 in the first place? In Slackware-current that parameter is unlimited by default.

Since it's happening for root (all users), it won't be in your user shell configuration files, so check /etc/profile, and all the files in /etc/profile.d. Maybe something you installed dropped a .sh file in there or something.

(you mentioned /etc/profile.d/limits.conf... that's hardly an appropriate place for a .conf file, it's for shell scripts and /etc/security/limits.conf is only for PAM distros. There's no limits.sh in there by default)
 
  


Reply



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
[SOLVED] Cannot set ulimit -l, says ulimit: max locked memory: cannot modify limit Xiano Slackware 1 07-24-2014 02:58 AM
File size limit exceeded... Faeroon Linux - General 20 01-02-2003 06:57 PM
child pid xxxxx exit signal File size limit exceeded (25)" problem. bisbane Linux - General 1 10-31-2002 04:35 AM
unzipping: file size limit exceeded peeples Linux From Scratch 9 10-15-2002 07:17 AM

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

All times are GMT -5. The time now is 09:51 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