Power cuts are becoming a way of life for many people and here in Blarney we get our fair share of them unfortunately. The second in as many weeks happened this morning and before I could rig up a network cable between my laptop and desktop the UPS powered down and my big noisy desktop died with it. Thankfully without filesystem corruption.
Normally when you press the magic combo of ctrl-alt-delete the machine reboots but in this case it would be much better if the machine did a shutdown. In previous versions of Linux I had to edit /etc/inittab to get the desired effect but that file doesn’t exist in Ubuntu Edgy. Instead you must look at /etc/event.d/control-alt-delete. That file is fairly self explanatory which is all well and good because there’s very little information if you don’t know what to look for.
According to a post here, “Ubuntu replaced init with upstart event daemon”. It’s simple to change it to shutodown. Replace “-r” with “-h” in the following line:
exec /sbin/shutdown/ -r now "Control-Alt-Delete pressed"
No need to run inittab, just hit the magic combo to halt the computer!
PS. thanks so much for all the comments yesterday and the day before. I was bowled over by the response to both posts, especially the Daffodil Day one which struck a chord with many people
Donncha. I love the daf but can you not bring the robin back in there somehow? It’s almost as if you had more important things to think about than fans of your previous header!
Ah! The three finger salute. It was a laughable way of shutting down your Linux box in the last 5 years or so but is becoming more and more of a mainstream thing with Linux fans using Ubuntu, Knoppix etc.
I missed my Linux OS. Had uninstalled it when my pc crashed. Never did re-install it anymore since then.
Note that the location for this file has now changed to /etc/init/control-alt-delete.conf on Ubuntu Karmic and higher…