This question is old, and I am still not clear about why.
Original question in 2014:
In a Gnome Terminal tab, I ran
$ nohup chromium-browser &
But when I close the terminal tab, chromium-browser
also exits. Isn't nohup
supposed to prevent that? Gilles said:
nohup and disown both can be said to suppress SIGHUP, but in different ways. nohup makes the program ignore the signal initially (the program may change this). nohup also tries to arrange for the program not to have a controlling terminal, so that it won't be sent SIGHUP by the kernel when the terminal is closed. disown is purely internal to the shell; it causes the shell not to send SIGHUP when it terminates.
So doesn't nohup make chromium-browser ignore SIGHUP?
I am seeing this on other executables, too, such as and Emacs (GUI mode). But not on xeyes.
This is happening on Ubuntu 12.04, 32-bit when the question was posted.
Update in 2015,
Now I am running Ubuntu 14.04, with google-chrome
instead of chromium-browser
installed. Same thing that happened to chromium-browser before also happens to google-chrome now. nohup google-chrome 2>/dev/null &
doesn't save it from being closed when the terminal tab is closed. /usr/bin/google-chrome
is a link to a bash script /opt/google/chrome/google-chrome
. Why does nohup
applied to the bash script not work? How can we make it work on bash scripts? What about Python scripts?
xeyes
.