GNU bug report logs - #53580
/var/run/shepherd/socket is missing on an otherwise functional system

Previous Next

Package: guix;

Reported by: Attila Lendvai <attila <at> lendvai.name>

Date: Thu, 27 Jan 2022 11:34:02 UTC

Severity: important

Full log


Message #31 received at 53580 <at> debbugs.gnu.org (full text, mbox):

From: Brian Cully <bjc <at> spork.org>
To: Attila Lendvai <attila <at> lendvai.name>
Cc: guix-devel <at> gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
 53580 <at> debbugs.gnu.org
Subject: Re: shepherd's architecture
Date: Mon, 29 May 2023 10:46:31 -0400
Attila Lendvai <attila <at> lendvai.name> writes:

> it doesn't seem to be an insurmontable task to make sure that 
> guile
> can safely unlink a module from its heap, check if there are any
> references into the module to be dropped, and then reload this 
> module
> from disk.
>
> the already runing fibers would keep the required code in the 
> heap
> until after they are stopped/restarted. then the module would 
> get GC'd
> eventually.
>
> this would help solve the problem that a reconfigured service 
> may have
> a completely different start/stop code. and by taking some 
> careful
> shortcuts we may be able to make reloading work without having 
> to stop
> the service process in question.

Erlang has had hot code reloading for decades, built around the 
needs of 100% uptime systems. The problem is more complex than it 
often appears to people who are used to how lisps traditionally do 
it. I strongly recommend reading up on Erlang's migration 
system. Briefly: you can't just swap out function definitions, 
because they rely on non-function state which needs to be migrated 
along with the function itself, and you can't do it whenever you 
want, because external actors may be relying on a view of the 
internal state. To accomplish this, Erlang has a lot of machinery, 
and it fits in to the core design of the language and runtime 
which would be extremely difficult to port over to non-Erlang 
languages. Doing it in Scheme is probably possible in an academic 
sense, but not in a practical one.

OTOH, Lisp Flavoured Erlang exists if you want that syntax. There 
would definitely be advantages to writing an init (and, indeed, 
any service that needs 100% uptime) on top of the Erlang virtual 
machine. But going the other way, by porting Erlang's 
functionality into Scheme, is going to be a wash.

> in this setup most of the complexity and the evolution of the 
> shepherd
> codebase would happen in the runner, and the other two parts 
> could be
> kept minimal and would rarely need to change (and thus require a
> reboot).

Accepting that dramatic enough changes to PID 1 are going to 
require a reboot seems reasonable to me. They should be even more 
rare than kernel updates, and we accept rebooting there already.

-bjc




This bug report was last modified 2 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.