rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: bacter on May 11, 2009, 10:42:56 AM

Title: How should HFS behave on shutdown?
Post by: bacter on May 11, 2009, 10:42:56 AM
In the german board has rised up the following problem/question:
http://www.rejetto.com/forum/index.php?topic=6940.msg1043044#msg1043044 (http://www.rejetto.com/forum/index.php?topic=6940.msg1043044#msg1043044)

Fact: It is supposed that the option Menu -> start/exit -> Auto-save VFS on exit is activated.

When a user shuts down Windows directly or with help of a shutdownmanager or using windows-shutdown.exe in programmed tasks, hfs does nos save the vfs, as the program is not finished in the regular way (as with hfs.exe -q or exit), the task is simply killed.

This means, that recent modifications of de vfs (added files or folders) and download- counters etc. are then not saved.

I don't know if this behaviour is a question of windows (killing processes when shutting down), or if this is, as Wasserfloh says, a bug of hfs (if windows or shutdown sends a quit signal/request to hfs ?).


Title: Re: How should HFS behave on shutdown?
Post by: rejetto on May 11, 2009, 11:55:32 AM
it is a bug. a very annoying one, hunting HFS since ever.
i made some efforts for a different shutdown handling, for next build. cross fingers.
Title: Re: How should HFS behave on shutdown?
Post by: maverick on May 11, 2009, 11:59:35 AM
Maybe a solution would be to have a menu option to auto save the vfs every x mins.  That way if such a shutdown event occurs, all changes to the vfs will not be lost.

Edit:
Option is already available in menu.  I forgot about it :)
Maybe some have it disabled.
Title: Re: How should HFS behave on shutdown?
Post by: rejetto on May 11, 2009, 12:47:11 PM
we already have that option :)
menu > vfs > auto save...
but AFAIcan recall, it didn't solve the problem with corrupted files.
if anyone here is able to reproduce the problem, we can test if the new build solves it or not.
Title: Re: How should HFS behave on shutdown?
Post by: bacter on May 11, 2009, 01:01:12 PM
rejetto, the test is simple:

add a file to root.

If you use a simple batch file with

Code: [Select]
C:\WINDOWS\system32\shutdown.exe -s

or shut down windows with start -> shutdown

then, when you restart the pc the file is not in root.

If you use 'exit' from hfs-menu or cmd: hfs.exe -q, the file is there.


----
I don't now if delphi pascal has a function equivalente to the C- function onexit() wher this routine can be called.
Title: Re: How should HFS behave on shutdown?
Post by: MarkV on May 11, 2009, 01:25:40 PM
it is a bug. a very annoying one, hunting HFS since ever.
i made some efforts for a different shutdown handling, for next build. cross fingers.
Different shutdown handling... Maybe this could even solve the NT4 shutdown problem. Fingers crossed.