[sclug] Local rc file on Debian

Roland Turner SCLUG raz.fpyht.bet.hx at raz.cx
Wed Jul 13 07:56:34 UTC 2005


David Given wrote:


> I have a non-standard extended keyboard; it's got six extra
> buttons on it (marked 1 to 5 and WWW). I like to use one to
> play/pause XMMS, and so have it mapped to Pause under X.
>
> Unfortunately, down at the kernel level, the key does not
> generate a keycode that the kernel understands, so I have to
> use setkeycodes to map it to key 119 every time I boot.
>
> Where's the right place to put this command?


Work your way through the boot process and find where the setting of
keyboard maps keeps its configuration. Typically keyboard maps change very
slowly, so a local change will not, ordinarily, conflict during upgrades.
A conflict only arises during upgrade if you change a config file that the
package maintainer has also changed.


If you're hell-bent on using a boot time RC, then:


# cp /etc/init.d/skeleton /etc/init.d/local-keymap
# vi /etc/init.d/local-keymap
# update-rc.d local-keymap defaults
# invoke-rc.d local-keymap start


Check carefully the sequencing of the resulting contents of /etc/rc2.d;
there is a risk that /etc/rc2.d/*local-keymap will actually get run before
whatever is already there to load, say, a UK keymap and therefore have no
effect. If this is the case, you'll need to re-run update-rc.d with
different arguments to do your stuff later in the boot sequence; check the
man page.


> Normally I'd put it in rc.local, but I can't find one under
> Debian --- and all the files in init.d seem to be under control
> of debconf, which means that if I modify them, I run into grief
> later when debconf needs to upgrade something.


As above, don't modify an existing script, add a new one.


> Any ideas? And where is this kind of thing *documented*?


You've read/skimmed stuff at http://www.debian.org/doc/ and notably
http://www.debian.org/doc/debian-policy/ch-opersys.html, right?


- Raz




More information about the Sclug mailing list