Subject: Re: [PATCH v3 1/2] builtin/maintenance: fix locking with "--detach"

From: Junio C Hamano <[email-masked]>
Date: Wed, 13 May 2026 19:06:27 +0900

Patrick Steinhardt <[email-masked]> writes:

> Note that this is a broader fix, as we now always reassign tempfiles
> when daemonizing. This is a natural consequence of the semantics of
> `daemonize()` though, as it essentially promises to continue running the
> current process in the background.

Exactly.  I do agree that it is the right wy to look at it.  The
process that daemonise creates and leaves in the background is
logically the process that continues to execute the service the
process the user started, and unless the original process explicitly
says "we are done serving this thing" and cleans up tempfile or
lockfile it needed to serve that thing, it is natural to make the
surviving process to take over the responsibility.