public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* bogus tty entry
@  Ralph W. Reid
   ` Adam Myrow
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Ralph W. Reid @  UTC (permalink / raw)
  To: speakup

An incorrect user/tty combination is displayed by `who' on my system,
and I would like to remove it.  `who' indicates that I am logged in
on tty12 even when I am not.  If I do log in on tty12, I appear to be
logged in on that tty twice.  The bogus terminal usage has no
processes associated with it so there is nothing to kill that might
clear the problem up.

I suspect that I crashed something that has left an invalid entry in
/var/run/utmp, but I do not know how to remove the invalid entry from
the file.  I tried to write a little C program to remove the invalid
entry using `logout' as defined in /usr/include/utmp.h, but an error
during compilation-linking seemed to indicate that I needed to
include one of the many libraries (perhaps from /lib?) on this system
to get my little program to become a running executable.  Is there
some sort of program on Slackware 8.0 that might help me clear up
this little annoyance, or should I start trying to figure out which
library I need to link with my little program to deal with it?  I
would prefer not to reboot this system just to handle such a little
problem.  Thanks for any suggestions, and have a _great_ day!

-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid@sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
CIRCLE CIRCUMFERENCE = 2 * _pi * r


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   bogus tty entry Ralph W. Reid
@  ` Adam Myrow
     ` Luke Davis
   ` Lorenzo Prince
   ` Joseph C. Lininger
  2 siblings, 1 reply; 16+ messages in thread
From: Adam Myrow @  UTC (permalink / raw)
  To: speakup

The only way to get rid of that is to zero out /var/wtmp and log out of
all vertial terminals.  You could also reboot, but why bother when you can
fix it without doing that?  The magic command is "cat /dev/null
>/var/wtmp."  Catting /dev/null over any file will make it empty but leave
its ownership and permissions intact, so this is the best way to empty out
a file that the system relies on.  Good luck.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   ` Adam Myrow
@    ` Luke Davis
       ` Adam Myrow
       ` Joseph C. Lininger
  0 siblings, 2 replies; 16+ messages in thread
From: Luke Davis @  UTC (permalink / raw)
  To: speakup

Do you need to do it on delay, then log out before it hits?  That is:

(sleep 10; cat /dev/null > /var/wtmp) &
exit

On Wed, 26 Mar 2003, Adam Myrow wrote:

> The only way to get rid of that is to zero out /var/wtmp and log out of
> all vertial terminals.  You could also reboot, but why bother when you can
> fix it without doing that?  The magic command is "cat /dev/null
> >/var/wtmp."  Catting /dev/null over any file will make it empty but leave
> its ownership and permissions intact, so this is the best way to empty out
> a file that the system relies on.  Good luck.
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
     ` Luke Davis
@      ` Adam Myrow
       ` Joseph C. Lininger
  1 sibling, 0 replies; 16+ messages in thread
From: Adam Myrow @  UTC (permalink / raw)
  To: speakup

I've never tried to log out before it hits, but do it that way if you
like.  I have you log out after clearint the file because consulting the
file while you are logged in after clearing it out shows nobody logged in.
That file is what who and similar commands look at to see who is currently
logged in.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   bogus tty entry Ralph W. Reid
   ` Adam Myrow
@  ` Lorenzo Prince
     ` Luke Davis
                     ` (2 more replies)
   ` Joseph C. Lininger
  2 siblings, 3 replies; 16+ messages in thread
From: Lorenzo Prince @  UTC (permalink / raw)
  To: speakup

Just a question, probably unrelated, but does anyone happen to know how I
can login to more tty's than just 6?  My system will only let me login to
tty's 1 through 6, and I see over 40 tty's in /dev.  How can I login to
all these other consoles or are they just there to make newbies like me to
ask silly questions?  LOL.

Lorenzo

E Pluribus Unix



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   ` Lorenzo Prince
@    ` Luke Davis
     ` Ralph W. Reid
     ` Ralph W. Reid
  2 siblings, 0 replies; 16+ messages in thread
From: Luke Davis @  UTC (permalink / raw)
  To: speakup

