I am connected to a linux machine over ssh
. There I used screen
to run multiple processes that will keep running after I log out of my session. However, after a while the processes stopped producing output (to stdout
) even though they are taking up memory. I want to know how I can reactivate them. Here is what the list of processes under my username looks like (top -u MY_USERNAME
):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1268 abcdef 20 0 100m 2044 1012 S 0.0 0.0 0:00.03 sshd
1269 abcdef 20 0 105m 1940 1456 S 0.0 0.0 0:00.06 bash
12375 abcdef 20 0 115m 1452 808 S 0.0 0.0 0:00.02 screen # contains python procs
12615 abcdef 20 0 406m 58m 2140 S 0.0 0.0 0:02.23 python # parent process
12618 abcdef 20 0 5170m 4.7g 1176 S 0.0 1.9 546:19.26 python # child process
12619 abcdef 20 0 5164m 4.7g 1172 S 0.0 1.9 539:33.64 python # child process
12620 abcdef 20 0 5185m 4.7g 1172 S 0.0 1.9 547:46.92 python # child process
12621 abcdef 20 0 5171m 4.7g 1168 S 0.0 1.9 540:45.53 python # child process
12622 abcdef 20 0 5179m 4.7g 1172 S 0.0 1.9 546:50.28 python # child process
12623 abcdef 20 0 5171m 4.7g 1168 S 0.0 1.9 549:20.39 python # child process
12624 abcdef 20 0 5178m 4.7g 1172 S 0.0 1.9 543:33.55 python # child process
12625 abcdef 20 0 5177m 4.7g 1172 S 0.0 1.9 545:59.51 python # child process
If it's relevant: the processes do not require user input. I do not have sudo
privileges.
You can see under the S column, all processes are designated S
. How do I change them to R
? Will that make them resume their output to stdout
?
Note: I checked the question here but that refers to manually suspending and waking processes. I am not sure why my processes went to sleep in the first place and I want to wake them up.
Edit: After checking the question here, I ran the command strace -p 12622
for a child process and got: futex(0x984271b0, FUTEX_WAIT_PRIVATE, 0, NULL
. Wikipedia says it's some kind of a lock. I am not sure if that is significant.
screen -x
to reattach to the screen session and interact with whatever processes you have running there.ps
showing a status ofS
doesn't mean that a process is hung necessarily, but merely that it's not actively seeking CPU allocation (or, more precisely, that it's waiting for something else to complete its execution). See the Process State Codes section of the man page forps
.