3

Is it possible to reattach a process started with nohup?

For example, start in a terminal:

nohup tail -f /dev/null &

Close the terminal. Now open a new terminal. How do you reattach the nohup'd process to this new terminal?

user300811
  • 173
  • 1
  • 8

1 Answers1

5

You can use tools such as reptyr to reattach a running process to a new terminal, generally speaking though it's a lot simpler to plan ahead and simply launch the process inside screen or tmux - that way you don't need nohup, and you can connect/disconnect at will.

AD7six
  • 2,810
  • 2
  • 20
  • 23
  • I hoped there would be a standard utility for it. Screen is not available on the machines where the command was started with nohup – user300811 Mar 08 '12 at 14:30
  • if screen isn't available, I assume that means you don't have root access and therefore can't install anything. Which means: you're left with tailing a log file as your "available" options for the circumstances you've described. – AD7six Mar 08 '12 at 14:53