Full Command Not Shown

General support questions
Krydos
Posts: 5
Joined: 2020/01/20 03:45:03

Full Command Not Shown

Post by Krydos » 2020/01/20 04:02:01

Top and htop and ps and even ls -l /proc/<pid>/exe have always shown the full command on all of my centos7 systems. For instance:

# ps aux|grep -v grep|grep php
serginho 107920 1.3 0.4 470788 33576 ? D 03:56 0:00 /opt/cpanel/ea-php56/root/usr/bin/php-cgi /home/serginho/public_html/index.php

Now on my latest server it shows the php executable, but not the php script that is being executed. Example:

# ps aux|grep -v grep|grep php
canadarm 11967 0.0 0.2 299220 36272 ? R 03:59 0:00 /opt/cpanel/ea php73/root/usr/bin/php-cgi

Can anyone think of a way to make the rest of the command show up?

Krydos
Posts: 5
Joined: 2020/01/20 03:45:03

Re: Full Command Not Shown

Post by Krydos » 2020/02/02 07:29:55

I tried uninstalling the php package and reinstalling it, and that didn't help. Any other ideas?

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: Full Command Not Shown

Post by desertcat » 2020/02/02 16:56:16

Krydos wrote:
2020/01/20 04:02:01
Top and htop and ps and even ls -l /proc/<pid>/exe have always shown the full command on all of my centos7 systems. For instance:

# ps aux|grep -v grep|grep php
serginho 107920 1.3 0.4 470788 33576 ? D 03:56 0:00 /opt/cpanel/ea-php56/root/usr/bin/php-cgi /home/serginho/public_html/index.php

Now on my latest server it shows the php executable, but not the php script that is being executed. Example:

# ps aux|grep -v grep|grep php
canadarm 11967 0.0 0.2 299220 36272 ? R 03:59 0:00 /opt/cpanel/ea php73/root/usr/bin/php-cgi

Can anyone think of a way to make the rest of the command show up?
Hummmmm. There is the possibility that there is a scroll bar on the bottom and the command simply scrolled off the screen. If there is a scroll bar (L->R), then if you scroll R you will see the rest of the command.

Alternately if there is NO scroll bar simply using the the R -> key will show the rest of the command. This happens with Midnight Commander (mc) in edit mode, otherwise in view mode the command simply wraps around. If you press a character key once you reach the end of the line it will go on indefinitely so long as you you hold the key down. What you will see is that the beginning of the command (on the left side of the screen) will have "disappeared". Of course it did not "disappear" it simply ran off the end of the monitor.

You could prove this if you were to start at the beginning of the command and simply highlight the command and dragging -->R.

For FUN (and just because you can) trying making the font smaller. With a smaller font more characters will show up on the screen and may reveal the rest of the command.

Beyond that there maybe some command that sets the maximum number of characters per line before auto-wrap kicks in and wraps the command to the next line. It maybe something as simple as finding something that says auto-wrap On or Off (or 1 or 0) in some config file somewhere.

These are of course all guesses, but they are based on my own experiences of a similar nature. It is time to go hacking but I *suspect* if it is like mc the command simply scrolls off the "page".

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Full Command Not Shown

Post by sml » 2020/02/02 17:48:37

Check your environment, especially such variables as COLUMNS, CMD_ENV, POSIXLY_CORRECT, PS_PERSONALITY, and so on (see the full list of environment variables that may affect the output of ps in its manpage). Also check that you're running /usr/bin/ps and not some redefined shell alias/function named ps.

E.g. on my system COLUMNS=20 ps aux|grep /[p]hp gives me

Code: Select all

root      1501  0.0  0.5 332424 22124 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1503  0.0  0.5 332424 22104 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1505  0.0  0.5 332424 22136 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1507  0.0  0.5 332424 22156 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1509  0.0  0.5 332424 22052 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1511  0.0  0.5 332424 21980 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1513  0.0  0.5 332424 22044 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1525  0.0  0.4 336768 17916 ?        S    Jan30   4:17 /usr/bin/php -q
root      1526  0.0  0.4 336624 16804 ?        S    Jan30   4:14 /usr/bin/php -q
root      1527  0.0  0.4 336624 16824 ?        S    Jan30   4:07 /usr/bin/php -q
root      1528  0.0  0.4 336624 16876 ?        S    Jan30   4:07 /usr/bin/php -q
root      1529  0.3  0.9 369396 38204 ?        S    Jan30  14:41 /usr/bin/php -q
root      1530  0.0  0.4 338676 18720 ?        S    Jan30   4:33 /usr/bin/php -q
root      1531  0.0  0.4 336624 16492 ?        S    Jan30   3:42 /usr/bin/php -q
while ps aux|grep /[p]hp would give