Yes, the devices are there to make you ask questions.
The man page for inittab is there to give answers.

Look in /etc/inittab.
You will see getty entries for tty0-tty5.  Duplicate the last of these
entries, making the appropriate changes to numbers, for each additional
virtual console you require.

Then run:

telinit q

Luke


On Thu, 27 Mar 2003, Lorenzo Prince wrote:

> Just a question, probably unrelated, but does anyone happen to know how I
> can login to more tty's than just 6?  My system will only let me login to
> tty's 1 through 6, and I see over 40 tty's in /dev.  How can I login to
> all these other consoles or are they just there to make newbies like me to
> ask silly questions?  LOL.
>
> Lorenzo
>
> E Pluribus Unix
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   ` Lorenzo Prince
     ` Luke Davis
@    ` Ralph W. Reid
       ` Lorenzo Prince
     ` Ralph W. Reid
  2 siblings, 1 reply; 16+ messages in thread
From: Ralph W. Reid @  UTC (permalink / raw)
  To: speakup

Lorenzo Prince staggered into view and mumbled:
>
>Just a question, probably unrelated, but does anyone happen to know how I
>can login to more tty's than just 6?  My system will only let me login to
>tty's 1 through 6, and I see over 40 tty's in /dev.  How can I login to
>all these other consoles or are they just there to make newbies like me to
>ask silly questions?  LOL.


I started with 6 tty's here as well, and added 10 more to be able
to run a bunch of stuff all at once (man pages, telnet/ssh to other
systems, distributed.net projects, a screen or two of file editing,
etc.).  Tty1-tty12 are easy to get to quickly by pressing ALT-Fn
where n is the number of a function key--1 through 12.  To reach the
other 4 (tty13-tty16), I usually press ALT-LEFTARROW or
ALT-RIGHTARROW to cycle through the tty's until I get where I want.
Jumping directly to a tty can be accomplished by running `chvt' from
a shell prompt (see the man page for `chvt').  Below is what worked
on my Slackware 8.0 system:

1.  Log on as root to gain access to the necessary programs and
filees.

2.  Load the /etc/inittab file into your favorite editor.

3.  Search for the lines in the file which set up login screens for
tty1-tty6.  I found the following entries in my /etc/inittab file
(note that all of the entries except for tty6 use the same run
levels):

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
c4:1235:respawn:/sbin/agetty 38400 tty4 linux
c5:1235:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux

4.  Add additional similarly formatted lines for the additional
tty's.  Be sure to make appropriate changes (c7-c16 and tty7-tty16)
as needed.  Below are the lines I added to give me more tty's:

c7:1235:respawn:/sbin/agetty 38400 tty7 linux
c8:1235:respawn:/sbin/agetty 38400 tty8 linux
c9:1235:respawn:/sbin/agetty 38400 tty9 linux
c10:1235:respawn:/sbin/agetty 38400 tty10 linux
c11:1235:respawn:/sbin/agetty 38400 tty11 linux
c12:1235:respawn:/sbin/agetty 38400 tty12 linux
c13:1235:respawn:/sbin/agetty 38400 tty13 linux
c14:1235:respawn:/sbin/agetty 38400 tty14 linux
c15:1235:respawn:/sbin/agetty 38400 tty15 linux
c16:1235:respawn:/sbin/agetty 38400 tty16 linux

5.  Save the /etc/inittab file when the changes are complete.

6.  At the root shell prompt, run `telinit q' to make the changes
active.  If the changes you made are error free, the tty's you added
should be displaying login screens.

Since Speakup is in the kernel, it works fine on all of the tty's I
added (thanks to the Speakup developers for a job well done:)).  See
the man pages for `telinit', 'chvt', and `inittab'.  I hope this
rather wordy message proves helpful.  Have a _great_ day.


