Hi Danny,

On Thu, Mar 13 2025, dan...@friendly-machines.com wrote:
> How does my user ("dannym")'s shepherd (and user dbus--probably by
> shepherd?) get started?  (I'm using guix home--if it's important)

Using guix-home, this is started by the ~/.guix-home/on-first-login
script. This "claims" the first run by using this incantation:

--8<---------------cut here---------------start------------->8---
(define (claim-first-run file)
  (catch #t
    (lambda () (close-fdes (open-fdes file (logior O_CREAT O_EXCL O_CLOEXEC))) 
#t)
    (const #f)))
--8<---------------cut here---------------end--------------->8---

This should ensure that guix-home only starts a single Shepherd
process, but it won't protect you against something else starting
another Shepherd process.

> I ask because I just had to debug a race with deadlock of two dannym
> shepherds (one of them was me starting it in
> ~/.config/autostart/shepherd.desktop same like I have been doing the
> last few years[1]) [...]

... As this is doing.

> [1] shepherd has (had?) a check whether the socket was already there
> and if so, it would (correctly) NOT remove it and then (correctly)
> would fail startup.  That way, there's only at most be one shepherd
> running per user (not per session).

I also remember this behaviour. Using the line from your other email, I
checked to see when it changed.

On Thu, Mar 13 2025, dan...@friendly-machines.com wrote:
> shepherd 1.0.2
>   [...]
>       (catch-system-error (delete-file file-name)) ;    <----- Please don't.

This delete-file call has been there since 0.10.2, released in July
2023.

Have you just started to run into problems recently? Have you changed
something about your environment?

I agree there's an issue here, but if you've been starting your own
Shepherd process alongside using guix home for a while, then I'm
surprised this is only causing issues now.

Carlo

Reply via email to