Mailinglist Archive: opensuse (4570 mails)
| < Previous | Next > |
Re: [SLE] manipulating the system speaker
- From: Carl William Spitzer IV <cwsiv@xxxxxxxxxxxxx>
- Date: Thu, 3 Nov 2005 21:38:02 +0000 (UTC)
- Message-id: <1130988691.8953.13.camel@xxxxxxxxxx>
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 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 |__/| || |( `--.
|__ | | \| \_/ / \ | \ \__/ \__| \\__/
| < Previous | Next > |