[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 528
  • Last Modified:

Too many ttys running

If I use the 'who' command I can see that I have about 5 ttys running, some as far back as a month ago.  Id like to be able to get rid of these ttys so I did a 'ps aux' looked up the pid #s and went to kill off these processes known as /sbin/mingetty (5 appeared) but they would just respawn.  Why would these 5 ttys be running in the firt place? I always log out of the shell.  How would I kill these ttys?  And what is the need for the mingetty process?

Thanks,
-Dan
0
dmaroff
Asked:
dmaroff
  • 5
  • 4
  • 3
  • +1
1 Solution
 
hotbotCommented:
these tty are run at boot there are normal , you can ajust them run just one , but after that you can't run an another console on your machine you can run an other console by typing alt+f1 or f2 f3 f4 f5 ....
carefull if you are under xwindows you need to type alt+f7 if your are running 6 mgetty or alt+f6 if you run 5 mgetty .
sorry for my english

if this answer is ok for you PLEASE give me just 1 point for it knowledge is free :)
0
 
DVBCommented:
The consoles are started at boot time from /etc/rc.d acccording to the runlevel specified in your /etc/inittab. Mingetty (man mingetty)is the process which handles your login process.

To kill them, you need to edit your launch scripts (/etc/rc.d) to reflect on the number of ttys you want running. Then init q. The process respawns because of the /etc/inittab entry field respawn, which keeps the process up.
You need these ttys if you need to login as another user on the same machine (w/o using su) or for some debugging purposes. I uses these when I need to be using two applications in the foreground.

If you are running Xwindows, Ctrl + Alt + F1 (upto F6) will give you access to these text consoles. Xwindows will be running on Ctrl + Alt + F7. (This assumes six consoles running, if you have a different number, xwin = no. of consoles +1)

I hope that this is useful. (And of course, hotbot should get preference over me, hes given the answer firs, I merely rephrased it).
0
 
dmaroffAuthor Commented:
I thought getty was responsible for providing the login prompt?  Whats the difference If I get rid of all the /sbin/mingetty. Would it hurt?

Thanks,
-Dan
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
hotbotCommented:
no mgetty give you console access
login give you login prompt , but login need a console .
to see the diff between mingetty and mgetty , read the man's
0
 
munsieCommented:
well, if you get rid of all the mingetty's, you wont be able to log in from a text console, only from X windows.  This probally won't be a problem unless your X windows configuration gets messed up.  At that time, you wouldn't be able to get to a login prompt to fix the configuration unless you are connected to a network and can telnet into your box.

Anyway, if those mingetty's are bothering you, you can edit /etc/inittab.  Look for the lines with the respawn on /sbin/mingetty.  Just disable them by putting a # in front of each of them.  I recommend leaving one of them uncommented.  The memory you save by closing them all is outweighed by being able to recover your machine from a misconfiguration without reinstalling.

On the other hand, if you decide you really, really, like having multiple consoles and want more, just add some more lines (up to 12, you can go more, but the keypresses to get to them get tricky) numbering from where your distribution left off.

btw, in case your interested, /etc/inittab is also the same file where you can override the default behavior of what happens when you press ctrl-alt-delete.  In RedHat 6.1, it's set by default to /sbin/shutdown -t3 -r now... but on my laptop, I changed it to /sbin/poweroff so I didn't have to power it off separately when I hit ctrl-alt-delete.

good luck,
dennis
0
 
munsieCommented:
in regards to hotbot's answer...

technically, mingetty does provide the initial login: prompt.  It then takes the user name provided and passes it to login.  login provides the password prompt.  If the login attempt isn't successful, then login provides the follow up login: prompt.

This setup allows multiple mingettys to run without having to have login running.

dennis
0
 
dmaroffAuthor Commented:
You can't just get rid of them at random like 'munsie' has claimed because each line is associated with a run level.  I commented all but the line with run level #2 and the machine did boot with run level #2 but then reported that it had been reached and hung on me.

I thought I was screwed but I noticed that I could still use ALT-F? and still use other logins.  Just ALT-F1 has hung.
Why is that?

Are the mingetty's attached to the ALT-F?s somehow?

I looked up that getty is for logging in and mingetty is for virtual consoles, what does this mean?  

Thanks,
-Dan
0
 
munsieCommented:
the first column isn't run level, it's the identifier for the console on that tty.  The second column, the one with 2345 or 12345 in it is the run levels.  You want to remove all but the first one.  That's the default console, and it is started in all of the run levels (1-5).

the reason you can't use the f1 console is because you removed it.  the f2 console still works because that's the one you left in.

good luck,
dennis
0
 
dmaroffAuthor Commented:
My bad, I realize how the whole thing works now.  Munsie wasn't wrong.  But Id still like to know what a virtual console is.

Oh, and by reducing these mingettys will that prevent or set limits on other people from telnetting in or is that setup differently?  Another words, is this just strictly related to the ALT keys?

I thank you all for your help, Id like to give all of you points, cause you were all very helpfull, but I dont know how to do that.  Who wants the points?

Thanks, :)
-Dan
0
 
hotbotCommented:
give them to munsie or to DVB .
 as i told you share knowledge is free
go take a look at www.gnu.org .without gnu linux is just a kernel !
0
 
munsieCommented:
reducing the mingettys just resrict the alt terminals.   You can still telnet in as many times as you want.

A virtual console is the term given to the splitting of the real console into multiple consoles (via the alt keypresses).  A virtual console is only available when you actually switch to it... when you're not switched to it, it only exists deep in the bowels of kernel space.

The console spends its time in linux showing one of the virtual consoles.

hope that helps,
dennis
0
 
dmaroffAuthor Commented:
Adjusted points from 50 to 75
0
 
dmaroffAuthor Commented:
I appreciate all your help everyone.  I agree with hotbot in that its nice to know you can get free help.  I gave it to Munsie because he helped me a lot.

Before I go, I know this has nothing to do with my original question, but if any of you know the answer, Id appreciate it.  When I close out of emacs (not Xemacs) using (C-x, C-c) I get to a prompt but above the prompt it says "Fatal error(11).segmentation fault"  It doesn't do anything to harm the system or get in my way, but it bothers me thats its there.  Has anyone dealt with this?  I tried re-installing emacs but that didn't help.  Im running version 20.3.1

Thanks again,
-Dan
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now