From: Michael R. <re...@eu...> - 2006-03-20 19:35:36
|
Hi Lars, >>> Does anyone know if you can get the exec() to execute >>> once only instead of doing repeated executions? >> But why the heck would one want to execute things only once??? > I'm working on a software RAID-1 solution with three S-ATA disks. > One of these disks will be used as backup, i.e push the button > (CF635), take out the disk, put another disk in, push another > button, and voil=E1, you have a complete (and bootable) backup > of your system on a separate disk, whilest the new disk is now > being resynced. All with a running system (hotswap, no reboot). Hey, this sounds cool! I will get a new server for my company this week (a dual-core, so some of the SMP questions with lcd4linux will be answered :-), and I'm planning to do something similar, but with two harddisks only. So I'm a bit curious: how do you boot from and swap to such a mirrored disk? > I checked the mailinglist and couldn't find any plugin for > /proc/mdstat, which I need in order to monitor the RAID. > So I guess I'll have to write a plugin for /proc/mdstat. This would be very very welcome :-) especially because I've got some raid arrays up and running here (almost 1 TB for VDR :-) > However, for prototyping I find the exec() function splendid. > With the help of the exec() function and a simple shell-script, > I have a running system where the CF635 display shows the > RAID status. I even took care of stopping the underlying processes > using a modified init.d script for start/stop of lcd4unix. > So, in all fairness, it works well for me at least. I've been thinking a bit about your issue. The problem with the exec() plugin is that for timing reasons it's async by default. As a side effect, the first call to exec() will never return a senseful result (because the exec thread just forked off). I see two solutions: modify the exec() plugin so it's thread terminates after the first execution, but in this case you won't get a return value. another way would be to force the exec() to be synchronous, meaning not to fork. Maybe this could be implemented by using a negative update parameter (while a update value of zero would mean a "one shot" ex= ec. > I also got the CF635 keypad working allright, thanks to > Chris's patch for this the other week. However, I'm not > sure how to execute a command (once!) using the keypad. > Maybe there is another way that I don't know of? > If not, I guess I'll have to look in to the code. just curious again: What's chris's patch? (you are using CVS code, ain't you?) As I'm very very very busy with my real-life job at the moment, and my son (who is six months old now! funny how time flies....) eats up the rest of my spare time, I'm afraid I can't be of much help, especially with coding. If you feel familiar enough with coding for lcd4linux and patching the repository, I could give you CVS developer access. bye, Michael --=20 Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |