Difference between logout from Gnome and Telnet

Hi,
I have a java process started as a background job from Gnome Shell and logs out, that process is killed whereas when I started the same process from a telnet console and then logs out of the telnet session, that process is running properly. Can some one guide me with whats actually happening in both these scenarios. Introducing a nohup while starting the backup processes, it was working fine in both the cases.

Thanks,
Suresh

Two things are going on, job control and controlling terminals.

SIGHUP is a signal generated when a session closes, or a terminal hangs up.

The correct thing to do is use nohup to prevent the SIGHUP handler killing the process.

Dear Porter,
Thanks you very much for the reply:b:.

I have a doubt.

Do you mean to say that the SIGHUP signal will be send up only in case of closing the Gnome Shell and it will not be triggered when you closes the telnet session.

Also when I tested with setting the DISPLAY variable as empty
ie., export DISPLAY=
in the Gnome Shell, started the java application without a nohup in the background and logged out, it is still running properly.

Sorry, I am quite new to linux:confused:, so I can't understand what is exactly happening.

Regards,
Suresh

Excellent! So your program, if you let it, tries to connect to the current DISPLAY then gets all upset if that connection gets removed at a later date.

Great problem determination there!

When you do "ps -ef", there is a column for the controlling terminal (it will either be a real terminal or a pseudo-terminal). Is one still attached to the java process or is it blank?

Dear Porter,
Thanks for your reply. But I couldn't understand which column u r mentioning. When I put a ps -ef, the column headers shown are as follow:
UID PID PPID C STIME TTY TIME CMD

Also in the column list, I can't find any keywords like terminal. I run the command ps -ef from an external telnet terminal before and after the gnome session logout. I found that the following process are missing in the command result after logout. Is this anything has to do with the "DISPLAY" variable ?

/usr/X11R6/bin/X :0 -audit 0 -auth /v
/usr/bin/gnome-session
/usr/libexec/gconfd-2 13
/bin/bash /etc/X11/xdm/Xsession
and my java process.

Also why is DISPLAY variable not considered when I telnet and then logged out.

Regards,
Suresh

TTY = TeleType = Terminal

DISPLAY is for X-Windows, it tells a program how to connect to a graphical terminal. Telnet is a character based stream.