From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0Hm1MmoMTWThCQAASxT56A (envelope-from ) for ; Sat, 29 Apr 2023 14:24:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yDfiMWoMTWRNEQEAG6o9tA (envelope-from ) for ; Sat, 29 Apr 2023 14:24:10 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 410343041E for ; Sat, 29 Apr 2023 14:24:10 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psjcE-000159-QN; Sat, 29 Apr 2023 08:23:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psjcD-00014k-8H for guix-devel@gnu.org; Sat, 29 Apr 2023 08:23:49 -0400 Received: from mail.thebird.nl ([94.142.245.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psjcA-0006CJ-Oc; Sat, 29 Apr 2023 08:23:48 -0400 Received: by mail.thebird.nl (Postfix, from userid 1000) id 2CCD31B3D; Sat, 29 Apr 2023 14:23:41 +0200 (CEST) Date: Sat, 29 Apr 2023 14:23:41 +0200 From: Pjotr Prins To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel Subject: Re: GNU Shepherd 0.10.0rc1 available for testing! Message-ID: <20230429122341.e6rcvnnylgfxah4p@thebird.nl> References: <875y9gt9fb.fsf@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <875y9gt9fb.fsf@inria.fr> User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=94.142.245.5; envelope-from=pjotr2023@thebird.nl; helo=mail.thebird.nl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682771050; a=rsa-sha256; cv=none; b=LKUDmklP31EIUsdhpgAMD7aSjUJ5yt8HUigFnDJq8n+u6ojZPcybf3vcO1Ke7atclJdgn4 7xD31mZWMYSTCPd2dqEDgdvUJRrz2+K9AmsLL35K4cYAJ3A2ivMa5HihWZI0vgCJ6TwvDc NVav2XQv4EkdfwgbV9EWNHrkvLOMJor9/hrr11QPwE7FovQlG44CAHP79km9H4ALrn6tRj rVPmkvwinRTy5w8OzUElEEbtwuUIIophLUgDn9Z1Ilrx8sdmCM9wn91+xCBqjlYVu8WqkJ W4XSyCIJrFHkxf9WJG3Nj73VpVY88DMZaI0Q1lxXRkOsom+0bvVtaLS67ois/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682771050; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gEP6Tz6ESPV7io3rFFf1hfP4XquVubDpwyFGw/dHsNI=; b=F6nA5GDL3mT6+k3MDtU1hoB8hFsYiiQsRsjPS30CgyV+gsa7dhnrtIR9jvf9DJddPZ5YPd Jh3rGRly0IgZTvoSgjWTTaUfM68ZbbxAqCXXrC/yxmFfdJQof/fLRoxXMr6I25WUCQwz0+ YQYuLVip/k7SR8ZNWxvJeg8lA6dXoUB/cocD+wk8jdg4NlVW1pH7j1IzFhKfldeMmmTGiq p+HNjWJUxtRNNaalVnUZwb81ozzfEFuN2Y1iflBm4FjnNDdyLOLjppmE8HfAtm1R/Uq+2v fFluzWbfw4mOONop69Jo8CoJL4y0WTUF3OG1TWJTb+ywfC54eAFaIk5SAgp05w== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.01 X-Spam-Score: -3.01 X-Migadu-Queue-Id: 410343041E X-TUID: dTe2GlOvqWzk Awesome work! Note that you can run shepherd in user land too - that is a great feature. Pj. On Fri, Apr 28, 2023 at 03:37:12PM +0200, Ludovic Courtès wrote: > Hello Guix! > > I am pleased to announce that the first release candidate of version > 0.10.0 of the GNU Shepherd is available for testing! > > If you’re using Guix System or Guix Home, check out the instructions > below to give it a try. Please report success or failure! If you had > problems with previous versions, please check if they’re still there. > > code: https://alpha.gnu.org/gnu/shepherd/shepherd-0.10.0rc1.tar.gz > signature: https://alpha.gnu.org/gnu/shepherd/shepherd-0.10.0rc1.tar.gz.sig > sha256: 1x3lxsi6xhhds4pq30c3shydmhiidkf1wl2l7mxkpklmlycnbqgg > > In your operating system configuration (and similarly for your > ‘home-environment’), make the following changes: > > (use-modules (gnu packages admin)) > > (define shepherd-next > (package > (inherit shepherd) > (version "0.10.0rc1") > (source (origin > (method url-fetch) > (uri (string-append > "https://alpha.gnu.org/gnu/shepherd/shepherd-" > version ".tar.gz")) > (sha256 > (base32 > "1x3lxsi6xhhds4pq30c3shydmhiidkf1wl2l7mxkpklmlycnbqgg")))))) > > (operating-system > ;; … > (essential-services > (modify-services (operating-system-default-essential-services > this-operating-system) > (shepherd-root-service-type > config => (shepherd-configuration > (shepherd shepherd-next)))))) > > You can then reconfigure, reboot, and enjoy! > > You can also help with translation. An updated PO template should soon > be available at the Translation Project: > > https://translationproject.org/domain/shepherd.html > > My goal is for 0.10.x to be the last series before 1.0. The list of > changes is quite long—see the ‘NEWS’ excerpt below. > > Feedback more than welcome! > > Ludo’. > > > * Changes in 0.10.0 (yet to be released) > > ** Distinguish ‘starting’ and ‘stopping’ intermediate service statuses > > In previous version, a service would be either “running” or “stopped”. The > intermediate states “starting” and “stopping” are now properly captured and > you can see them when running ‘herd status’. > > ** ‘start’ and ‘stop’ block when service is already being started/stopped > > > With previous version, a client running ‘herd start SERVICE’ while SERVICE is > already being started would cause shepherd to attempt to start a second > instance of that service, ultimately resulting in confusion, disappointment, > and frustration. > > This is no longer the case: when a service is already being started/stopped, > additional invocation of ‘herd start’ or ‘herd stop’ now block until the > service is running/stopped. > > ** ‘shepherd’ starts services in parallel > > Services started with ‘start-in-the-background’ and more generally service > dependencies get started in parallel. This can reduce startup times in case > of a “wide” service dependency graph with some services that take a while to > start. > > ** ‘shepherd’ keeps track of failures and status change times > > For each service, shepherd maintains an event log including the time of recent > status changes as well as the time of startup failures, if any. The ‘herd > status SERVICE’ command now shows the time when the service entered its > current status and whether it failed to start; ‘herd status’ also prominently > lists services that failed to start. > > ** New ‘herd log’ command > > Related to the previous item, the new ‘herd log’ command displays an aggregate > of the service event logs, showing the time at which each service changed > statuses. > > ** New ‘herd graph’ command > > The new ‘herd graph’ command emits a Graphviz/Dot representation of the > service dependency graph, which can be viewed for example with ‘xdot’: > > herd graph | xdot - > > Guix System users get similar information with ‘guix system shepherd-graph’ > (and likewise for Guix Home). The difference here is that this reflects the > current system status, showing transient services, services that failed to > start, and so on. > > ** ‘herd’ output is colorized > > At long last! We hope you’ll enjoy a little bit of coloring to highlight > important bits in the output of various commands. > > ** New services shipped: ‘monitoring’ and ‘repl’ > > The Shepherd now ships with optional services—see “Service Collection” in the > manual. The ‘monitoring’ service logs resource usage of the ‘shepherd’ > process itself. The ‘repl’ service runs a read-eval-print loop (REPL) in the > ‘shepherd’ so you can hack it live—enjoy it, but handle it with care! > > ** Socket-actived, systemd-style services can now be started eagerly > > The ‘make-systemd-constructor’ procedure has a new #:lazy-start? parameter. > It defaults to #true, meaning that the process is started lazily, on the first > connection to one of its sockets, as was the case in 0.9.x. Passing > #:lazy-start? #false instructs shepherd to instead start the process eagerly, > as soon as the listening sockets are ready. > > This is useful for services that require socket activation as a startup > synchronization mechanism, yet are expected to run as soon as possible. An > example is ‘guix publish --advertise’: it should be started eagerly so it can > start advertising itself via Avahi. > > ** Each registered name maps to exactly one service > > There used to be a fuzzy notion of “conflicting services”, when a given > service name could potentially refer to more than one service. This has > proved to be confusing more than anything else; now, each registered service > name refers to exactly one service. The interface related to that feature, > such as the ‘conflicts-with’ method, is done. > > ** For systemd and inetd services, retry ‘bind’ upon EADDRINUSE > > > Services started with ‘make-systemd-constructor’ and ‘make-inetd-constructor’ > will now retry several times when ‘bind’ returns EADDRINUSE (“Address already > in use”) for their listening socket(s). > > ** ‘system’ and ‘make-system-constructor’ are now non-blocking > > > In versions up to 0.9.3, calling Guile’s ‘system’ procedure (which is what > ‘make-system-constructor’ does) would block the ‘shepherd’ process until the > shell spawned by ‘system’ has terminated. This is no longer the case. > > ** GOOPS interface is deprecated > > When it was created in 2002, the Shepherd (née dmd) embraced GOOPS, Guile’s > object-oriented programming system, then a brand new and promising approach > for 21st century programs. In hindsight, while there were a couple of classes > and a bunch of methods, the code base was not really making much use of GOOPS. > The current maintainer deemed it unnecessary and encouraging a programming > style at odds with the shiny horizon of purely functional, actor-style > programming. > > The GOOPS interface is still available in 0.10.0; for example, you can still > write ~(make #:provides …)~ in your configuration file. However, > GOOPS support will be removed in the next major series, most likely labeled > 1.0. > > A new interface has been defined. Check out the “Legacy GOOPS Interface” > section of the manual for more information, and email guix-devel@gnu.org if > you have any questions or concerns. > > ** Interfaces removed and changed > > Several obscure or undocumented interfaces were removed: > > - support for the ‘unknown’ service; > - support for “persistency” (sic); > - the ‘cd’ action of the ‘root’ service; > - the ‘launch-service’ procedure of (shepherd service). > > New deprecations: > > - ‘make-actions’ is deprecated in favor of ‘actions’; > - calling ‘register-services’ with an arbitrary number of arguments is now > deprecated; you should now call it with a single argument, the list of > services to register. > > ** Major internal overhaul > > As you can guess from the list of user-visible changes above, the Shepherd has > undergone a major internal overhaul. The 0.9.x series introduced the use of > Fibers, Guile’s lightweight concurrent facility; shepherd took advantage of it > notably with the introduction of systemd-style and inetd-style services. This > new stable series takes it further. > > In particular, each record has an associated fiber called the > “service controller”. Following the actor model, each of these fibers reacts > to messages it receives, be they event notification—e.g., process > termination—or user requests—e.g., querying the service status, requesting > that the service be stopped. Other noteworthy actors include the “process > monitor” and the “service registry”. > > This has allowed us to address a number of race conditions while also leading > to clearer code with linear flows that one can more easily reason about. > Overall, it makes the code base much more pleasant to work with and certainly > easier to hack than other implementations mired in the “callback hell”. > > Documentation has been overhauled as well to reflect all these changes. Check > out the new subsections under “Services” for more information.