Search code examples
unixps

TTY says ? on ps -p command


I am running on a python script on Putty using & at the end of the command. When I checked ps -p processid, it showed some name under TTY. After some time internet got disconnected. After connecting back, I check the process status using ps -p processid but this time I found '?' under TTY. Does this mean my script broke?


Solution

  • No, it only means that the TTY, which the script was started from, was closed in the meantime.

    If you want to know more about the status, look into the STAT column:

    It shows the status of the process. S stands for sleeping: the process is waiting for something to happen. Z stands for a zombied process. A zombied processes is one whose parent has died, leaving the child processes behind. This is not a good thing. D stands for a process that has entered an uninterruptible sleep. Often, these processes refuse to die even when passed a SIGKILL. You can read more about SIGKILL later in the next section on kill . W stands for paging. A dead process is marked with an X. A process marked T is traced, or stopped. R means that the process is runable.

    source: http://www.slackbook.org/html/process-control-ps.html