2
votes

For the heck of it, what's the fastest way to kill a server, other than just pulling the plug?

Kill as in a(n) (un)safe shutdown, you could theoretically reboot it and have it survive the incident.

Edit: Tangentially related to serverfault.com, my apologies. IMHO, the question is related in that these are possible things users could be attempting, as well as in the case of adverse conditions there might be reasons server admins want to take down multiple boxes lest undefined "damage" might occur.

Edit2: opened to community wiki.

8
  • 1
    How is this related to system administration?
    – Zoredache
    Jul 15, 2010 at 0:16
  • 4
    C4 ;) kills the server with 8040 meters per second which IS fast ;)
    – TomTom
    Jul 15, 2010 at 1:27
  • 2
    Bazookas always work well. Jul 15, 2010 at 2:06
  • 2
    I would say that exposing the server to a naked singularity (i.e. a black hole) at zero range would make it go offline quicker.
    – Chopper3
    Jul 15, 2010 at 8:09
  • 1
    I strongly suggest reopening it as a community wiki. It's a really fun question, and quite technically interesting, too.
    – Massimo
    Jul 15, 2010 at 9:27

13 Answers 13

10
votes

On a Sun server, Stop-A suspends the kernel immediately. You can press the key combination or send an equivalent signal on the serial console.

On Linux, Alt-SysRq-O crashes the kernel immediately. Through a remote shell, you can do echo o > /proc/sysrq-trigger. There are other magic SysRq keys that will cause an immediate unclean reboot. Alt-SysRq-S is handy to sync to disk first.

3
  • Bingo, cheers mate.
    – EricR
    Jul 15, 2010 at 0:22
  • I'd like to add that "echo b > /proc/sysrq-trigger" is useful when an NFS client is wedged so badly that a clean reboot is likely to hang forever. In that case, I would rather take the chance of local filesystem corruption (which is unlikely to be a problem with journaling) than to be left with a remote server that is unreachable because SSH has shut down and NFS hangs while trying to unmount. Jul 15, 2010 at 0:35
  • I shall have to try that next time our VM running Zimbra decides it neither wants to work or properly shut down. echo S > /proc/sysrq-trigger followed by echo 0 > /proc/sysrq-trigger should be slightly safer than just hitting the virtual bit red button. Jul 15, 2010 at 1:11
15
votes

give an oracle dba the root password.

1
  • 1
    You'd really have to hate that poor server to do that!!!
    – Massimo
    Jul 15, 2010 at 16:47
7
votes

C4, or other explosive

4
  • 4
    Question stated "have it reboot and survive the incident". C4 would not let it do that.
    – Kevin M
    Jul 15, 2010 at 1:21
  • 4
    It would with remote detonator. User would survive ;)
    – TomTom
    Jul 15, 2010 at 3:11
  • @TomTom, excellent. :D
    – EricR
    Jul 15, 2010 at 3:19
  • 1
    thermite. youtube.com/watch?v=jhfF2Et77aw
    – petrus
    Jul 15, 2010 at 10:43
7
votes

For Windows, this one is simply delicious:

http://msdn.microsoft.com/en-us/library/ff545499(v=VS.85).aspx

Just a little Registry edit, and you'll be able to trigger an instant BSOD on any Windows system by pressing CTRL + SCROLL LOCK twice.

2
  • Oohh, nice - I didn't know about this Jul 15, 2010 at 5:53
  • 4
    Well, there should be some way to force a system crash in order to test and debug it, I suppose... MS developers couldn't just sit there waiting for it to randomly happen. Even if in good old times this wouldn't have meant waiting so much :-p
    – Massimo
    Jul 15, 2010 at 5:57
6
votes

You're not scaling. If it doesn't scale, it's not a solution.

EMP pulse.

Theoretically, if it didn't hard-fry the electronics, you could reinstall the OS and things would survive the incident. Fastest way to turn off an entire datacenter of machines -- just use a larger pulse -- and will work better than just pulling the power, as those UPSes/batteries won't get in your way.

