We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Stille
Posts: 10
Joined: Thu Mar 20, 2014 1:56 am

SysRq warnings and shut down by itself

Wed Apr 02, 2014 8:14 pm

Hi, I'm running a program reading and sending data through RX and TX ports (GPIO). However, I got these warnings below randomly. My programs can keep running properly, but later the raspberry shut down suddenly. I cannot find any "reboot"/"halt" command in the logs (syslog, user.log, kern.log, lastlog, in the folder /var/log/). It seems that I cut off RPi's power suddenly, but actually I didn't.

Can anyone help me with that? I did a lot of searching online (this forum and google), there isn't many useful information about this problem.

Warnings (from /var/log/syslog ):
Apr 2 15:15:24 raspberrypi kernel: [47052.542265] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:17:01 raspberrypi /USR/SBIN/CRON[2383]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Apr 2 15:20:22 raspberrypi kernel: [47351.031827] SysRq : Keyboard mode set to system default
Apr 2 15:20:46 raspberrypi kernel: [47374.440620] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:22:16 raspberrypi kernel: [47464.819477] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:24:01 raspberrypi kernel: [47569.420532] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:24:07 raspberrypi kernel: [47575.532961] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:24:51 raspberrypi kernel: [47619.916995] SysRq : Keyboard mode set to system default
Apr 2 15:27:15 raspberrypi kernel: [47764.415541] SysRq : Changing Loglevel
Apr 2 15:27:15 raspberrypi kernel: [47764.465324] Loglevel set to 2
Apr 2 15:29:13 raspberrypi kernel: [47881.435365] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:32:38 raspberrypi kernel: [48086.315450] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:36:30 raspberrypi kernel: [48319.161251] SysRq : Keyboard mode set to system default
Apr 2 15:37:55 raspberrypi kernel: [48403.590379] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:40:39 raspberrypi kernel: [48568.427936] SysRq : Nice All RT Tasks
Apr 2 15:41:10 raspberrypi kernel: [48598.842802] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
Apr 2 15:43:09 raspberrypi kernel: [48717.889260] SysRq : Keyboard mode set to system default
Apr 2 15:44:29 raspberrypi kernel: [48798.181346] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) debug(g) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)

rbiks
Posts: 16
Joined: Sun Oct 07, 2012 2:47 pm
Location: central Germany

Re: SysRq warnings and shut down by itself

Wed Apr 02, 2014 9:37 pm

Hi,

it looks like something is sending a 'break' command to the serial port. This triggers the SysRq mode. The character after the 'break' tells the kernel to execute a certain action eg. To shutdown the OS. You can try to disable SysRq handling by entering

Code: Select all

echo 0 > /proc/sys/kernel/sysrq
More about SysRq on Wikipedia: http://en.wikipedia.org/wiki/Magic_SysRq_key

User avatar
rpdom
Posts: 25166
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: SysRq warnings and shut down by itself

Thu Apr 03, 2014 7:51 am

Have you disabled the console serial port (which is the default setting)?

You need to edit the cmdline.txt file and remove the references to ttyAMA0 and comment out a line in /etc/inittab that also refers to ttyAMA0, then reboot for the changes to take effect. After that the serial port will be free for you to use and those messages should go away.

Stille
Posts: 10
Joined: Thu Mar 20, 2014 1:56 am

Re: SysRq warnings and shut down by itself

Thu Apr 03, 2014 5:50 pm

Thanks for you notification. I checked my configuration files.

I've commented the line
T0:23:respown:/sbin/getty -L ttyAMA0 115200 vt100
in the /etc/inittab

But I forgot to delete the configuration about ttyAMA0 in /boot/cmdline.txt

I've revised the configuration, the Pi is running. Hope it will work well.
rpdom wrote:Have you disabled the console serial port (which is the default setting)?

You need to edit the cmdline.txt file and remove the references to ttyAMA0 and comment out a line in /etc/inittab that also refers to ttyAMA0, then reboot for the changes to take effect. After that the serial port will be free for you to use and those messages should go away.

Return to “General discussion”