Issue
Tried this on MIPS platform:
> uname -a
Linux (none) 2.6.29 #2 Mon Jan 14 13:26:04 PST 2013 mips GNU/Linux
> ulimit -c unlimited
> which gzip
/bin/gzip
> echo "|/bin/gzip - > /home/core-%t-%s-%e.gz" > /proc/sys/kernel/core_pattern
> ./fault
hello there
Segmentation fault (core dumped)
> ls /home/core*.gz
ls: /home/core*: No such file or directory
i.e. piping to a program doesn’t work. if I specify a file:
> echo "/home/core-%t-%s-%e" > /proc/sys/kernel/core_pattern
then it works. What did I miss?
Solution
Perhaps it fail because the kernel doesn’t run any shell, but try to execute a program.
Try to wrap the gzip invocation with the redirection in a script and use that script.
Answered By – Yann Droneaud
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0