4

When I run command like iostat -dkx 2 2 via ssh, I get the expected result, but the processes on the local computer are saying alive in status "interruptible sleep". Why is this happening? Is there a way to find out the reason of that behavior?

full command:

$ ssh -o ConnectTimeout=4 -o ChallengeResponseAuthentication=no -o PasswordAuthentication=no <user>@host> iostat -dkx 2 2

ps output:

$ ps aux | grep 11893 && ps aux | grep PID
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
1000       10273  0.0  0.0 103280   904 pts/0    S+   12:09   0:00 grep PID
1000       11893  0.0  0.0 158732  3892 ?        S    Feb17   0:00 ssh -o ConnectTimeout=4 -o ChallengeResponseAuthentication=no -o PasswordAuthentication=no <user>@<host> iostat -dkx 2 2
1000       10285  0.0  0.0 103280   904 pts/0    S+   12:09   0:00 grep 11893

strace:

$ strace -p 11893
Process 11893 attached - interrupt to quit
select(8, [5], [], NULL, NULL^C <unfinished ...>

wchan:

$ cat /proc/11893/wchan 
poll_schedule_timeout

stacktrace:

$ cat /proc/11893/stack 
[] poll_schedule_timeout+0x39/0x60
[] do_select+0x6bb/0x7c0
[] core_sys_select+0x18a/0x2c0
[] sys_select+0x47/0x110
[] system_call_fastpath+0x16/0x1b
[] 0xffffffffffffffff

2 Answers 2

1

There seems to be nothing wrong. The process you are looking at (ssh) has simply nothing to do at the moment you are taking it's process stat.

As long as there is no output from the remotely started command, the "select" blocks, and the process is sent to sleep.

1
  • thank you for answer. When the command is successfully completed, shouldn't process be killed? When I run some other commands it does not occur. Only iostat behaves so. Feb 19, 2016 at 13:07
0

Do you have ControlMaster in your configuration (~/.ssh/config) by any chance? If you do, then the ssh process can't exit if it's the master connection for another connection. If that's the issue, it's unrelated to running iostat, the connection that stays open is the first you make to this particular server while no connection is already active.

1
  • Thank's for your answer, i have not ControlMaster in ssh configuration files. Feb 23, 2016 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.