The symptom is very simple. For instance:
ls | grep a | grep b | grep c | grep d
throws
-bash: child setpgid (8948 to 8943): Operation not permitted
-bash: child setpgid (8950 to 8943): Operation not permitted
-bash: child setpgid (8952 to 8943): Operation not permitted
-bash: child setpgid (8953 to 8943): Operation not permitted
-bash: child setpgid (8954 to 8943): Operation not permitted
-bash: child setpgid (8955 to 8943): Operation not permitted
-bash: child setpgid (8962 to 8957): Operation not permitted
-bash: child setpgid (8964 to 8957): Operation not permitted
-bash: child setpgid (8966 to 8957): Operation not permitted
-bash: child setpgid (8967 to 8957): Operation not permitted
-bash: child setpgid (8968 to 8957): Operation not permitted
-bash: child setpgid (8969 to 8957): Operation not permitted
-bash: child setpgid (8976 to 8971): Operation not permitted
-bash: child setpgid (8978 to 8971): Operation not permitted
-bash: child setpgid (8980 to 8971): Operation not permitted
-bash: child setpgid (8981 to 8971): Operation not permitted
-bash: child setpgid (8982 to 8971): Operation not permitted
-bash: child setpgid (8983 to 8971): Operation not permitted
-bash: child setpgid (8990 to 8985): Operation not permitted
-bash: child setpgid (8992 to 8985): Operation not permitted
-bash: child setpgid (8994 to 8985): Operation not permitted
-bash: child setpgid (8995 to 8985): Operation not permitted
-bash: child setpgid (8996 to 8985): Operation not permitted
-bash: child setpgid (8997 to 8985): Operation not permitted
The number of greps and pipes used doesn't matter. Sometimes ls | grep a also throws the error.
AFAIK, ls anad grep does not require root privilege. Thus, I am wondering how to solve this problem.
The current machine is Cent OS 5 (kernel 2.6.18). If you need more detailed information, please let me know it.
Added: trace of ls and grep
type ls
ls is aliased to `ls -hF --color=auto'
which ls
/bin/ls
type grep
grep is /bin/grep
which grep
/bin/grep
Added 2
At this moment, I found that this is not limited to ls and grep. It seems that it applies to all commands using pipes. e.g., echo 'Hello' | tee outfile throws the same error.
Added 3: in response to @Argonauts'
Since logs are too long, please refer https://gist.github.com/anonymous/5459fa0322d178f85b0cd2d5ee2add53.
In short,
ulimit -a- pipe size (512 bytes, -p) 8
- max user processes (-u) 129094
type logsays-bash: type: log: not found: OKtrap -p:trap -- 'history_to_syslog' DEBUG. Would it cause problem?- Trial with cleared environment: sometimes no error, but sometimes error.
- Need to be investigated
- Bash debug output
- Strace