Skip to contentSkip to conversation

Configurable Magic Sysrq

PATCH In review Jan Kara 10 participants 20 messages Oct 29, 2004 – Nov 1, 2004

Subsystems (5)
lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 Configurable Magic Sysrq

Hello,

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides. So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Thanks in advance for comments, bugreports
Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs

Enable configuration of sysrq functions via /proc/sys/kernel/sysrq.

Documentation/sysrq.txt +20 -6
diff -ru linux-2.6.9/Documentation/sysrq.txt linux-2.6.9-sysrq/Documentation/sysrq.txt
@@ -10,13 +10,27 @@
 *  How do I enable the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
-configuring the kernel. When running on a kernel with SysRq compiled in, it
-may be DISABLED at run-time using following command:
+configuring the kernel. When running a kernel with SysRq compiled in,
+/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
+the SysRq key. By default the file contains 1 which means that every
+possible SysRq request is allowed (in older versions SysRq was disabled
+by default, and you were required to specifically enable it at run-time
+but this is not the case any more). Here is the list of possible values
+in /proc/sys/kernel/sysrq:
+   0 - disable sysrq completely
+   1 - enable all functions of sysrq
+  >1 - bitmask of allowed sysrq functions (see below for detailed function
+       description):
+          2 - enable control of console logging level
+          4 - enable control of keyboard (SAK, unraw)
+          8 - enable debugging dumps of processes etc.
+         16 - enable sync command
+         32 - enable remount read-only
+         64 - enable signalling of processes (term, kill)
+        128 - allow reboot
 
-        echo "0" > /proc/sys/kernel/sysrq
-
-Note that previous versions disabled sysrq by default, and you were required
-to specifically enable it at run-time. That is not the case any longer.
+You can set the value in the file by the following command:
+    echo "number" >/proc/sys/kernel/sysrq
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/char/sysrq.c +27 -3
diff -ru linux-2.6.9/drivers/char/sysrq.c linux-2.6.9-sysrq/drivers/char/sysrq.c
@@ -38,6 +38,15 @@
 
 extern void reset_vc(unsigned int);
 
+/* 0x0001 is reserved for enable everything */
+#define SYSRQ_ENABLE_LOG	0x0002
+#define SYSRQ_ENABLE_KEYBOARD	0x0004
+#define SYSRQ_ENABLE_DUMP	0x0008
+#define SYSRQ_ENABLE_SYNC	0x0010
+#define SYSRQ_ENABLE_REMOUNT	0x0020
+#define SYSRQ_ENABLE_SIGNAL	0x0040
+#define SYSRQ_ENABLE_BOOT	0x0080
+
 /* Whether we react on sysrq keys or just ignore them */
 int sysrq_enabled = 1;
 
@@ -58,6 +67,7 @@
 	.handler	= sysrq_handle_loglevel,
 	.help_msg	= "loglevel0-8",
 	.action_msg	= "Changing Loglevel",
+	.enable_mask	= SYSRQ_ENABLE_LOG,
 };
 
 
@@ -74,6 +84,7 @@
 	.handler	= sysrq_handle_SAK,
 	.help_msg	= "saK",
 	.action_msg	= "SAK",
+	.enable_mask	= SYSRQ_ENABLE_KEYBOARD,
 };
 #endif
 
@@ -91,6 +102,7 @@
 	.handler	= sysrq_handle_unraw,
 	.help_msg	= "unRaw",
 	.action_msg	= "Keyboard mode set to XLATE",
+	.enable_mask	= SYSRQ_ENABLE_KEYBOARD,
 };
 #endif /* CONFIG_VT */
 
@@ -105,6 +117,7 @@
 	.handler	= sysrq_handle_reboot,
 	.help_msg	= "reBoot",
 	.action_msg	= "Resetting",
