Problems setting ulimit fize size for user. File size exceeded
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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
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?
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.
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.
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.
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.
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"
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.