View Single Post

   
  #1 (permalink)  
Old 01-17-2008, 07:23 AM
AAW
 
Posts: n/a
Default Re: NumLoc "ON" at startup

R@LF wrote:

> I am going in circles and cannot figure out how I can get my NumLoc on
> at startup. I use RH9 and XFree86 4.3.0-2
> I am not into kernel building ... there should be another simpler
> way(?) to do this.
>
> Rolf


Below is Mandrake's /etc/init.d/numlock. Double check file locations,
word wrap, etc., but it ought to be adaptable to Red Hat.

---------<CUT HERE>---------
#!/bin/sh
#
# Startup script for NumLock
#
# description: Locks NumLock key at init runlevel change
# chkconfig: 345 85 15

# Source function library.
.. /etc/rc.d/init.d/functions

# The following file make bash to relock the numlock key when
logging
# since login unlock it.
SYSCONF_FILE=/var/lock/subsys/numlock
#SYSCONF_FILE=/etc/sysconfig/numlock

# See how we were called.
case "$1" in
start)
gprintf "Starting numlock: "
echo_success
echo
touch $SYSCONF_FILE

for tty in /dev/tty[1-8]; do
setleds -D +num < $tty
done

;;
stop)
gprintf "Disabling numlocks on ttys: "
for tty in /dev/tty[1-8]; do
setleds -D -num < $tty
done
echo_success
echo
rm -f $SYSCONF_FILE
;;
status)
# status NumLock
# gprintf "dead status as reported is normal since NumLock doesn't
need to daemonize\n"
if [ -f $SYSCONF_FILE ]
then
gprintf "numlock is enabled\n"
else
gprintf "numlock is disabled\n"
fi
;;
restart)
$0 stop
$0 start
;;
reload)
gprintf "Reloading numlock: "
$0 start
echo
;;
*)
gprintf "Usage: %s {start|stop|restart|reload|status}\n" "$0"
exit 1
esac

exit 0
---------<CUT HERE>---------
Reply With Quote