+	.enable_mask	= SYSRQ_ENABLE_BOOT,
 };
 
 static void sysrq_handle_sync(int key, struct pt_regs *pt_regs,
@@ -117,6 +130,7 @@
 	.handler	= sysrq_handle_sync,
 	.help_msg	= "Sync",
 	.action_msg	= "Emergency Sync",
+	.enable_mask	= SYSRQ_ENABLE_SYNC,
 };
 
 static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs,
@@ -129,6 +143,7 @@
 	.handler	= sysrq_handle_mountro,
 	.help_msg	= "Unmount",
 	.action_msg	= "Emergency Remount R/O",
+	.enable_mask	= SYSRQ_ENABLE_REMOUNT,
 };
 
 /* END SYNC SYSRQ HANDLERS BLOCK */
@@ -146,6 +161,7 @@
 	.handler	= sysrq_handle_showregs,
 	.help_msg	= "showPc",
 	.action_msg	= "Show Regs",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
 
 
@@ -158,6 +174,7 @@
 	.handler	= sysrq_handle_showstate,
 	.help_msg	= "showTasks",
 	.action_msg	= "Show State",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
 
 
@@ -170,6 +187,7 @@
 	.handler	= sysrq_handle_showmem,
 	.help_msg	= "showMem",
 	.action_msg	= "Show Memory",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
 
 /* SHOW SYSRQ HANDLERS BLOCK */
@@ -200,6 +218,7 @@
 	.handler	= sysrq_handle_term,
 	.help_msg	= "tErm",
 	.action_msg	= "Terminate All Tasks",
+	.enable_mask	= SYSRQ_ENABLE_SIGNAL,
 };
 
 static void sysrq_handle_kill(int key, struct pt_regs *pt_regs,
@@ -212,6 +231,7 @@
 	.handler	= sysrq_handle_kill,
 	.help_msg	= "kIll",
 	.action_msg	= "Kill All Tasks",
+	.enable_mask	= SYSRQ_ENABLE_SIGNAL,
 };
 
 /* END SIGNAL SYSRQ HANDLERS BLOCK */
@@ -331,9 +351,13 @@
 
         op_p = __sysrq_get_key_op(key);
         if (op_p) {
-		printk ("%s\n", op_p->action_msg);
-		console_loglevel = orig_log_level;
-		op_p->handler(key, pt_regs, tty);
+		if (sysrq_enabled == 1 || sysrq_enabled & op_p->enable_mask) {
+			printk ("%s\n", op_p->action_msg);
+			console_loglevel = orig_log_level;
+			op_p->handler(key, pt_regs, tty);
+		}
+		else
+			printk("This sysrq operation is disabled.\n");
 	} else {
 		printk("HELP : ");
 		/* Only print the help msg once per handler */
include/linux/sysrq.h +1 -0
diff -ru linux-2.6.9/include/linux/sysrq.h linux-2.6.9-sysrq/include/linux/sysrq.h
@@ -20,6 +20,7 @@
 	void (*handler)(int, struct pt_regs *, struct tty_struct *);
 	char *help_msg;
 	char *action_msg;
+	int enable_mask;
 };
 
 #ifdef CONFIG_MAGIC_SYSRQ
#1 lore raw
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Quoted 4 lines

So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Patch looks reasonable - we just need to decide whether the requirement warrants its inclusion.

There have been a few changes in the sysrq code since 2.6.9 and there are more changes queued up in -mm. The patch applies OK, but it'll need checking and redoing. There's a new `sysrq-f' command in the pipeline which causes a manual oom-killer call.

author
#2 lore raw
Quoted 7 lines
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

For example in a computer lab at the university the admin don't want
to allow users to Umount/Kill (mainly to make it harder for users to screw up the computer) but wants to allow SAK/Unraw.
Another (actually not so legitimate ;) example is that in e.g. SUSE
kernels sysrq is turned off by default (some people are afraid that it could be a security issue) so most users have it turned off and hence when the computer deadlocks, there's no debugging output. When you could allow only debugging outputs then the fear about security would be much smaller.
So in general it's mainly to make life a bit easier to
admins/developpers...

Quoted 5 lines
Quoted 4 lines

So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Quoted 7 lines

Patch looks reasonable - we just need to decide whether the requirement warrants its inclusion.

There have been a few changes in the sysrq code since 2.6.9 and there are more changes queued up in -mm. The patch applies OK, but it'll need checking and redoing. There's a new `sysrq-f' command in the pipeline which causes a manual oom-killer call.

