Messages in this thread |  | | | Subject | Does sysrq break something? | | From | Tetsuo Handa <> | | Date | Mon, 12 May 2008 21:16:30 +0900 |
| |
Hello.
I'm trying to get a sysrq dump when the system hangs. But unfortunately, typing sysrq key from the keyboard doesn't work after the system hangs. So, I'm trying to get a sysrq dump by automatically writing to /proc/sysrq-trigger using a program.
#include <stdio.h> #include <unistd.h>
int main(int argc, char *argv[]) { FILE *fp = fopen("/proc/sys/kernel/sysrq", "w"); if (!fp) return 1; fprintf(fp, "1\n"); fclose(fp); fp = fopen("/proc/sysrq-trigger", "w"); if (!fp) return 1; while (1) { sleep(60); fprintf(fp, "t\n"); fflush(fp); } return 0; } Is running this program safe?
In other words, does invoking sysrq routine break or taint something?
Regards.
|  |