LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   logout from console hangs (https://www.linuxquestions.org/questions/linux-newbie-8/logout-from-console-hangs-293377/)

slice 02-22-2005 08:39 AM

logout from console hangs
 
Hi, I have a server running RH9 (2.4.20-8smp). When I logout from console, I dont get the login prompt back.. I have used up all the alt login consoles :(

I can ssh to the machine, but I need to work from the console often. ps doesnt show any extra shell processes running, so its not the shell thats hanging.. Is there a way to get the login prompts back without rebooting?

Thanks in advance,
slice

druuna 02-22-2005 08:46 AM

Hi,

Do you have a .bash_logout in your homedir(s) which contains 'strange' things that could hang the logout process?

slice 02-22-2005 08:58 AM

Nope, all pretty standard stuff.. sourcing any of the *shrc files doesnt hang.. Plus I think if .bashrc was incorrect, exiting from ssh would have hung too, no? but ssh works fine.

slice

druuna 02-22-2005 09:08 AM

Hi again,

What do the inittab entries (the Xgetty lines) look like. Depending on which getty you use they should look something like this (using agetty):

1:2345:respawn:/sbin/agetty tty1 9600
.
.
6:2345:respawn:/sbin/agetty tty6 9600

slice 02-22-2005 09:16 AM

Hi druuna,

They look like

1:2345:respawn:/sbin/mingetty tty1
...
6:2345:respawn:/sbin/mingetty tty6

but there are no mingetty processes running.. Is it ok to manually respawn them??

slice

druuna 02-22-2005 09:30 AM

Hi,

You only see these settings if nobody is logged in on the console (remote connections do not influence this). Here's an example with nobody on the console:

$ ps -ef | grep getty
root 217 1 0 11:53 tty1 00:00:00 /sbin/agetty tty1 9600
root 218 1 0 11:53 tty2 00:00:00 /sbin/agetty tty2 9600
root 219 1 0 11:53 tty3 00:00:00 /sbin/agetty tty3 9600
root 220 1 0 11:53 tty4 00:00:00 /sbin/agetty tty4 9600
root 221 1 0 11:53 tty5 00:00:00 /sbin/agetty tty5 9600
root 222 1 0 11:53 tty6 00:00:00 /sbin/agetty tty6 9600

Here's the same query with somebody at the console:

$ ps -ef | grep getty
root 218 1 0 11:53 tty2 00:00:00 /sbin/agetty tty2 9600
root 219 1 0 11:53 tty3 00:00:00 /sbin/agetty tty3 9600
root 220 1 0 11:53 tty4 00:00:00 /sbin/agetty tty4 9600
root 221 1 0 11:53 tty5 00:00:00 /sbin/agetty tty5 9600
root 222 1 0 11:53 tty6 00:00:00 /sbin/agetty tty6 9600

As you probably noticed, tty1 is 'missing'.

$ ps -ef | grep tty1
root 217 1 0 11:53 tty1 00:00:00 -bash

This is that entry, a bash shell is running on that tty.

If all of your tty's are active (although you tried to log off) you will not see any of the above mentioned 00:00:00 /sbin/agetty tty entries.

Maybe the following will give a clue about what is happening on your box:

$ ps -ef | grep tty[1-6]

You could end up with a (very) long list depending on what was started and how much was 'killed' during the log-off process. It should show you the proces(ses) that are hanging the respawn.

Also, try a init q, this will 'restart' init after it reads its 'config' (/etc/inittab).

Hope this gets you closer to a solution.

slice 02-22-2005 10:09 AM

Hi, Thanks for the explanation.. That clarifies things a lot.. But heres the deal.. I dont see any mingetty OR bash/tcsh processes running.. It probably means bash didnt exit correctly.. I tried "init q" too, doesnt seem to work..

[root@neumann ~]# ps -ef|grep tty
root 30865 30692 0 10:36 pts/4 00:00:00 grep tty

[root@neumann ~]# ps -ef | grep bash
root 32485 1 0 2004 ? 00:00:00 /bin/bash /etc/rc.d/rc 3


Any other ideas what I could try??

slice

druuna 02-22-2005 11:29 AM

Hi,

Still thinking about this one...... Interresting problem, although I wouldn't be surprised if the sollution will be found in some small thing.

Ok, I've got a few questions:

1) Do the logfiles show any related messages (mingetty and/or tty related and/or respawning to fast).

2) Can you start a tty by hand ($ /sbin/mingetty tty8) and log on to that tty? You should be able to log on once on that tty and get no prompt after logging out.

slice 02-22-2005 01:07 PM

Hi, theres nothing strange in the logfiles either.. Cant start /sbin/mingetty tty8.. says operation not permitted in /var/log/messages.. I am at my wits end.. mebbe I shud just wait till the next scheduled reboot next month.. but its damn annoying not to have a shell on the console..

slice


All times are GMT -5. The time now is 05:49 AM.