6

When I need to start a background process on a low-importance server, I tend to use nohup:

nohup ./server.sh &

Most colleagues seem to prefer screen:

screen -D -R mydaemon
./mydaemon.sh
^A ^D

Are there any major differences in the effect of these two approaches? What are the benefits one way or the other?

Steve Bennett
  • 5,539
  • 12
  • 45
  • 57
  • Similar thread to refer http://unix.stackexchange.com/a/215947/123365 IMO, both have their own purpose! –  Jul 14 '15 at 15:39

1 Answers1

7

Disadvantages of nohup are that you can't reconnect to the process after the parent exits, and you have to go through the extra steps of making sure the output is captured correctly. With screen or tmux, you can still interact with the shell.

Michael Martinez
  • 2,543
  • 3
  • 20
  • 31