- To a process, an open file is a descriptor; beyond the soft limit the kernel opens nothing, and the program writes Too many open files.
- A process gets its limits from its parent and sees them in
/proc/<PID>/limits: it raises the soft one by itself up to the hard one; root raises the hard one. - systemd sets a service's limits:
LimitNOFILEin a drop-in in/etc/systemd/system/<unit>.d/, thendaemon-reloadand a restart. sysctl -wchanges a kernel parameter until a reboot, a file in/etc/sysctl.dchanges it at every boot, andsysctl --systemapplies the files right away.- The shipper at the start of the lesson lost logs because systemd ran it with
LimitNOFILE=64: your 1024 had nothing to do with it.
Step 10 of 10 · summary · 2 min
Summary
Found an inaccuracy? Report an error in the lesson