LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-16-2006, 09:39 PM   #1
sharadshankar
Member
 
Registered: Dec 2003
Posts: 43

Rep: Reputation: 15
external halt/shutdown button


hi, I want to make an external button to tell my computer to shutdown or halt. I want to wire it to the usb or serial port. Is it possible to do this? How can I port this switch in linux so that it runs the desired command?
 
Old 05-17-2006, 08:54 AM   #2
FLLinux
Member
 
Registered: Jul 2004
Location: USA
Distribution: Fedora 9, LFS 6.3, Unbuntu 8.04, Slax 6.0.7
Posts: 145

Rep: Reputation: 15
My suggestion would be to wire it to the Ring line on the serial port and have a script running in the back ground that watches for that line to go High, and once it does that have the script run whatever you want and shutdown the computer.
 
Old 05-17-2006, 09:27 AM   #3
geeman2.0
Member
 
Registered: Feb 2005
Location: Ontario, Canada
Distribution: Gentoo, Slackware
Posts: 345

Rep: Reputation: 30
They already have this, it's called the power button .

I'm joking, but I do wonder if there's any way to catch the power off event and force a clean shutdown instead of a hard one. I've noticed windows XP can do this sometimes, depending on it's current state.
 
Old 05-17-2006, 11:03 AM   #4
sharadshankar
Member
 
Registered: Dec 2003
Posts: 43

Original Poster
Rep: Reputation: 15
so my friend told me to use a parallel port because its easier. How should I write the script?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I lost the halt command and the shutdown!!!! mago Slackware 7 05-07-2005 05:20 AM
unable to 'shutdown' from x... need to shutdown using 'halt' guitarnix Linux - Newbie 5 11-24-2003 01:00 AM
debian shutdown halt problem acpi apm win32sux Linux - General 0 09-26-2003 12:57 PM
SuSE 8.2 Will Not Poweroff, Shutdown, Reboot, Halt... whiskeypriest Linux - Newbie 4 09-18-2003 09:29 AM
halt, shutdown, and reboot HappyDude Linux - Software 29 07-24-2003 02:05 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:33 AM.

Main Menu
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