LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > trainpic
User Name
Password

Notices


Rate this Entry

IPCop shutdown with power button

Posted 08-22-2006 at 10:23 AM by trainpic

I recently installed ipcop on an older Gateway desktop to firewall our new broadband connection. This computer has no keyboard, monitor or mouse. So, without logging remotely, how do you implement a clean shutdown??

I found a clever hack on a german IPCop forum. (Hooray for Google Translate).

Add the following lines to /etc/rc.d/rc.local:
<!--break-->
Code:
if grep -q "^button" /etc/modules; then
  head -1 /etc/acpi/event | grep "button/power PWRF" && ipcopreboot down &
fi
Edit /boot/grub/grub.conf
change the following line:
Code:
default saved
to:
Code:
default 2
to boot the ACPI enabled the kernel.
once you manually reboot, pressing the power button will automatically shutdown the computer.

Note that this should also work with any Linux distribution, simply make sure that grub boots and ACPI enabled kernel and change "ipcopreboot down" to something like "shutdown -h now".
Posted in Uncategorized
Views 4445 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration