2

I started an application from the terminal which prints the status and various logs in the console so that I can read them from the terminal. I accidentally closed the terminal but the application is still running, however, I can't see the logs anymore. Is there a way to get back access to that process console which is still running. ?

I am on Red Hat Enterprise Linux Server 7.1 (Maipo).

I was running an application in tornado, a python framework using the following command.

python2.7 /proj/website/app.py 8080

8080 is the port number.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Codeformer
  • 131
  • 3
  • 8
  • See [how to recover a backgrounded job from a previous shell](https://unix.stackexchange.com/questions/49106/how-to-recover-a-backgrounded-job-from-a-previous-shell/49120#49120) – Mark Plotnick Jun 26 '17 at 03:26

1 Answers1

0
  1. Find the pid of the process python with ps, pgrep command.
  2. Get the file discriptor of 1 (stdout) or 2 (stderr) /proc/your_python_pid/fd/{1,2}.

I found the similar post and link: https://stackoverflow.com/questions/8994593/how-to-reroute-stdout-stderr-back-to-dev-tty

minish
  • 294
  • 2
  • 6