On 26.11.2013 3.20, Eric Wong wrote:

>>
>> I think the way 4.6.2 worked is better. There should be a pid file for
>> the new master process the moment it's created.
> 
>> What do you think?
> 
> How about having the old process create a hard link to .oldbin,
> and having the new one override the pid if Process.ppid == pid file?
> The check is still racy, but that's what pid files are :<
> 

Isn't it possible to always keep a valid pid file by using the fact that
mv is atomic? Basically the new process writes the pid first to a temp
file and then moves it over the old pid file after having hard linked
the file to .oldbin?

$ echo "1" > foo.pid
$ ln foo.pid foo.oldpid
$ echo "2" > tmp
$ mv tmp foo.pid
$ cat *pid
1
2

Regards,
Petteri

_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

Reply via email to