Code: Select all

root      1501  0.0  0.5 332424 22124 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGSnapinHash/FOGSnapinHash &
root      1503  0.0  0.5 332424 22104 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGSnapinReplicator/FOGSnapinReplicator &
root      1505  0.0  0.5 332424 22136 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler &
root      1507  0.0  0.5 332424 22156 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGImageReplicator/FOGImageReplicator &
root      1509  0.0  0.5 332424 22052 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGImageSize/FOGImageSize &
root      1511  0.0  0.5 332424 21980 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGMulticastManager/FOGMulticastManager &
root      1513  0.0  0.5 332424 22044 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGPingHosts/FOGPingHosts &
root      1525  0.0  0.4 336768 17916 ?        S    Jan30   4:17 /usr/bin/php -q /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler &
root      1526  0.0  0.4 336624 16804 ?        S    Jan30   4:14 /usr/bin/php -q /opt/fog/service/FOGSnapinReplicator/FOGSnapinReplicator &
root      1527  0.0  0.4 336624 16824 ?        S    Jan30   4:07 /usr/bin/php -q /opt/fog/service/FOGImageSize/FOGImageSize &
root      1528  0.0  0.4 336624 16876 ?        S    Jan30   4:07 /usr/bin/php -q /opt/fog/service/FOGSnapinHash/FOGSnapinHash &
root      1529  0.3  0.9 369396 38216 ?        S    Jan30  14:42 /usr/bin/php -q /opt/fog/service/FOGMulticastManager/FOGMulticastManager &
root      1530  0.0  0.4 338676 18720 ?        S    Jan30   4:33 /usr/bin/php -q /opt/fog/service/FOGImageReplicator/FOGImageReplicator &
root      1531  0.0  0.4 336624 16492 ?        S    Jan30   3:42 /usr/bin/php -q /opt/fog/service/FOGPingHosts/FOGPingHosts &
root     14505  0.0  0.4 342248 19412 ?        Ss   Feb01   0:12 php-fpm: master process (/etc/php-fpm.conf)
Another thought. Is there a space in the path?
Krydos wrote:
2020/01/20 04:02:01
canadarm 11967 0.0 0.2 299220 36272 ? R 03:59 0:00 /opt/cpanel/eaphp73/root/usr/bin/php-cgi
Do you get this problem only for PHP processes or for any processes with long command lines? If the latter is true then what output do you get for ps auxww? And for ps axwwopid,cmd?

Also, please show the output of

Code: Select all

echo $TERM
echo $COLUMNS
stty -a
Last edited by sml on 2020/02/03 15:40:49, edited 1 time in total.

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: Full Command Not Shown

Post by desertcat » 2020/02/03 02:43:17

sml wrote:
2020/02/02 17:48:37
Check your environment, especially such variables as COLUMNS, CMD_ENV, POSIXLY_CORRECT, PS_PERSONALITY, and so on (see the full list of environment variables that may affect the output of ps in its manpage). Also check that you're running /usr/bin/ps and not some redefined shell alias/function named ps.

E.g. on my system COLUMNS=20 ps aux|grep /[p]hp gives me

Code: Select all

root      1501  0.0  0.5 332424 22124 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1503  0.0  0.5 332424 22104 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1505  0.0  0.5 332424 22136 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1507  0.0  0.5 332424 22156 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1509  0.0  0.5 332424 22052 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1511  0.0  0.5 332424 21980 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1513  0.0  0.5 332424 22044 ?        Ss   Jan30   0:00 /usr/bin/php -q
root      1525  0.0  0.4 336768 17916 ?        S    Jan30   4:17 /usr/bin/php -q
root      1526  0.0  0.4 336624 16804 ?        S    Jan30   4:14 /usr/bin/php -q
root      1527  0.0  0.4 336624 16824 ?        S    Jan30   4:07 /usr/bin/php -q
root      1528  0.0  0.4 336624 16876 ?        S    Jan30   4:07 /usr/bin/php -q
root      1529  0.3  0.9 369396 38204 ?        S    Jan30  14:41 /usr/bin/php -q
root      1530  0.0  0.4 338676 18720 ?        S    Jan30   4:33 /usr/bin/php -q
root      1531  0.0  0.4 336624 16492 ?        S    Jan30   3:42 /usr/bin/php -q
while ps aux|grep /[p]hp would give

Code: Select all

root      1501  0.0  0.5 332424 22124 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGSnapinHash/FOGSnapinHash &
root      1503  0.0  0.5 332424 22104 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGSnapinReplicator/FOGSnapinReplicator &
root      1505  0.0  0.5 332424 22136 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler &
root      1507  0.0  0.5 332424 22156 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGImageReplicator/FOGImageReplicator &
root      1509  0.0  0.5 332424 22052 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGImageSize/FOGImageSize &
root      1511  0.0  0.5 332424 21980 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGMulticastManager/FOGMulticastManager &
root      1513  0.0  0.5 332424 22044 ?        Ss   Jan30   0:00 /usr/bin/php -q /opt/fog/service/FOGPingHosts/FOGPingHosts &
root      1525  0.0  0.4 336768 17916 ?        S    Jan30   4:17 /usr/bin/php -q /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler &
root      1526  0.0  0.4 336624 16804 ?        S    Jan30   4:14 /usr/bin/php -q /opt/fog/service/FOGSnapinReplicator/FOGSnapinReplicator &
root      1527  0.0  0.4 336624 16824 ?        S    Jan30   4:07 /usr/bin/php -q /opt/fog/service/FOGImageSize/FOGImageSize &
root      1528  0.0  0.4 336624 16876 ?        S    Jan30   4:07 /usr/bin/php -q /opt/fog/service/FOGSnapinHash/FOGSnapinHash &
root      1529  0.3  0.9 369396 38216 ?        S    Jan30  14:42 /usr/bin/php -q /opt/fog/service/FOGMulticastManager/FOGMulticastManager &
root      1530  0.0  0.4 338676 18720 ?        S    Jan30   4:33 /usr/bin/php -q /opt/fog/service/FOGImageReplicator/FOGImageReplicator &
root      1531  0.0  0.4 336624 16492 ?        S    Jan30   3:42 /usr/bin/php -q /opt/fog/service/FOGPingHosts/FOGPingHosts &
root     14505  0.0  0.4 342248 19412 ?        Ss   Feb01   0:12 php-fpm: master process (/etc/php-fpm.conf)
Another thought. Is there a space in the path?
Krydos wrote:
2020/01/20 04:02:01
canadarm 11967 0.0 0.2 299220 36272 ? R 03:59 0:00 /opt/cpanel/eaphp73/root/usr/bin/php-cgi
Do you get this problem only for PHP processes or for any processes with long command lines? If the later is true then what output do you get for ps auxww? And for ps axwwopid,cmd?

Also, please show the output of

Code: Select all

echo $TERM
echo $COLUMNS
stty -a
Just for FUN I decided to run your commands here is what I got:


Code: Select all

echo $TERM
echo $COLUMNS
stty -a

root@leopard/home/dcat]/>echo $TERM
xterm-256color

[root@leopard/home/dcat]/>echo $COLUMNS
146

[root@leopard/home/dcat]/>stty -a
speed 38400 baud; rows 36; columns 146; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

Mind you NONE of this makes any sense to me at all, but for those who know what they are looking at this provides another data set, as my system is pure stock ie. I have not tweaked anything other than the prompt which is custom. The other minor (major? ) difference is that I am running zsh, not bash.

The thing that pops out at me is eol (End Of Line ?) = undef (Undefined ?), though I am not quite sure what this eol2 (End Of Line2 ???) = undef (also Undefined ?). That said as I type this when I reach the End of the Line it Auto-wraps to the next line. This suggests to me that the problem may be in some programs the auto-wrap function is turned OFF probably so when editing code you can see if there any space where there should be none, and vice versa; however once you SAVE the file the Auto-wrap function is turned so so everything fits the page. Just a guess.

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Full Command Not Shown

Post by sml » 2020/02/03 10:29:50

desertcat wrote:
2020/02/03 02:43:17
The thing that pops out at me is eol (End Of Line ?) = undef (Undefined ?), though I am not quite sure what this eol2 (End Of Line2 ???) = undef (also Undefined ?).
These are control characters that may be used by terminal driver to mark the end of line in addition to NL.

Krydos
Posts: 5
Joined: 2020/01/20 03:45:03

Re: Full Command Not Shown

Post by Krydos » 2020/02/09 08:08:02

desertcat wrote:
2020/02/02 16:56:16
Hummmmm. There is the possibility that there is a scroll bar on the bottom and the command simply scrolled off the screen. If there is a scroll bar (L->R), then if you scroll R you will see the rest of the command.
I'm using putty to ssh in, and there is no scroll bar.
desertcat wrote:
2020/02/02 16:56:16
Alternately if there is NO scroll bar simply using the the R -> key will show the rest of the command. This happens with Midnight Commander (mc) in edit mode, otherwise in view mode the command simply wraps around. If you press a character key once you reach the end of the line it will go on indefinitely so long as you you hold the key down. What you will see is that the beginning of the command (on the left side of the screen) will have "disappeared". Of course it did not "disappear" it simply ran off the end of the monitor.
Using the arrow keys, left and right, doesn't reveal anything else.
desertcat wrote:
2020/02/02 16:56:16
You could prove this if you were to start at the beginning of the command and simply highlight the command and dragging -->R.
Highlighting and dragging doesn't reveal anything else either.
desertcat wrote:
2020/02/02 16:56:16
For FUN (and just because you can) trying making the font smaller. With a smaller font more characters will show up on the screen and may reveal the rest of the command.
Thanks for the suggestions. This didn't reveal anything else either unforntunately.
desertcat wrote:
2020/02/02 16:56:16
Beyond that there maybe some command that sets the maximum number of characters per line before auto-wrap kicks in and wraps the command to the next line. It maybe something as simple as finding something that says auto-wrap On or Off (or 1 or 0) in some config file somewhere.
Putty seems to send the current width of the window to the server when it is resized.
sml wrote:
2020/02/02 17:48:37
Check your environment, especially such variables as COLUMNS,
By default it's set to 80, but when I resize the putty window it changes to whatever width I drag it to.
sml wrote:
2020/02/02 17:48:37
CMD_ENV, POSIXLY_CORRECT, PS_PERSONALITY, and so on (see the full list of environment variables that may affect the output of ps in its manpage).
These are all null.
sml wrote:
2020/02/02 17:48:37
Also check that you're running /usr/bin/ps and not some redefined shell alias/function named ps.
Same output whether I run ps or /usr/bin/ps.
sml wrote:
2020/02/02 17:48:37
Another thought. Is there a space in the path?
No, it's a dash between ea and php. Re-reading my top post, I'm not sure why it copy-pasted as a space there, but I have confirmed that the dash exists on both the server that works and the server that doesn't.
sml wrote:
2020/02/02 17:48:37
Do you get this problem only for PHP processes or for any processes with long command lines? If the latter is true then what output do you get for ps auxww? And for ps axwwopid,cmd?
It's only the php processes. For instance, ps auxww results in
nobody 24453 3.2 4.1 6838412 679112 ? Sl 07:27 1:07 /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/live/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -server -Xms48m -Xmx1024M -XX:MaxPermSize=512m -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dignore.endorsed.dirs= -classpath /opt/tomcat/live/bin/bootstrap.jar:/opt/tomcat/live/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat/live -Dcatalina.home=/opt/tomcat/live -Djava.io.tmpdir=/opt/tomcat/live/temp org.apache.catalina.startup.Bootstrap start
which is ridiculously long, and contains many spaces and dashes and all sorts of stuff.
sml wrote:
2020/02/02 17:48:37
Also, please show the output of

Code: Select all

echo $TERM
echo $COLUMNS
stty -a

Code: Select all

# echo $TERM
xterm
# echo $COLUMNS
207
# stty -a
speed 38400 baud; rows 61; columns 207; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
Anything look wrong? Thanks for the help with this. I really appreciate it!

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Full Command Not Shown

Post by sml » 2020/02/10 08:47:11

Your terminal settings look OK. I'd say it's probably the PHP script itself that tampers with the process title somewhere. Look for cli_set_process_title and/or setproctitle in the PHP code.

Krydos
Posts: 5
Joined: 2020/01/20 03:45:03

Re: Full Command Not Shown

Post by Krydos » 2020/02/11 02:28:50

I don't see either of those php functions in any of the php scripts. All of the php scripts do this, even something as simple as

Code: Select all

<?php
phpinfo();

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Full Command Not Shown

Post by sml » 2020/02/11 12:27:22

Just a wild guess. What's the value of cgi.fix_pathinfo in your php.ini?

Post Reply