From: Owain on
Folderol wrote:
> I have an application that will be run on a fairly robust industrial
> computer. The hardware side is pretty much cut and dried, but I have
> concerns about the software.
> The main problem is that I can absolutely guarantee that the system will
> be quite frequently just switched off at the supply while running.

A small UPS is the way to go, together with the computer in a locked
enclosure.

One used to be able to get very small UPSes on ISA cards.

Ideally have the enclosure fitted with an electromechanical lock
controlled by the computer, with passwords issued to users who need to
unlock the cabinet, all accesses logged, as well as a physical lock.

Owain

From: spike1 on
Folderol <folderol(a)ukfsn.org> did eloquently scribble:
>> There's not much that you can do about deferred writes short of making the
>> flush to disk happen sooner (/proc/sys/vm/dirty_writeback_centisecs,
>> /proc/sys/vm/dirty_expire_centisecs), but if the power switch takes
>> sufficiently long to get to, this won't really matter.
>>
>> [snip]

> Would a 'sync' after each write take care of this?

If the only file you're writing doesn't "care" about being corrupted...
You could always mount all but the /tmp and /home directories as read-only.

As for a "sync" after each write...
There's a mount option to take care of that.
Of course, even that won't help if a file is in mid-write when the power
fails.

> Once started, the program takes over the whole machine but uses X GUI.
> If I disable logging, and shutdown almost all services, could I be
> reasonably confident the OS won't be writing anything to disc once the
> system is up and running?

> Must-haves are: display, mouse, keyboard, usb, RS232.

Should think writes would be minimised by doing that...
you could also mount any other writes that DO occur as ramdisk if you don't
care about losing them.
--
______________________________________________________________________________
| spike1(a)freenet.co.uk | |
|Andrew Halliwell BSc(hons)| "The day Microsoft makes something that doesn't |
| in | suck is probably the day they start making |
| Computer science | vacuum cleaners" - Ernst Jan Plugge |
------------------------------------------------------------------------------
From: Nix on
On 1 Jan 2008, Gordon Henderson stated:

> In article <20071231211713.78fd7b51(a)ukfsn.org>,
> Folderol <folderol(a)ukfsn.org> wrote:
>>Would a 'sync' after each write take care of this?
>
> fsync(2) on the file-handle before closing the file

Or open() it with the O_SYNC flag.

--
`The rest is a tale of post and counter-post.' --- Ian Rawlings
describes USENET