OK, I'll rediff it againts latest -mm if we agree that inclusion
would be useful.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#3 lore raw
Quoted 8 lines · Jan Kara
Quoted 8 lines
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Quoted 7 lines

For example in a computer lab at the university the admin don't want
to allow users to Umount/Kill (mainly to make it harder for users to screw up the computer) but wants to allow SAK/Unraw.
Another (actually not so legitimate ;) example is that in e.g. SUSE
kernels sysrq is turned off by default (some people are afraid that it could be a security issue) so most users have it turned off and hence when the computer deadlocks, there's no debugging output.

OK, fair enough. I'll merge the patch if you talk suse into enabling sysrq-T and sysrq-P and sysrq-M by default ;)

#4 lore raw
Quoted 2 lines · Andrew Morton

OK, fair enough. I'll merge the patch if you talk suse into enabling sysrq-T and sysrq-P and sysrq-M by default ;)

you already have those available if /proc/sys/kernel/sysrq is 0.

alt-scrolllock / ctrl-scrolllock / shift-scrolllock.

Dave

#5 lore raw
Quoted 7 lines · Dave Jones
Quoted 2 lines · Andrew Morton

OK, fair enough. I'll merge the patch if you talk suse into enabling sysrq-T and sysrq-P and sysrq-M by default ;)

you already have those available if /proc/sys/kernel/sysrq is 0.

alt-scrolllock / ctrl-scrolllock / shift-scrolllock.

How do I trigger that via serial/hvc?

Signature · 3 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG
author
#6 lore raw
In reply to Dave Jones
Quoted 7 lines · Andrew Morton
Quoted 2 lines

OK, fair enough. I'll merge the patch if you talk suse into enabling sysrq-T and sysrq-P and sysrq-M by default ;)

you already have those available if /proc/sys/kernel/sysrq is 0.

alt-scrolllock / ctrl-scrolllock / shift-scrolllock.

I admit I didn't know that but I also just found out that there's no
scrolllock on my notebook keyboard... But anyway thanks for info.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#7 lore raw
In reply to Jan Kara

Hi!

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

For example in a computer lab at the university the admin don't want
to allow users to Umount/Kill (mainly to make it harder for users to screw up the computer) but wants to allow SAK/Unraw.

In that particular computer lab, admin is *****, and paranoid one, too. He's more worried about security that functionality, and then you find suid bash in /tmp and learn that root password is name of the laboratory, with first character uppercased. Heh.

BTW interesting things can be done with sak alone. (It is bye-bye vlock -a, right?). Changing console log-level and info-prints could lead to user seeing some info he's not allowed to see [perhaps part of some password are in the registers because they are now memcopied?], but I agree allowing that is probably okay.

Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#8 lore raw
In reply to Andrew Morton
Quoted 13 lines · Andrew Morton
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Quoted 4 lines

So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Quoted 7 lines

Patch looks reasonable - we just need to decide whether the requirement warrants its inclusion.

There have been a few changes in the sysrq code since 2.6.9 and there are more changes queued up in -mm. The patch applies OK, but it'll need checking and redoing. There's a new `sysrq-f' command in the pipeline which causes a manual oom-killer call.

See also the patch I just posted to lkml.

I also thought of an improved way of selecting keys to enable. Instead of an arbitrary bitmask, would it be possible to simply list the keys you want to enable, such as "echo sku > /proc/sys/kernel/sysrq"?

Signature · 2 lines
Måns Rullgård
[email protected]
author
#9 lore raw
Quoted 18 lines
Quoted 16 lines · Andrew Morton
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Quoted 4 lines

So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Patch looks reasonable - we just need to decide whether the requirement warrants its inclusion.

Quoted 6 lines
Quoted 4 lines

There have been a few changes in the sysrq code since 2.6.9 and there are more changes queued up in -mm. The patch applies OK, but it'll need checking and redoing. There's a new `sysrq-f' command in the pipeline which causes a manual oom-killer call.

See also the patch I just posted to lkml.

OK, Andrew, are you accepting the patch? The sysrq should probably go
into SYSRQ_ENABLE_SIGNAL group...

Quoted 3 lines

I also thought of an improved way of selecting keys to enable. Instead of an arbitrary bitmask, would it be possible to simply list the keys you want to enable, such as "echo sku > /proc/sys/kernel/sysrq"?

That would be possible of course but you'd have to do your own parsing
in kernel and you are not supposed to change the sysrq setting often - usually just compute your favourite number, put it into boot scripts and you're done. So I'm not convinced it's useful very much. The attached patch is against 2.6.10-rc1-mm1 (I also added poweroff to SYSRQ_ENABLE_BOOT group of functions).

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs

Implement enabling of specific sysrq functions.

Documentation/sysrq.txt +21 -6
diff -ru linux-2.6.10-rc1-mm1/Documentation/sysrq.txt linux-2.6.10-rc1-mm1-sysrq/Documentation/sysrq.txt
@@ -10,13 +10,28 @@
 *  How do I enable the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
-configuring the kernel. When running on a kernel with SysRq compiled in, it
-may be DISABLED at run-time using following command:
+configuring the kernel. When running a kernel with SysRq compiled in,
+/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
+the SysRq key. By default the file contains 1 which means that every
+possible SysRq request is allowed (in older versions SysRq was disabled
+by default, and you were required to specifically enable it at run-time
+but this is not the case any more). Here is the list of possible values
+in /proc/sys/kernel/sysrq:
+   0 - disable sysrq completely
+   1 - enable all functions of sysrq
+  >1 - bitmask of allowed sysrq functions (see below for detailed function
+       description):
+          2 - enable control of console logging level
+          4 - enable control of keyboard (SAK, unraw)
+          8 - enable debugging dumps of processes etc.
+         16 - enable sync command
+         32 - enable remount read-only
+         64 - enable signalling of processes (term, kill, oom-kill)
+        128 - allow reboot/poweroff
+        256 - allow entering KGDB via sysrq
 
-        echo "0" > /proc/sys/kernel/sysrq
-
-Note that previous versions disabled sysrq by default, and you were required
-to specifically enable it at run-time. That is not the case any longer.
+You can set the value in the file by the following command:
+    echo "number" >/proc/sys/kernel/sysrq
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/char/sysrq.c +29 -12

137 lines not on this page · raw message

include/linux/sysrq.h +12 -0
diff -ru linux-2.6.10-rc1-mm1/include/linux/sysrq.h linux-2.6.10-rc1-mm1-sysrq/include/linux/sysrq.h
@@ -16,10 +16,22 @@
 struct pt_regs;
 struct tty_struct;
 
+/* Possible values of bitmask for enabling sysrq functions */
+/* 0x0001 is reserved for enable everything */
+#define SYSRQ_ENABLE_LOG	0x0002
+#define SYSRQ_ENABLE_KEYBOARD	0x0004
+#define SYSRQ_ENABLE_DUMP	0x0008
+#define SYSRQ_ENABLE_SYNC	0x0010
+#define SYSRQ_ENABLE_REMOUNT	0x0020
+#define SYSRQ_ENABLE_SIGNAL	0x0040
+#define SYSRQ_ENABLE_BOOT	0x0080
+#define SYSRQ_ENABLE_BREAKPOINT	0x0100
+
 struct sysrq_key_op {
 	void (*handler)(int, struct pt_regs *, struct tty_struct *);
 	char *help_msg;
 	char *action_msg;
+	int enable_mask;
 };
 
 #ifdef CONFIG_MAGIC_SYSRQ
