Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28252 - /etc/init.d/numlock if more then 8 consoles
Summary: /etc/init.d/numlock if more then 8 consoles
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-09 04:47 UTC by CBke -Left- bye
Modified: 2003-10-13 17:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CBke -Left- bye 2003-09-09 04:47:22 UTC
when defining more tty's in /etc/inittab the /etc/init.d/numlock is "difficult" 
to change


Reproducible: Always
Steps to Reproduce:
1.add more tty's in /etc/inittab
2.killall -HUP init
3.souce /etc/init.d/numlock
4./etc/init.d/numlock restart




a beter way to do this is:

--- /etc/init.d/numlock 2003-09-04 13:15:34.000000000 +0200
+++ /etc/init.d/._cfg0000_numlock       2003-09-08 05:21:07.000000000 +0200
@@ -10,18 +10,18 @@
 
 start() {
        ebegin "Enabling numlock on ttys"
-       for tty in `seq 0 11`
+       for tty in /dev/tty[1-8]
        do
-               setleds -D +num < /dev/tty${tty} &>/dev/null
+               setleds -D +num < ${tty} &>/dev/null
        done
        eend $? "Failed to enable numlock"
 }
 
 stop() {
        ebegin "Disabling numlock on ttys"
-       for tty in `seq 0 11`
+       for tty in /dev/tty[1-8]
        do
-               setleds -D -num < /dev/tty${tty} &>/dev/null
+               setleds -D -num < ${tty} &>/dev/null
        done
        eend $? "Failed to disable numlock"
 }
Comment 1 CBke -Left- bye 2003-09-09 04:49:09 UTC
sorry it should be :

--- /etc/init.d/numlock 2003-09-04 13:15:34.000000000 +0200
+++ /etc/init.d/._cfg0000_numlock       2003-09-08 05:21:07.000000000 +0200
@@ -10,18 +10,18 @@
 
 start() {
        ebegin "Enabling numlock on ttys"
+       for tty in `seq 0 11`
-       for tty in /dev/tty[1-8]
        do
+               setleds -D +num < /dev/tty${tty} &>/dev/null
-               setleds -D +num < ${tty} &>/dev/null
        done
        eend $? "Failed to enable numlock"
 }
 
 stop() {
        ebegin "Disabling numlock on ttys"
+       for tty in `seq 0 11`
-       for tty in /dev/tty[1-8]
        do
+               setleds -D -num < /dev/tty${tty} &>/dev/null
-               setleds -D -num < ${tty} &>/dev/null
        done
        eend $? "Failed to disable numlock"
 }
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-13 14:51:26 UTC
Why set it for tty0 ?
Comment 3 CBke -Left- bye 2003-10-13 15:36:59 UTC
ignore the tty0 that is not the id behind the patch
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-13 17:02:30 UTC
Added to CVS.