nohup vs screen vs ? for manually starting daemon processes

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?


Solution 1:

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.