| Summary: | pstree output cannot be redirected to a file | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | Ivan A. Melnikov <iv> |
| Component: | psmisc | Assignee: | Vitaly Chikunov <vt> |
| Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P5 | CC: | ldv, vseleznv, vt |
| Version: | unstable | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| See Also: | https://bugzilla.altlinux.org/show_bug.cgi?id=41600 | ||
psmisc-23.3-alt3 -> sisyphus: Sat Sep 04 2021 Vitaly Chikunov <vt@altlinux> 23.3-alt3 - Fix output redirect (closes: #40857). |
While trying to save `pstree -ap` output to a file and I'm getting a really strange error: $ pstree -ap > pstree.txt File size limit exceeded Of course, I don't have any filesize limit on this system: $ ulimit -f unlimited It turns out that pstree itself sets the filesize limit -- probably in some kind of a sandboxing effort: $ strace -e /limit pstree -ap > /dev/null prlimit64(0, RLIMIT_NPROC, {rlim_cur=0, rlim_max=0}, NULL) = 0 prlimit64(0, RLIMIT_FSIZE, {rlim_cur=0, rlim_max=0}, NULL) = 0 prlimit64(0, RLIMIT_NOFILE, {rlim_cur=0, rlim_max=0}, NULL) = 0 +++ exited with 0 +++ So, obvious workaround like intermediate `cat` works: $ pstree -ap | cat > pstree.txt $ echo $? 0 $ wc pstree.txt 578 2120 22017 pstree.txt But, well, such limitation on where output can go definitely looks like a bug to me.