MSYS2: ulimit: max user processes: cannot modify limit: Invalid 
arguments

Being a victim of a fork bomb of my own construction, I want to 
reduce the maximum number of user processes in my MSYS2 (MinGW32) 
system from 256 down to 50.

I have these commands at the top of my .bashrc:

ulimit -S -c 0      # Don't want coredumps.
ulimit -S -u 50     # limit 50 processes
export FUNCNEST=44  # limit function recursion

and I get this terminal output:

++ ulimit -S -c 0
++ ulimit -S -u 50
bash: ulimit: max user processes: cannot modify limit: Invalid 
argument
++ export FUNCNEST=44
++ FUNCNEST=44

Note the first ulimit command (for core dump size) works; the 
second for max user processes fails.

I am a member of the administrators group. I hope that's 
sufficient authority, as my system does not have SU or SUDO 
commands, nor do I know how to logon on as (or switch to) root. 
There is no /etc/security/ directory for system wide limits. MSYS2 
in installed on Windows XP SP3, 32-bit.

+ id User
uid=197614(User) gid=197121(None) groups=11(Authenticated 
Users),197121(None),197616(HelpLibraryUpdaters),544(Administrators),545(Users)

Can you please explain what I am doing wrong, or how to limit the 
number of shells being spun off?

Here is what ulimit -a displays:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 8
stack size              (kbytes, -s) 2040
cpu time               (seconds, -t) unlimited
max user processes              (-u) 256
virtual memory          (kbytes, -v) unlimited

Here is what ulimit -Ha displays:

+ ulimit -Ha
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 3200
pipe size            (512 bytes, -p) 8
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 256
virtual memory          (kbytes, -v) unlimited

Here is what ulimit -Sa displays:

+ ulimit -Sa
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 8
stack size              (kbytes, -s) 2040
cpu time               (seconds, -t) unlimited
max user processes              (-u) 256
virtual memory          (kbytes, -v) unlimited

PS:  Posted to 
https://unix.stackexchange.com/questions/320494/msys2-ulimit-max-user-processes-cannot-modify-limit-invalid-arguments
 
and I have yet to receive any reply.


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Msys2-users mailing list
Msys2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to