-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid@sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
_PI = 4 * ARCTAN (1)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   ` Lorenzo Prince
     ` Luke Davis
     ` Ralph W. Reid
@    ` Ralph W. Reid
       ` Adam Myrow
  2 siblings, 1 reply; 16+ messages in thread
From: Ralph W. Reid @  UTC (permalink / raw)
  To: speakup

Thanks for the suggestions about using /dev/null.  I have a process
running on tty16 that I would prefer not to stop, but the world may
not come to an end if I shut it down for a minute or two to clean up
my /var/run/utmp file.  The bogus tty12 entry does not seem to be
causing any problems though, so I might spend a little time tracking
down the library associated with the utmp.h header file before I
empty /var/run/utmp.  Thanks for the suggestions, and have a _great_
day!

-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid@sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
_PI = 4 * ARCTAN (1)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   bogus tty entry Ralph W. Reid
   ` Adam Myrow
   ` Lorenzo Prince
@  ` Joseph C. Lininger
     ` Ralph W. Reid
  2 siblings, 1 reply; 16+ messages in thread
From: Joseph C. Lininger @  UTC (permalink / raw)
  To: Speakup List

I know you don't want to reboot, but I would recommend just that. The
slackware 8.0 boot scripts will clear out the utmp file when you do this.
They issue a "cat /dev/null > /var/run/utmp" which effectively
clears the file out. Don't do this yourself as the system won't function
right until you reboot if you do. Logins, runlevel, and some other things
will break.

-- 
Joseph C. Lininger
jbahm@pcdesk.net

On Wed, 26 Mar 2003, Ralph W. Reid wrote:

> An incorrect user/tty combination is displayed by `who' on my system,
> and I would like to remove it.  `who' indicates that I am logged in
> on tty12 even when I am not.  If I do log in on tty12, I appear to be
> logged in on that tty twice.  The bogus terminal usage has no
> processes associated with it so there is nothing to kill that might
> clear the problem up.
>
> I suspect that I crashed something that has left an invalid entry in
> /var/run/utmp, but I do not know how to remove the invalid entry from
> the file.  I tried to write a little C program to remove the invalid
> entry using `logout' as defined in /usr/include/utmp.h, but an error
> during compilation-linking seemed to indicate that I needed to
> include one of the many libraries (perhaps from /lib?) on this system
> to get my little program to become a running executable.  Is there
> some sort of program on Slackware 8.0 that might help me clear up
> this little annoyance, or should I start trying to figure out which
> library I need to link with my little program to deal with it?  I
> would prefer not to reboot this system just to handle such a little
> problem.  Thanks for any suggestions, and have a _great_ day!
>
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
     ` Luke Davis
       ` Adam Myrow
@      ` Joseph C. Lininger
         ` Adam Myrow
  1 sibling, 1 reply; 16+ messages in thread
From: Joseph C. Lininger @  UTC (permalink / raw)
  To: speakup

I believe you actually want to get rid of /var/run/utmp, not wtmp. wtmp
holds login information, but not the info on who is currently logged in.
utmp is the file that holds that info. As I said in a previous message, I
don't recommend overwriting this file while your system is live because
some very weird things will happen if you do.

-- 
Joseph C. Lininger
jbahm@pcdesk.net

On Wed, 26 Mar 2003, Luke Davis wrote:

> Do you need to do it on delay, then log out before it hits?  That is:
>
> (sleep 10; cat /dev/null > /var/wtmp) &
> exit
>
> On Wed, 26 Mar 2003, Adam Myrow wrote:
>
> > The only way to get rid of that is to zero out /var/wtmp and log out of
> > all vertial terminals.  You could also reboot, but why bother when you can
> > fix it without doing that?  The magic command is "cat /dev/null
> > >/var/wtmp."  Catting /dev/null over any file will make it empty but leave
> > its ownership and permissions intact, so this is the best way to empty out
> > a file that the system relies on.  Good luck.
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
     ` Ralph W. Reid
@      ` Adam Myrow
         ` Joseph C. Lininger
  0 siblings, 1 reply; 16+ messages in thread
From: Adam Myrow @  UTC (permalink / raw)
  To: speakup

No, not /var/run/utmp, but /var/log/wtmp!  /var/run/utmp is a history of
logins, IIRC.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
       ` Joseph C. Lininger
