Friday, June 4, 2010

Ctrl Alt Delete - what a byte!

If you are at all familiar with computers, the key stroke combination of Ctrl+Alt+Del Keys are well known. They are more of a throw back to the Microsoft DOS days when rebooting was done with those key strokes. Now much of the time in Windows it just gives you the opportunity to lock the screen, and of course reboot also; but it will not automatically do it without warning.

Here is the "byte". In Linux if you are in a terminal window the keystroke can also reboot your machine. Now this is not the normal operation. I have been groomed for a long time in Unix/Linux to use the "shutdown" command, or the init command with the proper parameters.

Ok, this still is not the biggest problem --- Here is the biggest GOTCHA. If you are a big user of VMWARE. Here is the problem(s).

1. If you have a Linux machine in a console session up on your Windows Machine, and you hit CTRL+ALT+DEL to lock your Screen, something we do all the time; and, normally if your VM machine is Windows, no harm, no foul, you just get a message from VMWare. But, if your machine is Linux machine, the screen will lock, but your machine will shutdown without any warning! This is huge. We had a print server serving printers to the whole company that got shutdown like that, and we did not know what had happened. So here is the fix for number 1:

If your VM is a Ubuntu Linux. Go to /etc/init and edit the file called control-alt-delete.conf file.

Add a # in front of the line: exec shutdown -r now "Control-Alt-Delete pressed", and add the line underneath: echo "control-alt-delete pressed". Save the file.

Here is what the two lines look like:
# exec shutdown -r now "Control-Alt-Delete pressed"
echo "control-alt-delete pressed"

For other Linux Distros look at : This Site

2. If that is not a big "byte". Here is one that if you are a VMWARE administrator you better know. The same thing will happen in a VMWARE console - but in this case the consequences are even bigger, because it will shut down the entire Host and all the VMs running on it. This could be from a couple, to 20 or 30 production machines. Ouch!!!!

To fix it in VMWARE do the following:

Log in to the ESX host via KVM, SSH or by accessing the console directly.
Open the file /etc/inittab. We used Vi.
Edit /etc/inittab and put a # symbol in front of the line that reads:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now so that that it reads:

# Trap CTRL-ALT-DELETE
# ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Quit and save the file.
Force the configuration changes without having to reboot the host, by executing

init q

OR make sure that you have patch: ESX400-201002402-BG which in our case we had applied. Another good reason to keep your VMWARE Hosts patched.

So just thought I would pass on what we experienced and what we did to stop it from happening again.

Delco

1 comment:

Anonymous said...

Hey, I can't view your site properly within Opera, I actually hope you look into fixing this.