Making a machine beep at completed boot.
Hi all! I have this "black boxed" computer without monitor or keyboard. Is there a short and nice way to make the system beep a certain soound at completed boot so i can tell when the system is up and running...? Thought of making a little script to load, but dont know how and when to execute it. A init.d entry? -- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
On Tuesday 14 September 2004 01:51, Rikard Johnels wrote:
Hi all! I have this "black boxed" computer without monitor or keyboard. Is there a short and nice way to make the system beep a certain soound at completed boot so i can tell when the system is up and running...?
Thought of making a little script to load, but dont know how and when to execute it. A init.d entry?
Here's one option: hack /etc/init.d/splash_late _after_making_a_copy_, and put a few beeps in it. Here's a diff: ----8<----[splash_late.diff]----8<---- --- splash_late.orig 2004-04-06 03:50:22.000000000 +0200 +++ splash_late 2004-09-14 14:20:51.831725571 +0200 @@ -14,6 +14,31 @@ # Description: starts animation before shutdown ### END INIT INFO +function burp() +{ + # From /etc/init.d/halt: + sleep 1 + case "$1" in + "yes"|"quint") + echo -en "\033[10;262]\a\033[10;393]" + sleep 1 + ;; + "octave") + for tone in 262 295 328 349 393 440 491 ; do + echo -en "\033[10;${tone}]\a" + usleep 125000 + done + echo -en "\033[10;524]" + ;; + *) + echo -en "\033[10;440]\a" + usleep 250000 + ;; + esac + + echo -en "\a" +} + . /etc/rc.status # First reset status of this service @@ -24,7 +49,10 @@ test ${RUNLEVEL} != S && \ test ${RUNLEVEL} -eq 0 -o ${RUNLEVEL} -eq 6 && rc_splash "shutdown" ;; - start|status|restart|reload) + start) + burp octave + ;; + status|restart|reload) # rc_status -v3 ;; ---->8---->8---->8---- apply the .diff as follows: cd /etc/init.d/ # backup original file cp splash_late /root # assuming the .diff is in /root/: patch -p0 < /root/splash_late.diff I've tried the modified splash_late script (the notes play), but I did not test it while starting up the machine. ;) Cheers, Leen
On Tuesday 14 September 2004 14.27, Leendert Meyer wrote:
On Tuesday 14 September 2004 01:51, Rikard Johnels wrote:
Hi all! I have this "black boxed" computer without monitor or keyboard. Is there a short and nice way to make the system beep a certain soound at completed boot so i can tell when the system is up and running...?
Thought of making a little script to load, but dont know how and when to execute it. A init.d entry?
Here's one option: hack /etc/init.d/splash_late _after_making_a_copy_, and put a few beeps in it. Here's a diff:
<cut a number of lines> But doesn't this imply a graphical bootup? Mine does a ordinary textbased boot. (Runlevel 3, no graphics at all) Is bootsplash really used then? What i want is something to squeek as the login prompt appears at the console for the first time so i know the bootprocess is finished and all services started and system is up and running, ready for use. -- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
On Wed, Sep 15, 2004 at 05:10:09PM +0200, Rikard Johnels wrote:
But doesn't this imply a graphical bootup? Mine does a ordinary textbased boot. (Runlevel 3, no graphics at all)
Is bootsplash really used then?
What i want is something to squeek as the login prompt appears at the console for the first time so i know the bootprocess is finished and all services started and system is up and running, ready for use.
Some options (which may or may not work...) Put a ^G in /etc/issue (man issue)? Modify /etc/inittab to create a beep before running 'login'? Add an rc script to /etc/rc.d which is for a 'process' starting in runlevel 3, and is the last one executed? Options 2 and 3 might find 'beep' useful. I'm not sure whether it's on the SuSE disks, but if not, it's pretty easy to find (Sourceforge/Freshmeat IIRC). HTH... -- David Smith Work Email: Dave.Smith@st.com STMicroelectronics Home Email: David.Smith@ds-electronics.co.uk Bristol, England GPG Key: 0xF13192F2
On Wednesday 15 September 2004 17:10, Rikard Johnels wrote:
On Tuesday 14 September 2004 14.27, Leendert Meyer wrote:
On Tuesday 14 September 2004 01:51, Rikard Johnels wrote:
Hi all! I have this "black boxed" computer without monitor or keyboard. Is there a short and nice way to make the system beep a certain soound at completed boot so i can tell when the system is up and running...?
Thought of making a little script to load, but dont know how and when to execute it. A init.d entry?
Here's one option: hack /etc/init.d/splash_late _after_making_a_copy_, and put a few beeps in it. Here's a diff:
<cut a number of lines>
But doesn't this imply a graphical bootup?
Hah, yes. :} But my advice was not that bad. A different script follows further on that is independent of splash_late. I think it is small enough to be included in this mail.
Mine does a ordinary textbased boot. (Runlevel 3, no graphics at all)
Is bootsplash really used then?
Bootsplash is unrelated to X! If you get a graphical boot, then bootsplash is used.
What i want is something to squeek as the login prompt appears at the console for the first time so i know the bootprocess is finished and all services started and system is up and running, ready for use.
Yes, I understood you well. ;) Here's a different version that beeps once when booting is finished: ----8<----[/etc/init.d/boot_ready]----8<---- #! /bin/sh # # /etc/init.d/boot_ready # # Copyright (c) 2000-2002 SuSE GmbH Nuernberg, Germany. All rights reserved. ### BEGIN INIT INFO # Provides: boot_ready # Required-Start: # X-UnitedLinux-Should-Start: $network $syslog apache inetd cron nscd splash_late # Required-Stop: # X-UnitedLinux-Should-Stop: $network $syslog apache inetd cron nscd splash_late # Default-Start: 2 3 5 # Default-Stop: 0 1 4 6 # Description: squeek if the booting process is finished ### END INIT INFO . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -e "\a" ;; stop|status|restart|reload) # rc_status -v3 ;; esac rc_exit ---->8---->8---->8---- Set the correct permissions after saving the file: chmod a=rx,u+w boot_ready After copying the file to /etc/init.d/boot_ready, insert it into the init.d system: insserv boot_ready It would not be difficult to put the 'burp'-routine from my previous mail into boot_ready, to get a nicer sound. Cheers, Leen
On Wednesday 15 September 2004 18.43, Leendert Meyer wrote: <cut lines>
Here's a different version that beeps once when booting is finished:
----8<----[/etc/init.d/boot_ready]----8<---- #! /bin/sh # # /etc/init.d/boot_ready # # Copyright (c) 2000-2002 SuSE GmbH Nuernberg, Germany. All rights reserved. ### BEGIN INIT INFO # Provides: boot_ready # Required-Start: # X-UnitedLinux-Should-Start: $network $syslog apache inetd cron nscd splash_late # Required-Stop: # X-UnitedLinux-Should-Stop: $network $syslog apache inetd cron nscd splash_late # Default-Start: 2 3 5 # Default-Stop: 0 1 4 6 # Description: squeek if the booting process is finished ### END INIT INFO
. /etc/rc.status
# First reset status of this service rc_reset
case "$1" in start) echo -e "\a" ;; stop|status|restart|reload) # rc_status -v3 ;;
esac rc_exit ---->8---->8---->8----
Set the correct permissions after saving the file:
chmod a=rx,u+w boot_ready
After copying the file to /etc/init.d/boot_ready, insert it into the init.d system:
insserv boot_ready
It would not be difficult to put the 'burp'-routine from my previous mail into boot_ready, to get a nicer sound.
Cheers,
Leen
Nice approach! Never thought of that... Thank you! Will start making new "beeps and blops" right away ;) Thank you! -- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
The 2004-09-16 at 01:33 +0200, Rikard Johnels wrote:
On Wednesday 15 September 2004 18.43, Leendert Meyer wrote: <cut lines>
Here's a different version that beeps once when booting is finished:
Nice approach! Never thought of that... Thank you! Will start making new "beeps and blops" right away ;)
Since SuSE 7.1 or earlier, I'm using a similar script. Here goes: #! /bin/sh # -x # # Author: Carlos E. Robinson, based on "skeleton" from Kurt Garloff <feedback> # # /etc/init.d/helloworld # # and symbolic its link # # /sbin/rchelloworld # # ### BEGIN INIT INFO # Provides: HelloWorld # Required-Start: $remote_fs $syslog $netdaemons $SuSEfirewall2_final # Required-Stop: $remote_fs $syslog $netdaemons # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Dice hola, estilo HAL9000 ### END INIT INFO # Debería correr el último. ¿como? # Source SuSE config . /etc/rc.config # Esta variable estaría en el config; así el yast puede controlar su ejecución START_HELLOWORLD=yes # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_HELLOWORLD=yes test "$START_HELLOWORLD" = yes || exit 0 . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -n "Am I alive?" cat /usr/share/sounds/au/hal9.au > /dev/audio & # Remember status and be verbose rc_status -v ;; stop) echo -n "No, please, Dave, don't do that!" rc_status -v ;; try-restart) $0 stop && $0 start rc_status ;; restart) $0 stop $0 start rc_status ;; force-reload) $0 stop && $0 start rc_status ;; reload) echo -n "I already said hello to you." rc_status -v # If it does not support reload: #exit 3 ;; status) $0 start #rc_status ;; probe) ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" exit 1 ;; esac rc_exit The sound file I use was included with suse 6.4 (and earlier) sample sound files, which were removed on later versions, I don't know why. I leave as an exercise to the reader to guess what it is ;-) P.S.: If you know that, then I would like the "Daisy" song for the stop part ;-) -- Cheers, Carlos Robinson
participants (4)
-
Carlos E. R.
-
David SMITH
-
Leendert Meyer
-
Rikard Johnels