@        ` Adam Myrow
  0 siblings, 0 replies; 16+ messages in thread
From: Adam Myrow @  UTC (permalink / raw)
  To: speakup

On Thu, 27 Mar 2003, Joseph C. Lininger wrote:

> I believe you actually want to get rid of /var/run/utmp, not wtmp. wtmp
> holds login information, but not the info on who is currently logged in.
> utmp is the file that holds that info. As I said in a previous message, I
> don't recommend overwriting this file while your system is live because
> some very weird things will happen if you do.

Ok, never mind, it is /var/run/utmp.  I did it once, and then logged out
of all my consoles.  It didn't give me any problems, but it sure wouldn't
hurt to reboot if you can if it makes you feel safer.  Whatever the case,
it hasn't happened to me in ages, so I thought that whatever caused it was
fixed.  I think it was in Slackware 8.0 where I was having the bogus
entries problem.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
     ` Ralph W. Reid
@      ` Lorenzo Prince
         ` Ralph W. Reid
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Prince @  UTC (permalink / raw)
  To: speakup

thanks everyone for your help.  I was able to get it to work.  Just
another question prompted by the message to which I'm replying.  How did
you get the mail client to quote my message using the opening line:

"Lorenzo Prince staggered into view and mumbled:"

Really cool.  I want to get my system to do that too.

Lorenzo

E Pluribus Unix

On Thu, 27 Mar 2003, Ralph W. Reid wrote:

> Lorenzo Prince staggered into view and mumbled:
> >
> >Just a question, probably unrelated, but does anyone happen to know how I
> >can login to more tty's than just 6?  My system will only let me login to
> >tty's 1 through 6, and I see over 40 tty's in /dev.  How can I login to
> >all these other consoles or are they just there to make newbies like me to
> >ask silly questions?  LOL.
>
>
> I started with 6 tty's here as well, and added 10 more to be able
> to run a bunch of stuff all at once (man pages, telnet/ssh to other
> systems, distributed.net projects, a screen or two of file editing,
> etc.).  Tty1-tty12 are easy to get to quickly by pressing ALT-Fn
> where n is the number of a function key--1 through 12.  To reach the
> other 4 (tty13-tty16), I usually press ALT-LEFTARROW or
> ALT-RIGHTARROW to cycle through the tty's until I get where I want.
> Jumping directly to a tty can be accomplished by running `chvt' from
> a shell prompt (see the man page for `chvt').  Below is what worked
> on my Slackware 8.0 system:
>
> 1.  Log on as root to gain access to the necessary programs and
> filees.
>
> 2.  Load the /etc/inittab file into your favorite editor.
>
> 3.  Search for the lines in the file which set up login screens for
> tty1-tty6.  I found the following entries in my /etc/inittab file
> (note that all of the entries except for tty6 use the same run
> levels):
>
> c1:1235:respawn:/sbin/agetty 38400 tty1 linux
> c2:1235:respawn:/sbin/agetty 38400 tty2 linux
> c3:1235:respawn:/sbin/agetty 38400 tty3 linux
> c4:1235:respawn:/sbin/agetty 38400 tty4 linux
> c5:1235:respawn:/sbin/agetty 38400 tty5 linux
> c6:12345:respawn:/sbin/agetty 38400 tty6 linux
>
> 4.  Add additional similarly formatted lines for the additional
> tty's.  Be sure to make appropriate changes (c7-c16 and tty7-tty16)
> as needed.  Below are the lines I added to give me more tty's:
>
> c7:1235:respawn:/sbin/agetty 38400 tty7 linux
> c8:1235:respawn:/sbin/agetty 38400 tty8 linux
> c9:1235:respawn:/sbin/agetty 38400 tty9 linux
> c10:1235:respawn:/sbin/agetty 38400 tty10 linux
> c11:1235:respawn:/sbin/agetty 38400 tty11 linux
> c12:1235:respawn:/sbin/agetty 38400 tty12 linux
> c13:1235:respawn:/sbin/agetty 38400 tty13 linux
> c14:1235:respawn:/sbin/agetty 38400 tty14 linux
> c15:1235:respawn:/sbin/agetty 38400 tty15 linux
> c16:1235:respawn:/sbin/agetty 38400 tty16 linux
>
> 5.  Save the /etc/inittab file when the changes are complete.
>
> 6.  At the root shell prompt, run `telinit q' to make the changes
> active.  If the changes you made are error free, the tty's you added
> should be displaying login screens.
>
> Since Speakup is in the kernel, it works fine on all of the tty's I
> added (thanks to the Speakup developers for a job well done:)).  See
> the man pages for `telinit', 'chvt', and `inittab'.  I hope this
> rather wordy message proves helpful.  Have a _great_ day.
>
>
> --
> Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
> rreid@sunset.net  http://personalweb.sunset.net/~rreid
> Opinions herein are either mine or they are flame bait.
> _PI = 4 * ARCTAN (1)
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
       ` Adam Myrow
@        ` Joseph C. Lininger
  0 siblings, 0 replies; 16+ messages in thread
