LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-08-2008, 06:15 PM   #1
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
How to play an audio file on a failed login


Hey linux fans,

I know how to play an audio file or use festival to say a text message when there is a successful login. For example in my /etc/profile, I added this line at the bottom

echo welcome back $USER | festival --tts

So when I, david or root logs in, it play the audio
"welcome back david" or "welcome back root"

But, how do I do the opposite. If I enter the wrong password by mistake, I would like festival to say something as an example "get lost loser, try again" lol

If you know which file I need to edit or add to it, I greatly appreciate it.

Thanks
 
Old 08-08-2008, 06:56 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Are you doing a text or GUI login? If GUI, what desktop environment do you use?

I know GDM has the ability to play a sound file on failed login. I don't see a method for arbitrary command execution, but it would handle a common prerecorded sound. I haven't checked into login and I am not that familiar with KDE or other DEs.
 
Old 08-08-2008, 07:07 PM   #3
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Original Poster
Rep: Reputation: 57
text prompt.
 
Old 08-09-2008, 12:51 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I've poked around in login, getty and PAM and didn't see any hooks for doing what you want. I've wondered if somebody who knew quite a bit more about PAM than I do could come up with a way to do it via PAM. Other than that, you could modify login to do what you want rather than simply print "Login incorrect."

I've also thought about a real kludge that might work. That would be to change the entry in /etc/inittab for respawning getty (or mgetty or some such) to where it first called a script for playing the desired audio. You would want to put in place a mechanism where it wouldn't be triggered on the first time it was spawned and it wouldn't trigger after a successful login. And hope that it never respawned just because something burped. Also it would only play the message after the number of tries login allows.
 
Old 08-09-2008, 01:19 AM   #5
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Original Poster
Rep: Reputation: 57
It's OK, it's not that important. At least I can play or say a text message via festival after a successful login.

Thanks again blackhole54 for your replies.

Last edited by dv502; 08-09-2008 at 01:20 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Burnt Audio CD by K3B CANNOT play on external CD playing device, but can play on comp robin.com.au Linux - Software 14 05-27-2007 04:30 AM
Log file for failed login, where is it? alfredh SUSE / openSUSE 4 03-18-2006 01:57 PM
Play audio file on startup? SafeShowroom Linux - Software 2 02-24-2006 04:51 PM
mplayerplug-in - Firefox can't play more audio video file -- Please help me b:z Linux - Software 1 04-15-2005 06:04 AM
DVD plays but no audio (can play audio cd's though)? guitarnix Linux - Newbie 2 10-05-2003 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration