Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
106 user(s) are online (92 user(s) are browsing Forums)

Members: 0
Guests: 106

more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
Is there a program that can watch files for write access and log those?

I have an annoying case of a corrupted prefs file.
It happens when a program crashes (not a specific one, just any program crash.
It happens randomly on a simple reboot (fast, hard, sync or not doesn't matter)
It happens a fter some down time on simple boot.

I KNOW that it does NOT happen on startup/boot, but right before WB goes to reboot or a program crashed...i know that because i tried locking WB at first command in startup-sequence and unlocking it after all programs were up.

I could read protect the file, but then i
a) wouldn't be able to change/save the prefs without the extra step of making the file writable again
2) wouldn't see which program tried to corrupt the file (as i only get the warning that the file is write protected, but not from which program)
d) couldn't gather information about the culprit and in turn violently delete the corrupting piece of dead-bits

Is there such a program

...oh, and if anyone has the same problem, please share...for me it's ENVARC:Sys/ringhio.appsprefs.xml that randomly ends up with a corrupted prefs file (together with a window on boot telling me that line xxx has some error or something, also not even with the information of what programs sends the error)

I know it's ringhio because i created a backup and i use custom sounds which always gets set back to that stupid harp (i can't hear anymore)

Thanks

Go to top
Re: Watch files or How to stop corrupted prefs
Quite a regular
Quite a regular


See User information
@Raziel

Would WaitNotify on OS4Depot be what you need ?

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@BillE

Unfortunately not.

While it's an interesting concept the program is aimed towards script usage.

Also, the output possibilities with "More" are limited to the changed files contents, which i don't need, i need the name of the program that does the change/corrupts the file, e.g. MultiEdit/Notepad for a test.

I'm going with "protect -wd" as a workaround for now, annoying but at least i can work without always having to change my settings back.

Keep the hints coming, though

Go to top
Re: Watch files or How to stop corrupted prefs
Quite a regular
Quite a regular


See User information
@Raziel

Maybe you can use snoopdos and see if it tracks it or get any hints

AmigaOS 4.1 FE Update 2 on Sam440ep-flex, 800Mhz, 1GB RAM, Radeon 9250 Resized Image
A1200/040, 2+4MB, external 3.5''HDD / A1200 (spare) / A500+ (sold) / C128 (sold)
http://m4rko.com/AMIGA
Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Marko

That wouldn't work as it seems to corrupt/write to the prefs once i let it reboot.

Maybe the "sync" option and the fact that it closes some programs (is Notification part of them) leads to writing to the prefs and corrupting them?

Go to top
Re: Watch files or How to stop corrupted prefs
Amigans Defender
Amigans Defender


See User information
@Raziel

Is something installing a reset-handler which maybe writes to the file but doesn't finish writing quick enough (or it ends up in memory cache rather than on disk and reboots before sync)

Not sure if it's possible to find out which reset-handlers are installed.

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Chris

I'm using a reboot command (not sure which one) which has a sync command attached to it.

Problem is that randomly it also corrupts the prefs file on a crash of random programs.

Annoying

Go to top
Re: Watch files or How to stop corrupted prefs
Amigans Defender
Amigans Defender


See User information
@Raziel

I'm not sure why you need a sync - just wait for disk access to finish and it should be fine. Presumably the sync is what is screwing it up.

For example use a different reboot command and something like this (don't know if it works on OS4 but the source is there): http://aminet.net/package/util/boot/ResetHandler

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Chris

I need to check which reboot program exactly I'm using (I keep losing track of such details since I tend to automate anything with scripts nowadays.)
In any way, if the sync switch is screwing things up, it's a bug in the program and need to ge resolved imho

Go to top
Re: Watch files or How to stop corrupted prefs
Just can't stay away
Just can't stay away


See User information
@Raziel

Quote:
I'm using a reboot command (not sure which one) which has a sync command attached to it.
Maybe it's simply the default C:Reboot? It has a SYNC option.

If it is, you could try, instead of the SYNC, to use e.g. WAIT 5.

That should normally give enough time for write operations to finish, so the reset is less likely to cause problems.

Edit: BTW, the SYNC option in C:Reboot does not (as per my understanding) notify any programs or similar, it just inhibits all volumes, so they can't be written to.

Best regards,

Niels

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@nbache

Probably, that could be it then.
Maybe im just unlucky in the prefs file being written to while the drive gets locked?
Then again, that would be extremely coincidental while happening nearly all the time...

Will check the wait option.

Thanks for the hint

Go to top
Re: Watch files or How to stop corrupted prefs
Amigans Defender
Amigans Defender


See User information
@Raziel

If it works as nbache says, then the sync might be blocking the drive and then the reboot happens, but due to timing the inhibit may not be completely done. If Ringhio has added a reset-handler which saves prefs on reboot then that could cause it to half write the file before the drive is protected. Result - corrupt file.

I don't see the need for sync, take it out.

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Chris

Will try when im back home, thank you

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Raziel

Slightly late to this thread but you can use my Activity monitor to monitors files and directories for changes.

http://os4depot.net/?function=showfil ... /misc/activitymonitor.lha


Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Chris

Quote:

Not sure if it's possible to find out which reset-handlers are installed.


Mr Solies excellent Ranger utility has a exec->Resethandlers tab


Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Raziel

Didn't read this bit before..

Quote:

..oh, and if anyone has the same problem, please share...for me it's ENVARC:Sys/ringhio.appsprefs.xml that randomly ends up with a corrupted prefs file (together with a window on boot telling me that line xxx has some error or something, also not even with the information of what programs sends the error)

I know it's ringhio because i created a backup and i use custom sounds which always gets set back to that stupid harp (i can't hear anymore)


What version of Notifications are you using? I fixed a race condition with prefs reading code that might cause arbitrary corruption in the prefs file (or at least make it seem corrupt when it wasn't)

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@Chris

Quote:

If Ringhio has added a reset-handler which saves prefs on reboot then that could cause it to half write the file before the drive is protected.


Notifications Server does not do that.

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@broadblues

Thank you.

Will test, check and report back when i get back home

Go to top
Re: Watch files or How to stop corrupted prefs
Home away from home
Home away from home


See User information
@all

Removed teh SYNC option but i immidiately got a corrupted prefs on the next reboot

This is what i'm getting after a corruption:
Parse error at line 276:
unclosed token

The reboot commandf i'm using is
version c:Reboot file full
Reboot 54.1 (10.07.2015)

I'm going back to manually locking the prefs file with protect

Go to top
Re: Watch files or How to stop corrupted prefs
Just can't stay away
Just can't stay away


See User information
@Raziel

Same version of C:Reboot as mine.

You didn't state the version of Notifications you're using? broadblues asked about that a couple of posts ago (and I'm curious too).

Best regards,

Niels

Go to top

  Register To Post
(1) 2 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project