From: Joseph C. Lininger @  UTC (permalink / raw)
  To: Speakup List

I believe you are mistaken. You have them reversed. /var/run/utmp stores
info on who is currently logged in, and /var/log/wtmp keeps a record of
logins. This comes from the slackware man page "man utmp"

-- 
Joseph C. Lininger
jbahm@pcdesk.net

On Thu, 27 Mar 2003, Adam Myrow wrote:

> No, not /var/run/utmp, but /var/log/wtmp!  /var/run/utmp is a history of
> logins, IIRC.
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
   ` Joseph C. Lininger
@    ` Ralph W. Reid
  0 siblings, 0 replies; 16+ messages in thread
From: Ralph W. Reid @  UTC (permalink / raw)
  To: speakup

Joseph C. Lininger staggered into view and mumbled:
>
>I know you don't want to reboot, but I would recommend just that. The
>slackware 8.0 boot scripts will clear out the utmp file when you do this.
>They issue a "cat /dev/null > /var/run/utmp" which effectively
>clears the file out. Don't do this yourself as the system won't function
>right until you reboot if you do. Logins, runlevel, and some other things
>will break.

Thanks for the suggestion.  As it happens, the power was interrupted
here briefly today, so my system has been rebooted.  There are no
more bogus tty entries on my system.  Thanks to everyone for your
input, and have a _great_ weekend!

-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid@sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
_PI = 4 * ARCTAN (1)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: bogus tty entry
       ` Lorenzo Prince
@        ` Ralph W. Reid
  0 siblings, 0 replies; 16+ messages in thread
From: Ralph W. Reid @  UTC (permalink / raw)
  To: speakup

Lorenzo Prince staggered into view and mumbled:
>
>thanks everyone for your help.  I was able to get it to work.  Just
>another question prompted by the message to which I'm replying.  How did
>you get the mail client to quote my message using the opening line:
>
>"Lorenzo Prince staggered into view and mumbled:"
>
>Really cool.  I want to get my system to do that too.

I use `elm' for my mail client.  As with many (perhaps all?) mail
clients these days, an option exists in a configuration file to set
up the feature you are looking for.  The first time `elm' is run, a
directory named '.elm' was created in my home directory, and a file
named 'elmrc' was written to that directory.  I used a text editor
to set the various options in the file, although I believe `elm' has
an option menu which could have been used to set up most or all of
the selections in this file.  The line in my elmrc file which
produces the line you are curious about reads as follows:

attribution = %s staggered into view and mumbled:

As I mentioned above, a similar option is probably available in just
about every mail client out there these days, so whichever client you
decide to use should be able to produce a similar attribution line.
I hope this info proves helpful, and have a _great_ weekend!

-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid@sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
_PI = 4 * ARCTAN (1)


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 bogus tty entry Ralph W. Reid
 ` Adam Myrow
   ` Luke Davis
     ` Adam Myrow
     ` Joseph C. Lininger
       ` Adam Myrow
 ` Lorenzo Prince
   ` Luke Davis
   ` Ralph W. Reid
     ` Lorenzo Prince
       ` Ralph W. Reid
   ` Ralph W. Reid
     ` Adam Myrow
       ` Joseph C. Lininger
 ` Joseph C. Lininger
   ` Ralph W. Reid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).