diff options
author | yar <yar@FreeBSD.org> | 2006-08-18 12:10:18 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-08-18 12:10:18 +0000 |
commit | 904a0ff853dc8ae8c748cc59971376fcbae89f33 (patch) | |
tree | 66d374536347598215aec38d4e22b47589ac298f /etc | |
parent | 575ffc5ca462c4e0093f8e5249685e65fe548bc4 (diff) | |
download | FreeBSD-src-904a0ff853dc8ae8c748cc59971376fcbae89f33.zip FreeBSD-src-904a0ff853dc8ae8c748cc59971376fcbae89f33.tar.gz |
The ps(1) command is unfriendly to scripts by default because
it limits the width of its output to the value of $COLUMNS, or
what TIOCGWINSZ reports, or 79 columns. We should specify -ww
to ps(1) so that it removes the limit and prints lines in full.
Otherwise very long command pathnames could be mishandled, e.g.,
by _find_processes().
MFC after: 1 week
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.subr | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index c20cd43..d2fc642 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -54,8 +54,9 @@ SYSCTL_N="${SYSCTL} -n" CMD_OSTYPE="${SYSCTL_N} kern.ostype" OSTYPE=`${CMD_OSTYPE}` ID="/usr/bin/id" -JID=`ps -p $$ -o jid=` IDCMD="if [ -x $ID ]; then $ID -un; fi" +PS="/bin/ps -ww" +JID=`$PS -p $$ -o jid=` case ${OSTYPE} in FreeBSD) @@ -278,8 +279,8 @@ _find_processes() $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")' fi - _proccheck=' - ps 2>/dev/null -o "pid,jid,command" '"$_psargs"' | + _proccheck="\ + $PS 2>/dev/null -o pid,jid,command $_psargs"' | while read _npid _jid '"$_fp_args"'; do case "$_npid" in PID) |