Wednesday, 15 August 2012

Is it possible to limit the pid of child processes in Linux bash? -



Is it possible to limit the pid of child processes in Linux bash? -

for illustration bash pid 3000, , want limit kid pid in range [3001,3010].

i want because writing infinite while loop in bash, , pid explode.

while true;do something; sleep 5; done;

every loop spawned @ to the lowest degree 3 kid processes(true, something, sleep). pid whill grow @ speed of @ to the lowest degree 3 per sec. after time, ps aux show awkwardly big pid, think not thing.

the pids don't "explode". recycled kernel. can see maximum pid number in /proc/sys/kernel/pid_max. of course, can modify value, if wish.

linux bash pid

No comments:

Post a Comment