How to set-up SysRq on puppy?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
User avatar
mohittomar13
Posts: 51
Joined: Wed Jul 29, 2020 5:12 pm
Location: New Delhi - INDIA
Has thanked: 17 times
Been thanked: 3 times

How to set-up SysRq on puppy?

Post by mohittomar13 »

Hi, I find sysrq quite handy for emergency disk sync when the system freezes. I searched the topic on google but didn't find anything specific for puppy.

I try to follow instructions given on

https://linuxconfig.org/how-to-enable-a ... s-on-linux

but stopped in the middle and thought to first ask before doing any damage to my puppy system. I have spent a lot of time on forums in getting it set-up puppy the way I wanted and didn't want to go through those processes again. As you can tell I'm a new puppy user.

Thanks for any help. :thumbup2:

Laptop: Dell 3568
CPU: intel i3 6006U
RAM: 12 Gigs
4GB-micron + 8GB-kingston

yeah, it works.. :D
HDD: 1TB
OS: Tripple boot- (Windows-10, Xubuntu-20.4LTs, Bionic Puppy) 64Bit

User avatar
mikewalsh
Moderator
Posts: 5693
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 614 times
Been thanked: 1758 times

Re: How to set-up SysRq on puppy

Post by mikewalsh »

@ mohittomar13:-

I suspect you're not going to have a lot of luck with this one, y'know.

It's all going to hinge around whether CONFIG_MAGIC_SYSRQ was set as an option at compile time. I've checked a couple or three Pup's kernel config files, and it rather looks like the answer is going to be no.

You can try this yourself. We have a rather different way of doing this stuff in Puppy.

Go to /etc/modules. Look for a file titled

Code: Select all

DOTconfig-x.xx.xxx-build-date
.....where x.xx.xxx is your kernel version. Open this up with Geany (or whatever text editor you use), and look for the section, down toward the bottom, marked

Code: Select all

 # Compile-time checks and compiler options
You'll find the CONFIG_MAGIC_SYSRQ value somewhere amongst that lot. I'm in radky's DPup 'Stretch' ATM, and it's not set for the k4.1.48 kernel in use.....

----------------------------------------

If not set, I suspect you won't be able to make use use of sysrq.

Hope that helps.


Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
666philb
Posts: 429
Joined: Thu Jul 09, 2020 3:18 pm
Location: wales uk
Has thanked: 111 times
Been thanked: 146 times

Re: How to set-up SysRq on puppy

Post by 666philb »

@mohittomar13

bionicpup64 @ fossapup64 seem to have the required module. just had a test in fossapup64 and ....
[ 3454.022483] sysrq: Emergency Sync
[ 3454.024976] Emergency Sync complete
User avatar
mohittomar13
Posts: 51
Joined: Wed Jul 29, 2020 5:12 pm
Location: New Delhi - INDIA
Has thanked: 17 times
Been thanked: 3 times

Re: How to set-up SysRq on puppy

Post by mohittomar13 »

@mikewalsh

Thanks for the reply Mike, as always it's quite helpful. I ran the following command and it seems the kernel was compiled with sysrq option turned on. It is not activated by default though. See below:

Code: Select all

root@puppyPC5832:/etc/modules# cat DOTconfig-4.19.23-190219 | grep -i ".*sysrq.*"
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0
# CONFIG_MAGIC_SYSRQ_SERIAL is not set
When I ran the commands from the link, I mentioned, I was halfway through to setting the option active but stopped as I thought to first take some advice. Anyways Puppy doesn't freeze and I think I will do this later on a VM first, before doing it on my machine.

Thanks again :thumbup:

And your desktop looks beautiful (the image you shared on that other thread), it is beautiful.

Laptop: Dell 3568
CPU: intel i3 6006U
RAM: 12 Gigs
4GB-micron + 8GB-kingston

yeah, it works.. :D
HDD: 1TB
OS: Tripple boot- (Windows-10, Xubuntu-20.4LTs, Bionic Puppy) 64Bit

