IRC log for #elinux on 20110521

01:13.55*** join/#elinux djerome (~djerome@ip24-251-138-141.ph.ph.cox.net)
02:46.12*** join/#elinux roxfan (dunno@91.180.69.116)
07:51.47*** join/#elinux unsigned (unsigned@pdpc/supporter/active/unsigned)
07:52.08unsignedanyone alive?
07:54.43Russyes
07:54.52RussI mean no
07:54.58RussI mean, I'm a zombie
07:55.14unsignedThats ok. zombies are cool
07:55.23Russwhat the bible didn't tell you is that all those that get raptured, just their soul goes, their body remains on earth and seeks brains
07:55.24unsignedand useful .. as human shields :P
07:56.07unsigneddoes linux generate SIGPWR on regular power failure?
07:56.18unsignedor only if its on UPS backup?
07:56.45unsignedI'm workin on an embedded project and I want to flush my data when the power fails
08:02.43RussI'm pretty sure SIGPWR is for when power is failing "soon"
08:02.47Russnot as we speak
08:03.31unsignedbah
08:03.43Russthat would be a very very short amount of time
08:03.51unsignedall i need is about 100ms
08:03.59unsignedto flush some data and close open files
08:04.00Russand the races you'd get on false positives would probably be awful
08:04.09unsignedwell its better than data corruption
08:04.11Russwhen you are losing power is a really bad time to write data
08:04.20Russhorrible, horrible failure modes
08:04.36Russits much better to STOP all writing when the power starts go go below spec
08:04.44unsignedhmm
08:05.02unsignedbasically i just need to log the time the device lost power
08:05.15unsignedand some other tiny data
08:06.17unsignedmy os partition is read only so thats safe
08:06.41unsignedbut the data partition could get corrupted if i cant do the bookkeeping stuff
08:13.18Russjust realize that unless the system is designed very carefully, you could attempt to write to one area, but have it end up somewhere else
08:13.32Russits a better bet to just put a periodic mark in
08:14.13Russif its really really important to the system, I'd design it as a separate circuit with a special kind of very small memory
08:14.49Russbecause you really don't want to log a poweroff event before the supervisory circuit decides to hold the system in reset
08:15.00unsignedwell the primary function of the device is to record periodic data and then upload it upon request
08:15.12Russwhy does it need to know when it lost power?
08:15.45unsignedso my user can know why the device didn't record any data
08:15.51unsignedfor that time period
08:17.16Russwhat other reason could there be except lost power?
08:18.40unsignedi poll the data over the serial port from another device and there are other scenarios where the data is unavailable
08:19.28Russthen can't you log that it is unavailable?
08:23.26unsignedbut the data was available.. i just couldn't log it because the device wasn't up..
08:25.11unsignedi was thinking of adding a add-on card for power backup but it also increases the cost, so wanted to know if I could cheat my way out
08:25.59RussI'm still confused why there can't be some sort of "I'm here, but there is no data for me to log" message
08:26.50unsigned.. its the opposite.. "sorry i couldn't even check if there was any data to log because i was switched off"
08:27.39Russright, but if there is a log message every 5 minutes, when you see a span of time where there are no log messages, just assume it was off
08:28.06Russwhen it checks to see if there is data to log, and there is none, write an empty log message
08:29.55unsignedwell the polling interval is user configurable and it can go down to 1/second, so i'd just end up creating huge files
08:30.43Russjust log the awake thing special, touch the log file
08:30.57unsignedbut in any case.. it doesn't solve my main problem, which is to either close the file handle i hold, or flush data and close the handle
08:31.01Russwhen you wake up and the log file is modified at a time newer than the last log message, log that fact
08:31.19unsignedto avoid corruption
08:31.36RussIt really depends on the filesystem, the mount options, and how much data you are logging
08:31.53Russand the underlying media, and the underlying media controller, etc
08:32.11Russwhy not flush after every log message?
08:32.12unsignedwell before i get into that I was investigating ways to first detect the power failure itself
08:32.18unsignedso sigpwr is out i suppose
08:34.49unsignedits a amd geode lx 800 / cs5536 and currently i'm using ext2 for developing (media is CF)
08:35.12Russ...are you aware of what CF is?
08:35.21Russits a microcontroller running its own OS
08:35.36unsignedcompact flash
08:35.36unsigned:S
08:36.22Russso to know at which point in time a power loss will cause behavior a or behavior b is very difficult to know and will vary from manufacturer to manufacturer
08:36.46Russif you do make a mini-ups, that would be a sure way to handle things, just understand the corner cases and difficulties
08:37.02Russlike after a power loss, do you wait until the battery is fully changed before powering back on?
08:37.18Russif not, if there is a second power loss, will you have enough battery to shut down normally?
08:37.45unsignedwell i'm still designing this device, so I have yet to commit to adding the ups
08:41.10unsignedone alternative I had in my mind was to use a transaction based FS
08:41.42unsignedbut seeing as I have limited read/write cycles on my media, thats another thing I have to consider too
09:48.45*** join/#elinux toi (~peter@94-226-59-90.access.telenet.be)
10:06.05*** join/#elinux romerofilho (~bull@187.114.214.167)
10:11.03*** part/#elinux romerofilho (~bull@187.114.214.167)
10:35.25*** join/#elinux toi (~peter@94-226-59-90.access.telenet.be)
11:46.42*** join/#elinux lyakh (~lyakh@dslb-094-221-113-071.pools.arcor-ip.net)
13:26.41*** join/#elinux GPSFan (~kenm@64.92.145.112)
13:27.32*** join/#elinux adyer (~adyer@c-67-167-224-31.hsd1.il.comcast.net)
13:51.31*** join/#elinux toi (~peter@94-226-59-90.access.telenet.be)
13:58.56*** join/#elinux gordon (~gd@122.96.138.147)
14:30.43*** join/#elinux gordon3 (~gd@122.96.138.147)
14:31.18*** join/#elinux gordon_ (~gd@122.96.138.147)
14:44.14*** join/#elinux TimRiker (~timr@keri-pc.rikers.org)
14:44.14*** join/#elinux TimRiker (~timr@bzflag/projectlead/TimRiker)
14:44.14*** mode/#elinux [+o TimRiker] by ChanServ
16:18.58*** join/#elinux djerome (~djerome@ip24-251-138-141.ph.ph.cox.net)
23:31.24*** join/#elinux [XeN] (~XeN]@brln-4db97aca.pool.mediaWays.net)
23:38.18*** join/#elinux toi (~peter@94-226-59-90.access.telenet.be)

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.