Hongli Lai wrote:
This works great, even on Windows. The only gotchas are:
- flock() doesn't work over NFS. You'll have to use some kind of fcntl()
call to lock files over NFS, but I'm not sure whether Ruby provides an
API for that.
- foo.global.lock is never deleted. You cannot safely delete it without
creating some kind of racing condition.
I forgot to mention that it is safe to delete foo.lock. So the shutdown
part of the daemon code should look like this:
lock(foo.global.lock)
delete_file(foo.pid)
unlock(foo.lock)
delete_file(foo.lock) # added this line
unlock(foo.global.lock)
_______________________________________________
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users