Die Einstellung des offenen Dateideskriptors limits.conf wird von ulimit nicht gelesen, auch wenn pam_limits.so erforderlich ist


16

Ich versuche, die maximale Anzahl offener Dateideskriptoren für alle Benutzer eines Ubuntu-Computers zu erhöhen.

Ich habe die folgenden Zeilen hinzugefügt /etc/security/limits.conf:

*               soft    nofile           100000
*               hard    nofile           100000

Und basierend auf dieser Frage habe ich die /etc/pam.confEinstellungen überprüft für pam_limits:

$ grep "pam_limits" /etc/pam.d/*
/etc/pam.d/atd:session    required   pam_limits.so
/etc/pam.d/common-session:session required pam_limits.so
/etc/pam.d/cron:session    required   pam_limits.so
/etc/pam.d/login:session    required   pam_limits.so
/etc/pam.d/sshd:session    required     pam_limits.so
/etc/pam.d/su:session    required   pam_limits.so
/etc/pam.d/sudo:session required pam_limits.so

Und mein file-max scheint in Ordnung zu sein:

$ cat /proc/sys/fs/file-max 
762659

Trotzdem habe ich immer noch die Standardeinstellung 1024, wenn ich prüfe ulimit -a:

$ ulimit -a | grep files
open files                      (-n) 1024

Was kann ich sonst noch überprüfen?


Ebenfalls nur als zusätzliche Klarstellung: A ulimit -n 100000funktioniert wie erwartet (obwohl es mir nicht hilft, da es nur in der aktuellen Anmeldesitzung verbleibt).
— Bantic

Antworten:


12

Ich habe herausgefunden, dass das System den Platzhalter für den Benutzer in nicht zu mögen scheint limits.conf. Das zu ändern: root soft nofile 100000und hat gut root hard nofile 100000funktioniert.


Muss ein Fehler in Ubuntu sein. Ich habe überprüft, ob Platzhalter in Fedora 14 funktionieren.
— Mark Wagner

13
Platzhalter funktionieren, wirken sich jedoch nicht auf das Root-Konto aus. manpages.ubuntu.com/manpages/natty/en/man5/limits.conf.5.html sagtNOTE: group and wildcard limits are not applied to the root user. To set a limit for the root user, this field must contain the literal username root.
— Stobor
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.