From: kernelmail.jms@gmail.com (julie Sullivan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Getting the magic Sysrq key to work (on Ubuntu)
Date: Wed, 29 Dec 2010 22:16:56 +0000 [thread overview]
Message-ID: <AANLkTimttCD4peJSDnE3FdYKVkzyHOqOH=YctmBug0Jx@mail.gmail.com> (raw)
Hi all,
I've been having fun today trying to get the Magic Sysrq key to work on my
Ubuntu 10.04
system (most recent kernel .config was for 2.6.37-rc7). I noticed it wasn't
working by
accident when I tried to use it (which presumably means I haven't used it
since I was
using Gentoo - ouch, a while ago.)
This is probably not strictly a kernel issue - I apologise if you think it
doesn't
belong here, but I thought I'd share my adventure with the list in case
anyone else had
this problem and looks for help here.
I always build the Sysrq into the kernel so I went back to check that my
.config was
right - sure enough, CONFIG_MAGIC_SYSRQ was set to "y".
Documentation/sysrq.txt states:
*'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).'*
Hmm, not on my machine:
*julie at zeus:/proc/sys/kernel$ cat sysrq
0*
After a considerable amount of faffing about and searching I managed to find
the solution,
which is to find the sysctl.conf file (*/etc/sysctl.conf*) and add the
following line:
*kernel.sysrq = 1*
The system now boots with the Magic Sysrq key enabled by default.
Note that trying to sudo echo a value into /proc/sys/kernel/sysrq doesn't
work:
*julie at zeus:/proc/sys/kernel$ cat sysrq
0
julie at zeus:/proc/sys/kernel$ sudo echo "1" > sysrq
bash: sysrq: Permission denied
julie at zeus:/proc/sys/kernel$ ls -l sysrq
-rw-r--r-- 1 root root 0 2010-12-29 19:37 sysrq
*
Instead, I have to explicitly log in as root:
*julie at zeus:/proc/sys/kernel$ cat sysrq
0
julie at zeus:/proc/sys/kernel$ su
Password:
root at zeus:/proc/sys/kernel# echo "1" > sysrq
root at zeus:/proc/sys/kernel# exit
exit
julie at zeus:/proc/sys/kernel$ cat sysrq
1*
or sudo a shell:
*julie at zeus:/proc/sys/kernel$ sudo bash
[sudo] password for julie:
root at zeus:/proc/sys/kernel# echo "1" > sysrq
root at zeus:/proc/sys/kernel# exit
exit
julie at zeus:/proc/sys/kernel$ cat sysrq
1*
Which I presume might be counter-intuitive for some Ubuntu users, as AFAICR
they're not encouraged to create an explicit root account but are expected
to sudo
everything instead - in other words they're likely to simply tag 'sudo' in
front of
any CL operation that would normally be root-only and expect it to work.
.............................................
I don't know enough about things that are outside the kernel tree to know
whether
the /proc/sysrq configuration default is a distro thing or whether it's
resulted
from the recent kernel discussions about restricting access for security
reasons to
files/settings exposed by /proc. Does anyone know this or might anyone point
me to
the corresponding discussion?
Thanks
Julie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101229/1722ff4f/attachment.html
next reply other threads:[~2010-12-29 22:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-29 22:16 julie Sullivan [this message]
2010-12-30 0:49 ` Getting the magic Sysrq key to work (on Ubuntu) edacval at gmail.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTimttCD4peJSDnE3FdYKVkzyHOqOH=YctmBug0Jx@mail.gmail.com' \
--to=kernelmail.jms@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).