kernel/power/poweroff.c +2 -1
diff -ru linux-2.6.10-rc1-mm1/kernel/power/poweroff.c linux-2.6.10-rc1-mm1-sysrq/kernel/power/poweroff.c
@@ -32,7 +32,8 @@
 static struct sysrq_key_op	sysrq_poweroff_op = {
 	.handler        = handle_poweroff,
 	.help_msg       = "powerOff",
-	.action_msg     = "Power Off\n"
+	.action_msg     = "Power Off\n",
+	.enable_mask	= SYSRQ_ENABLE_BOOT,
 };
 
 static int pm_sysrq_init(void)
#10 lore raw
Quoted 18 lines · Jan Kara
Quoted 18 lines
Quoted 16 lines · Andrew Morton
Quoted 3 lines · Jan Kara

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Quoted 4 lines

So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Patch looks reasonable - we just need to decide whether the requirement warrants its inclusion.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

There have been a few changes in the sysrq code since 2.6.9 and there are more changes queued up in -mm. The patch applies OK, but it'll need checking and redoing. There's a new `sysrq-f' command in the pipeline which causes a manual oom-killer call.

See also the patch I just posted to lkml.

OK, Andrew, are you accepting the patch? The sysrq should probably go
into SYSRQ_ENABLE_SIGNAL group...

Don't miss the update I posted a few minutes later.

Quoted 8 lines
Quoted 3 lines

I also thought of an improved way of selecting keys to enable. Instead of an arbitrary bitmask, would it be possible to simply list the keys you want to enable, such as "echo sku > /proc/sys/kernel/sysrq"?

That would be possible of course but you'd have to do your own
parsing in kernel and you are not supposed to change the sysrq setting often - usually just compute your favourite number, put it into boot scripts and you're done. So I'm not convinced it's useful very much.

I'm not likely to use either of them, so I'll leave it to you.

Signature · 2 lines
Måns Rullgård
[email protected]
#11 lore raw
In reply to Jan Kara
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Like me, I only need sysrq's S, U, B and sometimes K ;-)
How much space does it take anyway for the other sysrqs?
If it's below 8K (arbitrarily chosen limit) then I can live with "all sysrqs" being in.

Jan Engelhardt

Signature · 2 lines
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
author
#12 lore raw
Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides.

That's a new one. Can you tell us more about why people want to do such a thing?

Like me, I only need sysrq's S, U, B and sometimes K ;-)
How much space does it take anyway for the other sysrqs?
If it's below 8K (arbitrarily chosen limit) then I can live with "all sysrqs" being in.

It's not about the kernel size but about allowing user to invoke just
some functions and not the other (see my other mail).

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#13 lore raw
Quoted 3 lines

It's not about the kernel size but about allowing user to invoke just
some functions and not the other (see my other mail).

That's like giving a user m$ windows without the ctrl+alt+del functionality, if you omit considering that either os has a different level of stability.

But I like the idea. Maybe a bitmask which can be set via /proc/sys/.../xxx?

Jan Engelhardt

Signature · 2 lines
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
author
#14 lore raw
Quoted 6 lines
Quoted 3 lines

It's not about the kernel size but about allowing user to invoke just
some functions and not the other (see my other mail).

That's like giving a user m$ windows without the ctrl+alt+del functionality, if you omit considering that either os has a different level of stability.

Yes. Some of the sysrq are considered insecure - for example OOM
kill, which was added lately, can be used to kill some process and I could imagine security implications from cleverly killing syslogd (or some other important process) by it. OTOH some other functionalities are useful and safe...

Quoted 1 line

But I like the idea. Maybe a bitmask which can be set via /proc/sys/.../xxx?

And that is exactly what the patch does ;).

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#15 lore raw
In reply to Jan Kara

Hi!

Quoted 6 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides. So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Actually, there's one more thing that wories me... Original choice of PC hotkey (alt-sysrq-key) works *very* badly on many laptop keyboards. Like sysrq is only recognized with fn, but key is not recognized when you hold fn => you have no chance to use magic sysrq.

Perphaps sysrq could be made prefix notation? Like alt-sysrq, release, press s is sync?
Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#16 lore raw
Quoted 9 lines · Pavel Machek

Hi!

Quoted 6 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides. So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Quoted 5 lines

Actually, there's one more thing that wories me... Original choice of PC hotkey (alt-sysrq-key) works *very* badly on many laptop keyboards. Like sysrq is only recognized with fn, but key is not recognized when you hold fn => you have no chance to use magic sysrq.

Actually if I understand it correctly it is Alt-PrtScrn-key - just let go of your "Fn" key and I think it will work fine. At least it does on my laptop.

Signature · 1 line
Dmitry
#17 lore raw

Hi!

Quoted 13 lines
Quoted 7 lines
Quoted 6 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides. So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Quoted 5 lines

Actually, there's one more thing that wories me... Original choice of PC hotkey (alt-sysrq-key) works *very* badly on many laptop keyboards. Like sysrq is only recognized with fn, but key is not recognized when you hold fn => you have no chance to use magic sysrq.

Quoted 3 lines

Actually if I understand it correctly it is Alt-PrtScrn-key - just let go of your "Fn" key and I think it will work fine. At least it does on my laptop.

Okay, it looks like I can actually type it on all notebooks here if I try hard enough. On HP machines, the trick is alt,fn,sysrq,releasealtandfn,key. Ouch.

The thing that confused me was some SuSE script redirecting messages to other tty, so I saw nothing after magic-9, and assumed I did not press it correctly.
Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#18 lore raw
In reply to Pavel Machek
Quoted 4 lines · Pavel Machek

Actually, there's one more thing that wories me... Original choice of PC hotkey (alt-sysrq-key) works *very* badly on many laptop keyboards. Like sysrq is only recognized with fn, but key is not recognized when you hold fn => you have no chance to use magic sysrq.

Doesn't it work to release fn (without releasing sysrq) before typing key?

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#19 lore raw
In reply to Pavel Machek

Pavel Machek <[email protected]> said on Sun, 31 Oct 2004 19:52:22 +0100:

Quoted 9 lines

Hi!

Quoted 6 lines

I know about a few people who would like to use some functionality of
the Magic Sysrq but don't want to enable all the functions it provides. So I wrote a patch which should allow them to do so. It allows to configure available functions of Sysrq via /proc/sys/kernel/sysrq (the interface is backward compatible). If you think it's useful then use it :) Andrew, do you think it can go into mainline or it's just an overdesign?

Quoted 7 lines

Actually, there's one more thing that wories me... Original choice of PC hotkey (alt-sysrq-key) works *very* badly on many laptop keyboards. Like sysrq is only recognized with fn, but key is not recognized when you hold fn => you have no chance to use magic sysrq.

Perphaps sysrq could be made prefix notation? Like alt-sysrq, release, press s is sync?

It seems to already do that for me.

What I do have, is some bizzaaro hardware that gives some weird escape keycode for alt-sysreq, so alt-sysreq s,u,b doesn't work. Could be the fact that it is a PS2 keyboard plugged into an old AT style connector, or something else, but I don't know where to start looking to fix it. It's a relatively recent and relatively clean debian install, and I don't know what I did wrong - I noticed this behaviour pretty much from the start.

Maybe I'm asking for not just alt to be the prefix, maybe give the choice of ctrl, etc. But I have a feeling ctrl is kinda funky on the console of this machine as well.

Signature · 3 lines
TimC -- http://astronomy.swin.edu.au/staff/tconnors/
ALU n. Arthritic Logic Unit, or (rare) Arithmetic Logic Unit. A random
number generator supplied as standard with all computer systems. --unk