LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-03-2004, 08:03 PM   #1
MrSmee
Member
 
Registered: Sep 2003
Location: Plano, TX
Distribution: Slack
Posts: 84

Rep: Reputation: 15
automatic shutdown via 12V relay


Hello All,
I am running a slackware based PC in my truck as an auxiliary audio/video/whoa ain't that cool device in my vehicle. The problem I have yet to solve is the shutdown issue. What I'd like to accomplish is an automatic shutdown via the powerswitch. I've got a power inverter hard-wired to the battery, so theoretically the PC constantly recieves 120V power, and I have to manually shut it down using the shutdown command, and start it using the power switch. Is there support in the kernel (or can it be compiled in) to accept normal shutdown from the powerswitch?? The eventual goal is to use a relay wired to a switched ignition source to give the PC off|on commands when I turn the ignition off and on. I know I could do a "fast off" simply by turning the inverter off with the ignition, and although warned about such "quick removal of power source" I have yet to cause a crash this way..... although I know eventually it would happen.

Any help would be appreciated greatly
Thanks
Smee
 
Old 05-03-2004, 10:52 PM   #2
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Hmm....

I think this could be done with your serial port, rather than using a relay on the actual power switch.

Check out the "Coffee Maker HOWTO" at www.tldp.org
They outline how to turn a switch on and off with linux and your serial port, for a coffee maker.
You could glean some information to use the serial port to pickup the presense of voltage, and run a script when the status changes, including a shutdown command. Turning it on would be aproblem, though.

--Shade
 
Old 05-03-2004, 11:35 PM   #3
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
You could setup the system to mount everything as read-only (after it is all configured of course) and then you can kill the power to it without fear.
 
Old 05-04-2004, 08:23 AM   #4
MrSmee
Member
 
Registered: Sep 2003
Location: Plano, TX
Distribution: Slack
Posts: 84

Original Poster
Rep: Reputation: 15
Both excellent suggestions!! I think I'll attempt the serial port control however, as I also have a wireless LAN connection in the box to allow the uploading of new material from my main PC in the house, and it's awful hard to upload to a read-only filesystem.
 
Old 05-04-2004, 09:52 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,850

Rep: Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736Reputation: 736
Actually, I have a piece of test equipment that uses a PC as the frontend. It has a switch (I haven't disassembled the unit yet to check it out) for power. When you physically place the switch to off it performs a shutdown so it is possible.

Check this out:

http://www.linuxquestions.org/questi...g+power+switch
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Automatic shutdown using ping amelieo Linux - Networking 4 04-24-2004 04:59 AM
automatic shutdown in Mandrake 9.2 lu543285 Mandriva 1 02-13-2004 08:10 AM
automatic shutdown in Mandrake 9.2 lu543285 Linux - Hardware 1 02-13-2004 07:35 AM
automatic shutdown of Mandrake 9.2 (sometimes works sometimes not) lu543285 Linux - Hardware 1 02-06-2004 12:18 PM
Automatic shutdown NetScripter Linux - General 1 10-17-2002 02:45 PM


All times are GMT -5. The time now is 06:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration