remote shell differs from local output of same command

I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)

In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it should
be no surprise that it doesn’t appear in the process list for the QNX box.

What did you expect?

Rob Rutherford


“J. Scott Franko” <jsfranko@switch.com> wrote in message
news:39999CFF.AF12BA16@switch.com

I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)
\

Sorry, I think I misunderstood your question. You were probably asking about
the two different ways in which pid 8633 were reported.

In general this is related to whether the process has the same user id as
the process running the ps command. In other words, if you have ‘permission’
to view the arguments of the process then they are shown to you, otherwise
you are just shown the process name. This is just like ‘sin args’.

Try ‘rsh id’ to see the user id with which your rsh command is getting
executed.

Rob Rutherford

“Robert Rutherford” <ruzz@ruzz.com> wrote in message
news:8ncke1$ka0$1@inn.qnx.com

In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it
should
be no surprise that it doesn’t appear in the process list for the QNX box.

What did you expect?

Rob Rutherford


“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)


\

Robert Rutherford wrote:

In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it should
be no surprise that it doesn’t appear in the process list for the QNX box.

Huh?? I thought rsh would cause the ps and grep to be run on the QNX box. Are
you saying that the ps is running on QNX but the grep is running on the Sun?

What did you expect?

I guess I expected the same output.

Rob Rutherford

“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)
\

Robert Rutherford wrote:

Sorry, I think I misunderstood your question. You were probably asking about
the two different ways in which pid 8633 were reported.

Ah, now were thinking on the same level.

In general this is related to whether the process has the same user id as
the process running the ps command. In other words, if you have ‘permission’
to view the arguments of the process then they are shown to you, otherwise
you are just shown the process name. This is just like ‘sin args’.

Try ‘rsh id’ to see the user id with which your rsh command is getting
executed.

Thanks! I’ll give that a try.

Rob Rutherford

“Robert Rutherford” <> ruzz@ruzz.com> > wrote in message
news:8ncke1$ka0$> 1@inn.qnx.com> …
In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it
should
be no surprise that it doesn’t appear in the process list for the QNX box.

What did you expect?

Rob Rutherford


“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)


\

“J. Scott Franko” wrote:

Robert Rutherford wrote:

Sorry, I think I misunderstood your question. You were probably asking about
the two different ways in which pid 8633 were reported.

Ah, now were thinking on the same level.



In general this is related to whether the process has the same user id as
the process running the ps command. In other words, if you have ‘permission’
to view the arguments of the process then they are shown to you, otherwise
you are just shown the process name. This is just like ‘sin args’.

Try ‘rsh id’ to see the user id with which your rsh command is getting
executed.

Thanks! I’ll give that a try.

Ah, now I see. I started the sleep as one user different from the user I was
logged in as on the sun box. The rsh id command showed me that. So I added -l
user to the rsh command, so I would remote shell as the same user id that I ran
the command as, and now I get the same output from ps both local and remote.
Funny thing is, though, that .rhosts doesn’t seem to work on qnx. I could only
rsh -l user from the sun to the qnx box once I added the user to the
/etc/hosts.equiv file on the qnx box. I thought both files would work the same.
I added the sun hostname and the user doing the remote shell, to the .rhost file
in the account that the rsh -l user was directed at on the qnx box. That’s right,
right?

Rob Rutherford

“Robert Rutherford” <> ruzz@ruzz.com> > wrote in message
news:8ncke1$ka0$> 1@inn.qnx.com> …
In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it
should
be no surprise that it doesn’t appear in the process list for the QNX box.

What did you expect?

Rob Rutherford


“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)


\

In comp.os.qnx J. Scott Franko <jsfranko@switch.com> wrote:


Robert Rutherford wrote:

In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it should
be no surprise that it doesn’t appear in the process list for the QNX box.


Huh?? I thought rsh would cause the ps and grep to be run on the QNX box. Are
you saying that the ps is running on QNX but the grep is running on the Sun?

You redirect the output of “rsh” to “grep”. If you want to run grep on QNX box,
it should say:

rsh qnx_box “ps -ef | grep sleep”

What did you expect?

I guess I expected the same output.

Don’t think so. The line above is same as running:

ksh -c “ps -ef | grep sleep”

in local.

-xiaodan


Rob Rutherford

“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)
\

Thanks for the info! After 4 years with unix (and 14 with vms) you’d think I’d know
these little things, but unix is a great humbler. Everytime I get cocky, it shows me
how little I really do know. ;0)

Scott

Xiaodan Tang wrote:

In comp.os.qnx J. Scott Franko <> jsfranko@switch.com> > wrote:

Robert Rutherford wrote:

In the first case the grep command is running on the QNX box.

In the second case the grep command is running on the Sun box. So it should
be no surprise that it doesn’t appear in the process list for the QNX box.


Huh?? I thought rsh would cause the ps and grep to be run on the QNX box. Are
you saying that the ps is running on QNX but the grep is running on the Sun?

You redirect the output of “rsh” to “grep”. If you want to run grep on QNX box,
it should say:

rsh qnx_box “ps -ef | grep sleep”

What did you expect?

I guess I expected the same output.

Don’t think so. The line above is same as running:

ksh -c “ps -ef | grep sleep”

in local.

-xiaodan


Rob Rutherford

“J. Scott Franko” <> jsfranko@switch.com> > wrote in message
news:> 39999CFF.AF12BA16@switch.com> …
I’m getting different output from local output of the ps -ef |grep sleep
command on a QNX box versus the rsh execution of the same command from a
Sun Workstation to the same QNX box. Any ideas why?

On QNX:
coltona$ ps -ef | grep sleep
8761 8164 10o REPLY 25 00:00:00 grep sleep
8632 7 10o RECV 1 00:00:10 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:10 ./sleep 1000

On Sun:
laser> rsh coltona ps -ef | grep sleep
9050 7 10o RECV 1 00:00:04 (//7/bin/sleep)
8633 22941 10o RECV 1 00:00:54 (//7/bin/sleep)
\