RHEL 7.7 terminal closing automatically

Latest response

When I open a terminal and lock screen for about 15-30 minutes and unlock. Terminal will have disappeared.

What could be causing this?

Responses

I have reviewed the logs, with nothing showing. I have updated to the latest kernel 7.7. Still no change. maybe something got out of whack and may just need to reboot.

Hi Nathan,

Couple of suggestions.

Various Shells like Bash interpret the environment variable TMOUT. It is maximum number of seconds to wait for a command in an interactive shell before exiting due to idleness. You will not see the warning message as your terminal will disappear.

a) Check if TMOUT environment variable is set.

b) See if these logs show anything:

# journalctl -b | grep -i "terminal"

c) Are you using GNOME? Check gconf.xml settings. From memory, one of them had something like:

"When command exits: Exit terminal."

Regards,

Dusan Baljevic (amateur radio VK2COT)

I ran journalctl -b | grep -i "terminal" and recieved no output.

I looked through /etc/gconf trying to find "When command exits: Exit terminal" in gconf.xml and did not see anything stating that in /etc/gconf.

Am I missing something? This is a gnome desktop. Only thing that has happened to the computer before this issue arose was 5 days prior was an update to RHEL 7.7.

EDITED/ADDED this specific post I made here is not applicable, they are not using ssh to the system, this is for local instances of terminal in graphical.target

There are various settings to automatically log a person out. There may be things under /etc/ssh/sshd_config

# ClientAliveInterval is in seconds
ClientAliveInterval 3600
ClientAliveCountMax 0

Also see this https://access.redhat.com/solutions/23874 and the man page for sshd_config

Regards

RJ

This is form the terminal window not an ssh terminal. I will check these settings but, do not believe it is ssh that is causing the terminal window in the desktop from the gui is causing the disruption.

The issue seems to arise after I lock the screen and come back in 15 minutes and all the terminal windows on my gui have disappeared.

Thanks Nathan, sorry I missed that. If you are logging in locally, then it's not sshd_config.

So you are not logged out then, it's only your terminal windows that are getting terminated after that period of time?

Thanks

RJ

I am logged on locally and not through ssh. It is only the terminal windows and it is after a period of 10 minutes the terminal will close.

Nathan,

Between what I and Dusan Baljevic mentioned, and your own pursuit, there doesn't seem to be anything apparent to point to a specific thing. I found instances if issues that affected versions of Red Hat prior to 7.7, however, this seems newer considering what you've posted.

I'd recommend putting in a case with Red Hat along with an sosreport.

I'll ask some others to review this too.

Regards

RJ

Nathan, Dusan Baljevic mentioned to check if TMOUT variable is set, was it set?

Open a terminal and run echo $TMOUT

Thanks

RJ

Running echo $TMOUT 600

600 = 10 minutes. Ill reconfigure TMOUT to be undefined

Hope that fixes it, let us know,

Hat tip to Dusan

Regards

RJ

So I checked the TMOUT setting and it was set to 600.
This setting was set based upon STIG RHEL 7 Benchmark 26 Apr 2019, Rule ID: SV-86847r4-rule; STIG ID: RHEL-07-040160

Glad we tracked it down. Now to determine what I should do.

That is good Nathan.

Now you know what caused it.

Since your security policy (for a good reason) sets TMOUT globally, your still can use workarounds.

Take a look at simple tricks in this post:

https://unix.stackexchange.com/questions/222283/read-only-tmout-variable-workaround-to-disable-automatically-exit-shell-when-t

Humans are good at by-passing rules :)

Regards,

Dusan Baljevic (amateur radio VK2COT)