Tux

...making Linux just a little more fun!

adding key combination in inittab file

J.Bakshi [j.bakshi at icmail.net]


Sat, 1 Nov 2008 11:10:12 +0530

Hi list,

Hope you all are well.

I am trying to modify the /etc/inittab file to add more key combination. One of the reasons is to shut down the system. I have added this line in the inittab

~~~~~~~~~~~~~~~~~~~~~~~~~~~`
#shut down wit ctrl+alt+end
ce:12345:ctrlaltend:/sbin/halt
~~~~~~~~~~~~~~~~~~~~~~

but "init q" reports

	:ctrlaltend:   unknown action field

Could any one kindly point out my mistake ? I like to define some more key combination like ctrl+alt+< ; ctrl+alt+s etc to call commands. How can I define these key combination ?

Thanks


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Sat, 1 Nov 2008 13:46:12 +0530

Hello,

On Sat, 01 Nov 2008, J.Bakshi wrote:

> but "init q" reports
> 	
> 	:ctrlaltend:   unknown action field
> 
> Could any one kindly point out my mistake ? I like to define some more key 
> combination like ctrl+alt+< ; ctrl+alt+s   etc to call commands. How can I 
> define these key combination ?

The ctrl+alt+del key combination is specially handled by the console driver. In response to this key combination the kernel sends the signal SIGINT to process 1 (which is usually "init).

In addition to this, according to the man page of "inittab", the kernel also sends a signal (which signal?) to process 1 ("init") when it processes a key which is assigned to "KeyboardSignal". So you can use your keymap to define a key combination which works for that.

Regard,

Kapil. --


Top    Back


J.Bakshi [j.bakshi at icmail.net]


Sat, 1 Nov 2008 14:37:16 +0530

On Saturday 01 Nov 2008 1:46:12 pm Kapil Hari Paranjape wrote:

> Hello,
>
> On Sat, 01 Nov 2008, J.Bakshi wrote:
> > but "init q" reports
> >
> > 	:ctrlaltend:   unknown action field
> >
> > Could any one kindly point out my mistake ? I like to define some more
> > key combination like ctrl+alt+< ; ctrl+alt+s   etc to call commands. How
> > can I define these key combination ?
>
> The ctrl+alt+del key combination is specially handled by the console
> driver. In response to this key combination the kernel sends the signal
> SIGINT to process 1 (which is usually "init).
>
> In addition to this, according to the man page of "inittab", the
> kernel also sends a signal (which signal?) to process 1 ("init") when it
> processes a key which is assigned to "KeyboardSignal".  So you can use
> your keymap to define a key combination which works for that.

Hello Kapil,

Many thanks for the discussion. How can I get the information of keymap and how to define it in inittab ?

Thanks once again


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Sat, 1 Nov 2008 19:36:42 +0530

Hello,

On Sat, 01 Nov 2008, J.Bakshi wrote:

> On Saturday 01 Nov 2008 1:46:12 pm Kapil Hari Paranjape wrote:
> > In addition to this, according to the man page of "inittab",
> Many thanks for the discussion. How can I get the information of keymap and 
> how to define it in inittab ?

Have a look at "man inittab".

Kapil. --


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Sat, 1 Nov 2008 19:45:20 +0530

Hello,

I missed this part when I wrote my earlier reply.

On Sat, 01 Nov 2008, J.Bakshi wrote:

> I like to define some more key combination like ctrl+alt+< ;
> ctrl+alt+s etc to call commands.

I don't think it is a good idea to call all kinds of commands by getting the kernel to signal "init" to run them.

The "ctrlaltdel", "kbrequest" and alt+sysrq facilities are given for use in emergency situations where user-space applications will not suffice.

Emergency requirements are the only case when such facilities should be used. "Never use a diving tackle when you can tell a person to stop."

Kapil. --


Top    Back