--- deliantra/server/lib/cf.pm 2007/05/05 05:40:27 1.263 +++ deliantra/server/lib/cf.pm 2007/05/06 05:44:48 1.264 @@ -369,10 +369,18 @@ } sub write_runtime { - my $guard = cf::lock_acquire "write_runtime"; - my $runtime = "$LOCALDIR/runtime"; + # first touch the runtime file to show we are still running: + # the fsync below can take a very very long time. + + warn "touching runtime...\n";#d# + if (my $fh = aio_open $runtime, O_WRONLY, 0) { + utime undef, undef, $fh; + } + + my $guard = cf::lock_acquire "write_runtime"; + warn "starting to write runtime...\n";#d# my $fh = aio_open "$runtime~", O_WRONLY | O_CREAT, 0644 or return; @@ -388,6 +396,9 @@ aio_fsync $fh and return; + # touch it again to show we are up-to-date + utime undef, undef, $fh; + close $fh or return;