LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Tags used in this thread
Popular LQ Tags , , , , ,

Reply
 
Thread Tools
Old 01-30-2008, 03:05 PM   #1
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72
Thanked: 0
How do I "reset" a frozen/unresponding tty (mingetty)


[Log in to get rid of this advertisement]
I have 3 servers attached to a cheap 4-port Belkin KVM switch. For some reason, when I am switching between computers, there are times when I lose my TTY on my Linux machine - it freezes and won't respond to keyboard input. I can switch to another TTY, but the TTY I had is lost. After a while, I lose all of my TTYs and have to initiate a reboot via SSH, or press Ctrl+Alt+Del.

When I go back to the "frozen" tty, I can still see everything (I don't get a blank screen)... I just can't type anything. It won't accept keyboard input of any kind.

Yes, it's a cheap switch, but I can't afford to get anything better at the moment. Money is tight.

What I've done is ps -A | grep tty and tried to kill -9 the processes attached to that tty, thinking that would do it. But it doesn't.

I don't have much experience with mingetty... is there a way for me to reset mingetty and bash on tty1 via tty2 or tty3?

This has been a nagging problem for several years, believe it or not, so any help would be very, very appreciated.

Last edited by utahnix; 01-30-2008 at 03:06 PM.. Reason: Clarification
utahnix is offline     Reply With Quote
Old 01-30-2008, 04:10 PM   #2
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 6,908
Thanked: 165
Why not just kill the getty ???.
Hopefully should respawn, but if not just issue the command yourself.
syg00 is offline     Reply With Quote
Old 01-30-2008, 09:46 PM   #3
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72
Thanked: 0

Original Poster
Quote:
Originally Posted by utahnix View Post
What I've done is ps -A | grep tty and tried to kill -9 the processes attached to that tty, thinking that would do it. But it doesn't.
That is what I meant... I kill all the mingetty processes, but it doesn't do the trick.
utahnix is offline     Reply With Quote
Old 01-31-2008, 05:08 AM   #4
DaRkBoDoM
LQ Newbie
 
Registered: Oct 2007
Location: Italy
Distribution: Debian
Posts: 18
Thanked: 0
Does the new mingetty process respawns after you killed the frozen one? Check this first
DaRkBoDoM is offline     Reply With Quote
Old 01-31-2008, 01:09 PM   #5
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72
Thanked: 0

Original Poster
Yes, it respawns, but that doesn't help. But I don't think bash is also respawning. Or does bash load when the user logs in?

Last edited by utahnix; 01-31-2008 at 01:10 PM.. Reason: spelling corrections
utahnix is offline     Reply With Quote
Old 01-31-2008, 01:34 PM   #6
DaRkBoDoM
LQ Newbie
 
Registered: Oct 2007
Location: Italy
Distribution: Debian
Posts: 18
Thanked: 0
Yes, bash loads when the user logs in.

I'm sorry, I can't help you more.
DaRkBoDoM is offline     Reply With Quote
Old 11-03-2008, 11:42 AM   #7
Baffo32
LQ Newbie
 
Registered: Nov 2008
Posts: 2
Thanked: 0
I have had this problem occasionally for a long time when mistyping control codes in a tty and finally found the solution. A ^S (XOFF) sent to the terminal will halt -any- further transmission of data until a corresponding ^Q (XON) is recieved. Your keyboard switch is probably sending inadvertent ^S's. Typing Ctrl-Q in the frozen TTY may resolve the problem.

See 'Software flow control' in Wikipedia for more information. Seems I'm not allowed to post links on first post.
Baffo32 is offline     Reply With Quote
Old 12-13-2008, 02:13 AM   #8
tek1024
Member
 
Registered: Sep 2003
Location: USA
Distribution: Xubuntu 8.10 AMD64
Posts: 49
Thanked: 0
Lightbulb ditto

Oddly, I seem(ed) to be having this same problem exactly right now.

I logged into my box locally on tty1 and opened up a screen session. I stopped gdm (`/etc/init.d/gdm stop`) and one of my Xorg processes went through the roof with CPU usage. So, I killed the X process with SIGTERM as root, and immediately, the screen locked up.

I was able to log in through ssh and reconnect to my screen session; everything else remained running just like normal.

Finally, exactly 24 hours later, it occurred to me to run startx as root (`sudo -s`). $DISPLAY was set to :0.0 as normal. Success! My default X session started up and I was able to logout, which (since gdm wasn't running) sent me back to the console on tty7. Ctrl+Alt+F1 brought me back to tty1 and I was able to login successfully.

For clarity:

Problem: TTY is frozen / locked / hung and will not display.

Solution1: If root (UID 0) cannot login directly to SSH:

Code:
user@workingbox:~$ ssh user@frozenbox

#  SSH might ask for a password if you're not using
#+ public key authentication.

user@frozenbox:~$ sudo -s

#  See `man sudo` for details on the '-s' argument.
#  You will be prompted for your password if user isn't
#+ in your /etc/sudoers on "frozenbox".
#  See `man 5 sudoers` for more information.

root@frozenbox:~# ( [ -z $DISPLAY ] || [ "$DISPLAY" -ne $':0.0' ] ) && export DISPLAY=':0.0'

#  In English: if $DISPLAY isn't set OR it's not equal to ':0.0',
#+ export the value of $DISPLAY to be ':0.0' inside this shell.
#  For more, see <http://wooledge.org:8000/BashGuide>.

root@frozenbox:~# startx

#  This should start an X session on your local machine,
#+ allowing you to logout normally and type Ctrl+Alt+F1
#+ (or F2 through F6) to get back to a working console.
Solution2: Requires that `startx` can be executed by root && that ssh allows root to login directly:

Code:
user@workingbox:~$ ssh root@frozenbox '/usr/bin/startx -- localhost :0.0'

At least, FWIW, that solved my issues.
tek1024 is offline  
Tag This Post , , , , ,
Reply With Quote
Old 02-25-2009, 04:22 AM   #9
armandino
Member
 
Registered: Oct 2005
Posts: 49
Thanked: 0
My problem is that the command
Code:
ps ax | grep tty
does not show any process associated to the frozen terminal and the command
Code:
ps ax | grep getty
does not show anything except the command line itself.
If I switch to the frozen terminal (ALT+Fx) I can see what follows:
Code:
#exit
logout
_
The cursor is NOT blinking.
The terminal seems to be just frozen in such a state, not responding to any input from the keyboard.
I'm sure there MUST be a simple command line which root can use to reset any terminal, but I haven't found it yet. Any help would be highly appreciated.

Of course I'd also like to know WHY an ordinary "exit" command produces such an effect, but that's another question...

Last edited by armandino; 02-25-2009 at 04:23 AM..
armandino is offline     Reply With Quote
Old 02-25-2009, 04:39 AM   #10
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 9.10
Posts: 1,678
Thanked: 28
are you using a VC?
must be if you are using mingetty...
try hitting scroll lock when the screen locks up like that
frieza is offline     Reply With Quote
Old 04-01-2009, 11:14 AM   #11
gsf
LQ Newbie
 
Registered: Apr 2008
Posts: 2
Thanked: 0
@frieza thanks! my tty just froze up and i came here via google. the kvm i use switches screens with a couple hits of the scroll lock, and i'm so used to it i didn't even think of that as a culprit, but, sure enough, hitting the scroll lock again on that tty thawed it right out.
gsf is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"clear" and "reset" bash commands broken AviJacobson Linux - General 6 07-03-2006 07:28 AM
"clear" and "reset" bash commands broken AviJacobson Linux - Software 1 06-29-2006 03:31 PM
Is a "mingetty" process a security whole? TruckStuff Linux - Security 3 05-29-2002 11:22 AM


All times are GMT -5. The time now is 03:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration