Solaris ps output truncated at 80 columns

10 Jun 2010

When running the ps command on Solaris, the output is truncated at 80 columns – really annoying when the command line to start up a process (typically a daemon) is really long.

This has been annoying me for ages, and I finally found a (sort of) solution – use a different ps, and run as root:

# uname -a
SunOS fubar 5.9 Generic_118558-24 sun4u sparc SUNW,UltraAX-i2

# which ps

# /usr/ucb/ps auxwww 2> /dev/null | grep 22480
root     22480  0.0  0.1 1896 1232 ?        S 10:22:11  0:00 ptymonitor --oob-fd 49 --stderr-mode MUX
--pty --term screen --rows 47 --cols 177
--termios 38400:38400:3.1C.7F.15.4.FF.FF.11.13.1A.
--ttlg --gid 0 --uid 0 --wait-time 60 bash --rcfile /home/fubar/deployment/bin/

This can also be made to work for non-root users by granting the account the proc_owner privilege. For example, for the user fred:

Process Query:::Query Processes as Root:

Process Query:suser:cmd:::/usr/ucb/ps:privs=proc_owner;uid=0;euid=0;gid=0;egid=0

fred::::type=normal;profiles=Process Query

passwd -e fred

cd ~fred
echo "export PS1='% '" >> .profile
comments powered by Disqus

  « Previous: Next: »