<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br></div><div><br></div><div>Two questions.</div><div><br></div>I want to raise the "number of files" limits for the user instance.<br><br></div>First, I set DefaultLimitNOFILE to something higher than the global system default in /etc/systemd/user.conf and I rebooted.<br><br></div>Then I confirmed that the setting has taken effect:</div><div><br></div><div>"systemctl --user show" showed the new DefaultLimitNOFILE and the unit itself showed the higher setting of LimitNOFILE when I ran "systemctl --user show foo".<br><br></div>So far everything worked as expected.<br><br></div>However, when I checked "cat /proc/<pid>/limits" on the ExecStart process of foo.service, I don't see the "number of files" limit has changed.<br><br></div>What did I do wrong?<br><br></div>Second question: if I want to raise the limit just for a single user, how would I go about it?<br><br>Making a change in user.conf would make it apply in all user instances (assuming I could get it to work).<br><br></div>I have found that if I create /etc/systemd/system/user@<uid>.service and add LimitNOFILE to the [Service] section of that file, then it will do two things. First, it actually works whereas editing user.conf did not. Second, the change only applies to user <uid> and not all users.<br><br></div>I assume I'm not getting how systemd is supposed to work. So please enlighten me.<br><br></div>Thanks,<br><br></div>Jeff<br><br></div>Machine stats (although I see the same behavior on Ubuntu and on Centos7.3):<br><br>$ systemctl --version<br>systemd 229<br>+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN<br><br>$ uname -a<br>Linux foo-ubuntu-vm1 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux<br><br>$ lsb_release -a<br>LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch<br>Distributor ID: Ubuntu<br>Description:    Ubuntu 16.04.3 LTS<br>Release:        16.04<br>Codename:       xenial<br><br><br></div>