Re: magic sysrq question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 9 Mar 2007 12:52:41 -0500 Mike Frysinger wrote:

> On 3/9/07, Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote:
> > If you want to only disable one sysrq key, that will require a
> > kernel patch and recompile.
> 
> sysrq doc implies different ... it says you can echo a bitmask to
> control some of the functions
> 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):

Oops.  Thanks for that.

OK, so to disable 'p', it's like this:

look up 'p' in the sysrq table:

	&sysrq_showregs_op,		/* p */

look at that data structure:

static struct sysrq_key_op sysrq_showregs_op = {
	.handler	= sysrq_handle_showregs,
	.help_msg	= "showPc",
	.action_msg	= "Show Regs",
	.enable_mask	= SYSRQ_ENABLE_DUMP,
};

OK, use SYSRQ_ENABLE_DUMP as the mask to enable or disable sysrq 'p'.


/* 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_RTNICE	0x0100


so echo 0xfff7 > /proc/sys/kernel/sysrq
to disable all DUMP commands (crashdump, p, t, w, m).

Does that sound correct?

Thanks again, Mike.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux