[patch] pidfile deletion race

Havoc Pennington hp at redhat.com
Wed Mar 31 13:43:49 PST 2004


On Sat, 2004-03-27 at 21:15, Brian Magnuson wrote:
> Hi,
> 	I just recently got dbus, hal, and hal-device-manager up and running
> and I'd first just like to congratulate you all on some great work!
> 
> 	A question.  Why does the parent write out the pidfile for the child within
> _dbus_become_daemon?  If the child detects some problem right away (say, the
> messagebus user doesn't exist ;) it tries to delete this pidfile before
> exiting, but this races against the creation of this file by the parent.
> Leaving a stale pidfile after the parent gets around to writing it and
> exits.
> 
> 	This patch removes any pidfile knowledge from _dbus_become_daemon and does
> the pidfile creation after that function is called (or not).
> 
> 	Does this look sane?  This is the first patch I've sent for anything, ever.
> So it might very well be way off.
> 

I think this looks right, thanks. I suppose there may have been a reason
for the way it was done before, if so we'll find out ;-) but I think we
should commit this patch.

Havoc





More information about the dbus mailing list