Of course, it's not ideal scaling, as you're dealing inverse-square law for power vs coverage area and any decent computer scientist will wince at such an O constraint and look for a better algorithm. Perhaps a bunch of EMP pulse emitters, each triggerable by being subjected to a pulse, would give you an easy scaling cascade system, at the cost of small delays in the effect as the pulses ripple out.

1
  • Wow, I like that. Wire them all together and have one box shielded (or not for that matter) set off localised EMPs throughout your data centre. Scalable and fun.
    – EricR
    Jul 15, 2010 at 15:41
3
votes

Universal: Find a paperclip and jam it in the "Reset" hole

1
  • 1
    ...or in the power supply. But be sure to have good insulation...
    – Massimo
    Jul 15, 2010 at 5:52
3
votes

Run a fork bomb as root? (or any user if no user resource limits are in place)

Or cat hair, dust, and other general household detritus gumming up all the cooling fans?

1
  • Ah, good old fork bombs...
    – Massimo
    Jul 15, 2010 at 5:53
3
votes

This is handy for shutting down a Windows computer remotely:

C:\WINDOWS\system32\shutdown.exe -r -m \\MYCOMPUTERNAME01
C:\WINDOWS\system32\shutdown.exe -r -m \\192.168.1.186

-r means you are completely shutting it down and rebooting
-m means it's a remote machine
1
  • 1
    The -f and -t flags could be of some assistance here.
    – jscott
    Jul 15, 2010 at 11:20
3
votes

For Windows:

shutdown -s -f -t 0 \\ServerName

This forces an immediate shutdown and causes all the applications to close (whether they'd like to or not).

2
votes

shutdown -t now has always been fast enough for me

3
  • sure, but that's no fun! That's the nice, pleasant, clean way of killing a server where it shuts down all running processes, kills the daemons, and stops.
    – EricR
    Jul 15, 2010 at 0:10
  • @Eric: I took your parentheses in "a(n) (un)safe" to indicate both alternatives. Jul 15, 2010 at 0:36
  • @Dennis, fair enough. I should've worded that more clearly.
    – EricR
    Jul 15, 2010 at 3:19
1
vote

Depending on your system

halt --force

might get the job done (as far as quickness goes).

1
  • I'll look in to it, thanks. I've never used the force option of halt.
    – EricR
    Jul 15, 2010 at 0:23
1
vote

Cross the pins in a USB port with something metal (paper clip works well), and you'll have a really quick power down (ie, instant). I've only ever seen this happen in a laptop, but I'd imagine it'd happen on a desktop as well. Amazingly, the computer has booted back up normally after it was done.

4
  • Interesting, hadn't heard of that before, something to try next time.
    – EricR
    Jul 15, 2010 at 3:19
  • P.S. - Only try it if you're ok with frying the whole computer in case something goes wrong. :)
    – Paul Kroon
    Jul 15, 2010 at 16:50
  • 1
    On a similar note, get a usb cable and plug both ends into the same computer. You'll certainly fry some components that way. Jul 15, 2010 at 17:34
  • According to this blog post, USB 2.0 devices are now required to withstand short-circuits. Jul 18, 2010 at 21:29
1
vote

Two fun ones that may not give you 'comes back up' (data corruption is vicious):

dd if=/dev/zero of=/dev/mem
dd if=/dev/urandom of=/dev/kmem

Of course, the other way around would be interesting too.

2
  • 1
    What OSs have a /dev/mem? I run ubuntu, and there wasn't a /dev/mem last I checked
    – EricR
    Jul 15, 2010 at 17:52
  • 1
    Linux xxx 2.6.32-xx-generic xxx-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux \\ $ ls -l /dev/mem crw-r----- 1 root kmem 1, 1 2010-07-14 00:02 /dev/mem Jul 16, 2010 at 3:05

Not the answer you're looking for? Browse other questions tagged .