Just upgraded to ubunt 18 and now ulimit -n changes hard and soft limits

Bug #1825188 reported by Donald Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
New
Undecided
Unassigned

Bug Description

I recently upgraded from Ubuntu 14 to 18 and now I can't use ulimit -n to increase the allowed number of files open! This is a change from my previous version of Ubuntu.

Lines from /etc/security/limits.conf
jonesdc hard nofile 100000
jonesdc soft nofile 10000

Setting in /etc/sysctl.conf
# Max open files (system limit)
fs.file-max = 100000

When I first open a terminal if I type
$ulimit -n 1000
then
$ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) 10000
pending signals (-i) 30927
max locked memory (kbytes, -l) 16384
max memory size (kbytes, -m) unlimited
open files (-n) 1000
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) 30927
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Now if I type
$ulimit -n 999
and then try again
$ulimit -n 1000
bash: ulimit: open files: cannot modify limit: Operation not permitted

Looking further, it appears that ulimit -n changes both the hard and soft limits
$ulimit -H -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30927
max locked memory (kbytes, -l) 16384
max memory size (kbytes, -m) unlimited
open files (-n) 999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 30927
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.