You are not logged in.

#1 2005-12-26 21:28:33

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Is it possible to bind 'killall -9' to a keystroke?

You know what my problem is: Xorg is prone to locking up instead of terminating itself if something goes wrong, and I've been messing around with evdev in preparation for use of a new trackball, leading to several such lockups.

I don't have another *nix box and I don't run SSH... So I'm wondering, is there a way to bind 'killall -9' to a keystrong - I'm thinking ctrl-alt-break would be best - using only bash, so that I could instantly kill whatever app was in the foreground without fail?

Offline

#2 2006-01-14 21:58:59

Jefg60
Member
From: UK
Registered: 2006-01-07
Posts: 100

Re: Is it possible to bind 'killall -9' to a keystroke?

if you dont have another *nix box does that mean you've got a windows box? theres something called putty that will ssh to a *nix box from windows, I've used it before.

Just making an observation. Sorry I don't know the answer to your question (I'm pretty new to linux myself) - but it sounds like this might be useful to you from reading your post.

Offline

#3 2006-01-14 22:09:28

whatah
Member
Registered: 2003-08-10
Posts: 114

Re: Is it possible to bind 'killall -9' to a keystroke?

How do you define foreground, exactly?

Offline

#4 2006-01-15 02:48:27

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Is it possible to bind 'killall -9' to a keystroke?

Just use Magic SysRq.

Offline

#5 2006-01-15 03:43:24

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Is it possible to bind 'killall -9' to a keystroke?

Okay, two problems:
- I really, really, really do not want to run SSH. That would open me up as a potential target for hacking.
- Isn't magic SysRq not all that secure? And does it even allow you to terminate something that's frozen up completely?

Offline

#6 2006-01-15 04:45:51

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Is it possible to bind 'killall -9' to a keystroke?

Gullible Jones wrote:

Okay, two problems:
- I really, really, really do not want to run SSH. That would open me up as a potential target for hacking.

Please use the correct term (cracking). You can set ssh up so that it only allows you to log in from certain machines or IPs. Of course, it may theoretically be possible for your friendless neighborhood cracker to spoof the IP, I suppose.

Dusty

Offline

#7 2006-01-15 05:39:37

Shofs
Member
From: Central Illinois
Registered: 2004-12-15
Posts: 184

Re: Is it possible to bind 'killall -9' to a keystroke?

lucke wrote:

Just use Magic SysRq.

How would one do that?  I think I know what you are talking about, but I've never used them.

Offline

#8 2006-01-15 11:30:51

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Is it possible to bind 'killall -9' to a keystroke?

Magic SysRq could be called insecure only due to the fact, that someone who has a physical access to your PC could shutdown it or kill processes on given tty. But firstly, he would have to know how to actually do it, secondly, he could press power button or unplug the power cord anyway. On the other hand, when it comes to freezes, SysRq is invaluable (it is intercepted directly by kernel, so it doesn't work only if kernel itself is locked).

Google for it or search the forum, I remember I had explained it at least once around here, but can't seem to find that topic (who steals my data, argh?).

Offline

#9 2006-01-16 05:40:40

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Is it possible to bind 'killall -9' to a keystroke?

The reason why magic sysrq is left off, is that apparently it can be sent remotely, via ssh or whatever. But I guess if someone has got into your SSH, magic sysrq is the last thing you will be worrying about.

I'd enable it, its damned useful and has saved me from rebooting countless times, and prevented me from hard rebooting the computer and risking FS damage.

iphitus

Offline

#10 2006-01-16 19:17:03

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Is it possible to bind 'killall -9' to a keystroke?

Thanks. big_smile

Offline

#11 2006-01-17 04:00:07

Shofs
Member
From: Central Illinois
Registered: 2004-12-15
Posts: 184

Re: Is it possible to bind 'killall -9' to a keystroke?

iphitus wrote:

The reason why magic sysrq is left off, is that apparently it can be sent remotely, via ssh or whatever. But I guess if someone has got into your SSH, magic sysrq is the last thing you will be worrying about.

I'd enable it, its damned useful and has saved me from rebooting countless times, and prevented me from hard rebooting the computer and risking FS damage.

iphitus

I'm sure there have been a couple time I could have used this knowledge.  Please explain

Offline

Board footer

Powered by FluxBB