Existem três arquivos para modificar para que isso funcione:
-
/etc/security/limits.conf
-
/etc/pam.d/common-session
-
/etc/pam.d/common-session-noninteractive
Você já adicionou as linhas necessárias no primeiro arquivo e, nos outros dois arquivos, essa linha é necessária:
session required pam_limits.so
Por favor, note:
The thing that most resources neglect to emphasize, is that your limits can really easily be modified by anything responsible for execution of your processes. If ulimit -n (run as the correct user) is giving you the number you just set, but cat /proc/{process_id}/limits is still printing the low number, you almost certainly have a process manager, an init script, or something similar messing your limits up. You also need to keep in mind that processes inherit the limits of the parent process.
Portanto, se tal processo existir, você terá que modificar o arquivo de configuração para fazê-lo funcionar.
Fonte: link