williams2
Posts: 1028
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 293 times

Re: How to set-up SysRq on puppy?

Post by williams2 »

The sysrq key is disabled by default (0).
128 enables reboot and poweroff.
1 enables all functions.
Type in a text terminal:

Code: Select all

# cat /proc/sys/kernel/sysrq
0
# echo 1 > /proc/sys/kernel/sysrq
# cat /proc/sys/kernel/sysrq
1
# 
So now you should be able to force a brutal reboot (filesystems not unmounted first, etc)
by pressing and holding alt+sysrq then press b

About the same thing as pressing and holding the power button for 5 to 10 seconds.

If you hold alt+sysrq then press e it should close all programs gently.
If then you press i it should force all other programs to close.
If then you press s it should sync the drives.
If then you press u it should try to remount the filesystems read-only.
If then you press b, it should reboot.

I haven't tried doing this, today anyway.

To enable the sysrq key every time Puppy boots, put the line in the file /etc/rc.d/rc.local
echo 1 > /proc/sys/kernel/sysrq
williams2
Posts: 1028
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 293 times

Re: How to set-up SysRq on puppy?

Post by williams2 »

By the way, if Puppy freezes, killing Xwindows (X,Xorg) by pressing ctrl+alt+backspace might help.
Then you can restart x by typing xwin, or type reboot or type poweroff or press ctrl+alt+del to reboot.

If the keyboard is really frozen, sysrq probably won't work either.
peterm321
Posts: 6
Joined: Sun Aug 16, 2020 12:56 am
Location: UK
Has thanked: 1 time

Re: How to set-up SysRq on puppy?

Post by peterm321 »

I was thinking myself of compiling in the magic sysrq function in my version of Puppy Linux Tahr.

I did this with my previous kernel (Upup Raring). I have found the sysrq function does work when the system locks up. Typically the lockups occur with a faulty driver or kernel OOM.

Unfortunately the adding the sysrq function to a kernel has a couple of unfortunate attributes:


* The sysrq function has to be compiled as a builtin to the kernel vmlinux/vmlinuz image file. I tried to compile it as a loadable kernel module. I was able to compile a sysrq.ko loadable file, but it wouldn't load(insmod).

*Unfortunately even after I compiled sysrq built in via the make BzImage command, the new kernel refused to load any kernel modules. It appears that even though I used the same source files and headers as my existing Tahr, what I had seen as a very small change rendered the old modules incompatible.

* Therefore, absent some kind of hacks or fiddles, not only has the kernel vmlinux/vmlinuz file have to be created but the associated modules have to be recompiled as well. It is the latter part that adds hassle (takes a long time) so I have given up for the time being.

The obvious solution would be for the sysrq option to be made a default feature in future puppy linux releases.
User avatar
mikewalsh
Moderator
Posts: 5693
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 614 times
Been thanked: 1758 times

Re: How to set-up SysRq on puppy

Post by mikewalsh »

mohittomar13 wrote: Sat Aug 15, 2020 4:38 pmAnd your desktop looks beautiful (the image you shared on that other thread), it is beautiful.
Well, thank you. Glad you like it.

You'll soon figure out, like most of the regulars here have, that graphic design is a long-standing "hobby" of mine. I took courses in it, and passed exams on the subject, despite that I didn't take it any further.....and at almost 60, I think I've left it too late to make a career out of it!

I design all my Puppy desktops from the ground up, including what I call the "infocenter" on the right-hand side (gKrellm & pWidgets, usually). They're all different; with this one, during this last few crazy months I've re-kindled an old fascination with exotic plants, which I laid aside several years ago.....didn't have the time for it then. So; I decided on a wee bit of a change from my normal 'abstract' stuff, and went for something different.

I must be one of only a small minority who regularly use both Photoshop AND the GIMP equally effectively. Most people moan about the work-flow differences, and refuse to take the time to learn them. Me, I've been using them alongside each other for years, and can switch back & forth.....almost without noticing. :D


Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Post Reply

Return to “Beginners Help”