Answer the question
In order to leave comments, you need to log in
How to get stdout of already running process?
There was a simple problem and, unfortunately, I can not find a solution. There is a certain process process outputting information to stdout. Let's assume that we connected to the server via ssh and started this process as process &
. As a result, while we are in this SSH session, we see everything that this process writes to stdout on the screen, but when we relogin to the server, of course, we don’t see anything anymore, although this process works in the background. About redirecting input / output to a file, screen, etc. - I know.
Interested in a way to read the stdout of an already running process. From /proc/$(pid)/fd/1
, as advised on the Internet, for some reason nothing works. Those. tail -f /proc/$(pidof process)/fd/1
outputs nothing. readlink -f /proc/$(pidof process)/fd/1
shows /dev/pts/19
, but options like tail -f /dev/pts/19
or cat /dev/pts/19
also don't work.
As a result, the question remains open - how to see the stdout of an already running process if it is disconnected from the console? Or maybe there is an opportunity to "attach" it to the console back? Thanks in advance.
ps I would like to implement the task without redirecting the output of the process to a file and without launching it in screen.
Answer the question
In order to leave comments, you need to log in
when relogin to the server, when relogin to the server, of course, we don’t see anything anymore, although this process works in the background, of course, we don’t see anything anymore, although this process works in the background
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question