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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-06-2007, 05:43 AM
|
#1
|
|
Member
Registered: Mar 2006
Posts: 471
Rep:
|
detecting a power fail and best file system for this.
Hi all,
I'm wondering if anyone knows if there is a method (in Linux C) to detect a power turn off. Basically I'm running an embedded system and would like on power fail to stop hard-drive / Compact Flash writes and start shutdown. But have no idea how to do this without custom Hardware.
While I'm on the subject can anyone recommend what file system to use, as some people seem to recommend EXT3 others ReiserFS.
However some one has just recommended a Transactional rather than the above Journaling systems. But I'm unsure if Debian has one of these to select? Can anyone advise.
Thanks in advance.
|
|
|
|
02-06-2007, 07:32 AM
|
#2
|
|
Moderator
Registered: May 2001
Posts: 24,779
|
There's a huge difference between turning off power and a power failure. ACPI, power button, could be one way to detect powering off. If your product has a battery you can detect a drain. If you haven't then only "early warning" capabilities of an external UPS/RPS can help to signal a power failure, I think.
I mean, it kinda sounds like common sense non-Vulcan logic to me.
|
|
|
|
02-06-2007, 07:38 AM
|
#3
|
|
Member
Registered: Mar 2006
Posts: 471
Original Poster
Rep:
|
Quote:
|
Originally Posted by unSpawn
There's a huge difference between turning off power and a power failure. ACPI, power button, could be one way to detect powering off. If your product has a battery you can detect a drain. If you haven't then only "early warning" capabilities of an external UPS/RPS can help to signal a power failure, I think.
I mean, it kinda sounds like common sense non-Vulcan logic to me.
|
Hi thanks for that, yes it would be a power fail, the system has no power on off button, people would just pull the mains out. I did consider a UPS. But hoped a PC board might have a power fail circuit, many micro controller boards in the past did.
Could anyone advise on the EXT3, ReiserFS or Transactional file system?
|
|
|
|
02-06-2007, 02:23 PM
|
#4
|
|
Moderator
Registered: May 2001
Posts: 24,779
|
Could anyone advise on the EXT3, ReiserFS or Transactional file system?
Since you didn't already I'd say post your requirements first.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:00 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|