用 python subprocess 捕获命令行输出结果失去响应,怀疑是 pipe size 太小,尝试修改。
但报错:
# ulimit -p 16
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
默认值:
引用
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14848
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 14848
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14848
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 14848
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
修改:
# ulimit -p 16
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
排查了一下,发现网上的资料都是错的,一堆的都是 ksh 的修改。实际上,bash 中这个值是不能改的。
见:
bash: ulimit: pipe size: cannot modify limit: Invalid argument
引用
Getting this error because this is not an adjustable parameter.
Refer the manual page for ulimit:
-p The pipe size in 512-byte blocks (this may not be set)
This value can not set. You would probably need to recompile the kernel after changing a header file to alter this value, which is not feasible.
Refer the manual page for ulimit:
-p The pipe size in 512-byte blocks (this may not be set)
This value can not set. You would probably need to recompile the kernel after changing a header file to alter this value, which is not feasible.
[转]BASH for 循环小结
[转]Dash与Bash的语法区别
Bash 快捷方式 CheatSheet
[转]Bash获得子进程返回值的方法
[转]Dash与Bash的语法区别
Bash 快捷方式 CheatSheet
[转]Bash获得子进程返回值的方法
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/98242.html