Skip to content
Advertisement

Processes running from tmux session have different resource limit?

I’m trying to change the stack limit in /etc/security/limits.conf to the following:

<my_user_name> soft stack 102400
<my_user_name> hard stack 204800

This works when I’m running a process directly (will explain what is indirect below) on that host:

cat /proc/13524/limits
Limit                     Soft Limit           Hard Limit           Units
...
Max stack size            209715200            209715200            bytes
...

But when I’m running the same program from within a tmux session (“indirectly”, as opposed to the above), it is different:

cat /proc/2286/limits
Limit                     Soft Limit           Hard Limit           Units
...
Max stack size            10485760             10485760             bytes
...

Does tmux has a different priviledge? The strange thing I noticed that is in the working case, both Soft and Hard limits are equal to the “hard” value I set in limits.conf while in the broken case both equal to the “soft” value.

Any help/reference is appreciated.

Advertisement

Answer

The problem can appear because of long-running tmux server in the background which even survives logout/login for the active session.

Whenever you create new tmux sessions they are created within the existing background server process, thus using old limits.

Try killing all running tmux processes. Also, you may want to read this https://unix.stackexchange.com/questions/108603/do-changes-in-etc-security-limits-conf-require-a-reboot

Advertisement