[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Re: Login Prompt and Dialin Question



I have thought for some time now that the proper way to do sound
during login would be with a pam module, but I have not followed that
up with any action.  

What I can offer is an alternative to the rc.local suggestion.  This
is something I use on a debian linux system that has a soundblaster
card that I am the only local user of.  It is a wrapper to
/sbin/getty.  It has changed over time, but basicaly each time init
spawns getty it will now run the saytime program first.  So when the
machine is ready for a login it says the time.  ( You could play a
midi or wav file if you prefer. )

The saytime program is in the debian distribution.  This method has
the advantage over an rc script of repeating every time you logout.
So you know you have successfully logged out which can be nice.

I place this only on the second virtual terminal (alt-F2) I think it
would be too noisy to put it on each terminal.  I use the second
terminal for my general work, use the first for root sessions if
needed.  Just a habit I got in to a long time ago.

There are four steps to trying this solution:

Install saytime.
Create and install the getty wrapper (or use mine).
Modify the inittab entry for one of your terminals.
Tell the init process to reread inittab with the command telinit q.

I have included my getty wrapper and detail these steps below.

You will need to do these steps as root.

Step One: 
Install saytime.  Current version with the stable debian
release is 1.0-7.  It installs in /usr/bin.  Try it by typing the
command at a prompt when emaspeak is not running:

	saytime

You should hear "the time is 11 47 and 15 seconds"  or whatever time
it is when you try the command.

Step Two: 
Create and install the say.getty script.  Here is mine, feel free to
use it.  If you improve it or just modify it I would love to know what
you did.

#! /bin/sh
#
# say.getty
# 
# Greg Priest-Dorman 
#
#   $Revision: 1.7 $
#
# Lame wrapper to getty to say the time each time getty
# is respawned.  Uses "saytime" from the debian distribution. 
#
# I like the saytime command as it dies gracefully if /dev/audio is
# otherwise occupied.
#
# I background the saytime command so I do not have to wait for it to
# finish (or die) before I get to log in.  I find I can log in when
# saytime starts to tell me the number of seconds.
# 
trap - 2 3
#
/usr/bin/saytime &
/sbin/getty $*
#
# end


Place this script in /sbin (or /usr/local/sbin if that makes
you more comfortable), call it say.getty and give it the same
ownership and permisions as getty:

    chmod 755 /sbin/say.getty
    chown root.root /sbin/say.getty

Step Three:
Edit /etc/inittab, find the line that reads:

2:23:respawn:/sbin/getty 38400 tty2

replace with these 8 lines:

#
# Modified intentionaly to have system say the time
# when getty respawns on tty2
#
#2:23:respawn:/sbin/getty 38400 tty2 
2:23:respawn:/sbin/say.getty 38400 tty2
#

save it.

Yes, you could just repace the one line, but I like to keep the
original line and put in reminders as to why I make changes in system
files.  I find that it saves me time at 3am when I am trying to figure
out what is wrong with the system.

Step Four:
Tell init to reread inittab with the telinit command.  The
option "q" will do that:

       telinit q

The next time getty is respawned it will speak the time. 

Hope this helps,

Greg


>>>>> "Janina" == Janina Sajka <janina@xxxxxxxxxxx> writes:

Janina> You might want to play some .wav file from your rc.local
Janina> script. Of course, this will only play once at system boot up,
Janina> but it will play atJanina> the right time.



--
 Greg Priest-Dorman
 priestdo@xxxxxxxxxxx


-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe | Search