Solved

Too many ttys running

Posted on 2000-04-03
13
514 Views
Last Modified: 2006-11-17
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
Comment
Question by:dmaroff
  • 5
  • 4
  • 3
  • +1
13 Comments
 

Expert Comment

by:hotbot
ID: 2681395
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
 
LVL 3

Expert Comment

by:DVB
ID: 2681590
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
 

Author Comment

by:dmaroff
ID: 2681838
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
 

Expert Comment

by:hotbot
ID: 2682229
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
 
LVL 2

Accepted Solution

by:
munsie earned 75 total points
ID: 2682243
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
 
LVL 2

Expert Comment

by:munsie
ID: 2682251
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:dmaroff
ID: 2684180
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
 
LVL 2

Expert Comment

by:munsie
ID: 2684234
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
 

Author Comment

by:dmaroff
ID: 2684391
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
 

Expert Comment

by:hotbot
ID: 2684410
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
 
LVL 2

Expert Comment

by:munsie
ID: 2684644
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
 

Author Comment

by:dmaroff
ID: 2684817
Adjusted points from 50 to 75
0
 

Author Comment

by:dmaroff
ID: 2684819
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now