manipulating the system speaker
Does anyone know of a utility to manipulate the system speaker? I am building a pc that will be "storage only," a bunch of drives, headless, no gui, accessible only with ssh from my desktop computer or the main server. What I need is a utility I can put last in the boot sequence, so I know the thing is booted and I can login. Alternatively, is there a utility that will play a short .wav or .mpg from a startup script? -- Insanity is the final defense ... It's hard to get a refund when the salesman is sniffing your crotch and baying at the moon.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2005-10-30 at 23:17 -0700, Tim Hanson wrote:
Does anyone know of a utility to manipulate the system speaker? I am building a pc that will be "storage only," a bunch of drives, headless, no gui, accessible only with ssh from my desktop computer or the main server.
What I need is a utility I can put last in the boot sequence, so I know the thing is booted and I can login.
Unfortunately, in linux the speaker is associated with terminals. If a script has no terminal, it can not beep; for example, cron jobs. Time ago, I heard of a project to produce sound from the system speaker, but I didn't get around to test it; but I think that is what you need. [...] I just found a "beep" program that can beep from a cron job, but only as root (as user it gets a "Could not open /dev/console for writing" error). Ah, it is documented: What this means is that root can always make beep work (to the best of my knowledge!), and that any local user can make beep work, BUT a non-root remote user cannot use beep in it's natural state. What's worse, an xterm, or other x-session counts, as far as the kernel is concerned, as 'remote', so beep won't work from a non-priviledged xterm either. I had originally chalked this up to a bug, but there's actually nothing I can do about it, and it really is a Good Thing that the kernel does things this way. There is also a solution. (he recommends making it suid) I think I got it from freshmeat.net, beep-1.2.2.tar.gz... ah, I kept a note: http://www.johnath.com/beep/ http://archives.neohapsis.com/archives/linux/redhat/2002-q2/0002.html I just tried beeping with: echo -en "\a" > /dev/console that is quite simple, it seems to work. HTH. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDZnxutTMYHG2NR9URAjwPAJ4rlHVrcmqFeEqUnlR1nRsHL2cfHwCginrZ aaUENE8MWjeG1CT1o84LY04= =hnyz -----END PGP SIGNATURE-----
I just tried beeping with:
echo -en "\a" > /dev/console
that is quite simple, it seems to work.
Actually, that is the low-tech solution. About three of those at the end should do the trick. Thanks -- "That boy's about as sharp as a pound of wet liver" -- Foghorn Leghorn
On Mon, 2005-10-31 at 21:19 +0100, Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Sunday 2005-10-30 at 23:17 -0700, Tim Hanson wrote:
Does anyone know of a utility to manipulate the system speaker? I am building a pc that will be "storage only," a bunch of drives, headless, no gui, accessible only with ssh from my desktop computer or the main server.
What I need is a utility I can put last in the boot sequence, so I know the thing is booted and I can login.
Unfortunately, in linux the speaker is associated with terminals. If a script has no terminal, it can not beep; for example, cron jobs. Time ago, I heard of a project to produce sound from the system speaker, but I didn't get around to test it; but I think that is what you need.
[...]
I just found a "beep" program that can beep from a cron job, but only as root (as user it gets a "Could not open /dev/console for writing" error). Ah, it is documented:
What this means is that root can always make beep work (to the best of my knowledge!), and that any local user can make beep work, BUT a non-root remote user cannot use beep in it's natural state. What's worse, an xterm, or other x-session counts, as far as the kernel is concerned, as 'remote', so beep won't work from a non-priviledged xterm either. I had originally chalked this up to a bug, but there's actually nothing I can do about it, and it really is a Good Thing that the kernel does things this way. There is also a solution.
(he recommends making it suid)
I think I got it from freshmeat.net, beep-1.2.2.tar.gz... ah, I kept a note:
http://www.johnath.com/beep/ http://archives.neohapsis.com/archives/linux/redhat/2002-q2/0002.html
I just tried beeping with:
echo -en "\a" > /dev/console
that is quite simple, it seems to work.
echo -en "\a" > /dev/console bash: /dev/console: Permission denied You have new mail in /var/spool/mail/cwsiv
Seems to give me an error plus an unrelated message. I had downloaded email ten minutes before and hung up the phone line. -- _______ _______ _______ __ / ____\ \ / / ____|_ _\ \ / / | | \ \ /\ / / (___ | | \ \ / / | | \ \/ \/ / \___ \ | | \ \/ / | |____ \ /\ / ____) |_| |_ \ / \_____| \/ \/ |_____/|_____| \/ | \ /|\ || |\ / |~~\ /~~\ /~~| //~~\ | \ / | \ || | X |__/| || |( `--. |__ | | \| \_/ / \ | \ \__/ \__| \\__/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2005-11-02 at 19:31 -0800, Carl William Spitzer IV wrote:
bash: /dev/console: Permission denied You have new mail in /var/spool/mail/cwsiv
Seems to give me an error plus an unrelated message.
I already said how to solve that. Read again:
Ah, it is documented:
What this means is that root can always make beep work (to the best of my knowledge!), and that any local user can make beep work, BUT a non-root remote user cannot use beep in it's natural state. What's worse, an xterm, or other x-session counts, as far as the kernel is concerned, as 'remote', so beep won't work from a non-priviledged xterm either. I had originally chalked this up to a bug, but there's actually nothing I can do about it, and it really is a Good Thing that the kernel does things this way. There is also a solution.
(he recommends making it suid)
plus an unrelated message. I had downloaded email ten minutes before and hung up the phone line.
It is not exactly unrelated. Every time you time you press "enter" on a terminal, it checks to see if you have new _system_ mail. Remember that cron and other tasks can send you email. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDbNIztTMYHG2NR9URAg4PAJ0WS6/PWonPD8rJ8lHH/NwqrQLgWQCdHXLW sirZ8bUcAleMmKhlcKW9sos= =r4Km -----END PGP SIGNATURE-----
Tim Hanson wrote:
Does anyone know of a utility to manipulate the system speaker? I am building a pc that will be "storage only," a bunch of drives, headless, no gui, accessible only with ssh from my desktop computer or the main server.
What I need is a utility I can put last in the boot sequence, so I know the thing is booted and I can login.
Alternatively, is there a utility that will play a short .wav or .mpg from a startup script?
One thing that's easy to do, is send an e-mail message or a pop up message.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2005-11-01 at 19:02 -0500, James Knott wrote:
One thing that's easy to do, is send an e-mail message or a pop up message.
The server might be in a "cold" room, in a rack, where you have nowhere to read emails. Also, the email server might not be op (failed, perhaps). A customized beep is very handy :-) - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDaL+XtTMYHG2NR9URAn5wAJ0WPxak5zOYE0rTi0LyyufYQ7XFMgCeIqRq 9aUhvnixmFiCiP1n70vf8qw= =Ub5e -----END PGP SIGNATURE-----
participants (4)
-
Carl William Spitzer IV
-
Carlos E. R.
-
James Knott
-
Tim Hanson