LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   missing file??? /proc/sys/kernel/sysrq (https://www.linuxquestions.org/questions/linux-general-1/missing-file-proc-sys-kernel-sysrq-474575/)

bad_gui 08-16-2006 08:02 PM

missing file??? /proc/sys/kernel/sysrq
 
I'm trying to get an error message from a total system freeze due to my
wireless card driver. It causes a total lockup - flashing caps and scroll lock. I need to submit the output of Magic SysRq but I don't seem to have
a file /proc/sys/kernel/sysrq so that I can use this feature.


~$ cat /proc/sys/kernel/sysrq
cat: /proc/sys/kernel/sysrq: No such file or directory

~$ ls /proc/sys/kernel
acct domainname osrelease real-root-dev shmmni
cad_pid hostname ostype rtsig-max tainted
cap-bound hotplug overflowgid rtsig-nr threads-max
core_pattern modprobe overflowuid sem version
core_setuid_ok msgmax panic sg-big-buff
core_uses_pid msgmnb printk shmall
ctrl-alt-del msgmni random/ shmmax



I configured my kernel 2.4.33-rc3 to enable MagicSysRq

from .config:


# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_HIGHMEM is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_IOVIRT is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_FRAME_POINTER is not set
CONFIG_LOG_BUF_SHIFT=0

What setting am I missing?

unSpawn 08-16-2006 08:47 PM

What setting am I missing?
As far as I can see none. Way stupid question but did you actually install and are you running that kernel? To make up for that stupid question, if you have /proc/sysrq-trigger but not sysrq, then maybe you could reconfigure the "ca::ctrlaltdel:" line in /etc/inittab to read "ca::ctrlaltdel:/bin/echo p > /proc/sysrq-trigger", which is the equivalent of doing alt+sysrq+p, then "telinit q" to have it reread inittab. I don't know though if it will work if your box is frozen but if it works using the keycombo ctrl+alt+del should now print the CPU registers.

bad_gui 08-17-2006 07:19 PM

Good to check everything.

~$ uname -a
Linux desktop 2.4.33-rc3 #1 Sat Jul 29 23:07:41 EDT 2006 i686 unknown

I don't have the file /proc/sysrq-trigger either

~$ ls /proc/
1/ 1689/ 1726/ 2/ cpuinfo iomem mounts@ sysvipc/
135/ 1690/ 1749/ 3/ crypto ioports mtrr tty/
1473/ 1692/ 1756/ 4/ devices irq/ net/ uptime
157/ 1693/ 1758/ 5/ dma kcore partitions version
1629/ 1703/ 1759/ 6/ driver/ kmsg pci
1633/ 1715/ 1760/ 7/ execdomains ksyms scsi/
1638/ 1716/ 1761/ 8/ fb loadavg self@
1643/ 1720/ 1778/ acpi/ filesystems locks slabinfo
1666/ 1722/ 1779/ asound/ fs/ meminfo stat
1687/ 1724/ 1828/ bus/ ide/ misc swaps
1688/ 1725/ 1841/ cmdline interrupts modules sys/



The goof that I discovered was that /usr/src/linux was a symlink to a previous kernel that
didn't have kernel debugging or MagicSysrq selected. But the new kernel build should have just
created the special file in /proc regardless, no?

I can recompile the kernel and cross my fingers but I'd like to do something to increase the
chance of success. I couln't find anything obvious in /usr/src/linux/kernel/sysctl.c to suggest that the kernel compilation creates the special file or whether the /proc entries
come from the distro (Vector 4.0)?

unSpawn 08-18-2006 03:31 AM

The goof that I discovered was that /usr/src/linux was a symlink to a previous kernel that didn't have kernel debugging or MagicSysrq selected. But the new kernel build should have just created the special file in /proc regardless, no?
If it's in the .config yes (which apparently it is not).


I can recompile the kernel and cross my fingers but I'd like to do something to increase the
chance of success.

Symlink to the right kernel source directory, load the right config and check the settings before you compile. There's nothing more to do AFAIK: sysrq has been in the kernel virtually unchanged for ages now so it's highly unlikely something is blocking it unless you have added kernel patches that could for instance unset CONFIG_DEBUG_KERNEL so CONFIG_MAGIC_SYSRQ gets unset as well.

bad_gui 08-18-2006 10:37 PM

It worked!
 
I recompiled the kernel after correcting the symlink error and now I have the correct
sysrq files in /proc

Thanks for your help.


All times are GMT -5. The time now is 02:27 PM.