GNU Shepherd 0.10.0 released

Ludovic Courtès <[email protected]> Sat, 13 May 2023 16:24:32 +0200
Newsgroups gmane.comp.gnu.guix.devel,gmane.lisp.guile.sources,gmane.lisp.guile.user
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

We are pleased to announce the GNU Shepherd version 0.10.1.  This
release represents 132 commits by two people.  It is a major overhaul of
shepherd internals, addressing shortcomings and providing new features
that help comprehend system state.


=E2=80=A2 About

  The GNU Shepherd is a service manager written in Guile that looks
  after the herd of daemons running on the system.  It can be used as an
  =E2=80=9Cinit=E2=80=9D system (PID 1) and also by unprivileged users to m=
anage
  per-user daemons=E2=80=94e.g., tor, privoxy, mcron.  It supports several
  daemon startup mechanisms, including inetd and systemd-style socket
  activation.  The GNU Shepherd is configured in Guile Scheme and can be
  extended in the same language.  It builds on a simple memory-safe and
  callback-free programming model.

  The GNU Shepherd is developed jointly with the GNU Guix project; it is
  used as the init system of Guix, GNU=E2=80=99s advanced GNU/Linux distrib=
ution.

  https://www.gnu.org/software/shepherd/


=E2=80=A2 Download

  Here are the compressed sources and a GPG detached signature:
    https://ftp.gnu.org/gnu/shepherd/shepherd-0.10.0.tar.gz
    https://ftp.gnu.org/gnu/shepherd/shepherd-0.10.0.tar.gz.sig

  Use a mirror for higher download bandwidth:
    https://ftpmirror.gnu.org/shepherd/shepherd-0.10.0.tar.gz
    https://ftpmirror.gnu.org/shepherd/shepherd-0.10.0.tar.gz.sig

  Here are the SHA1 and SHA256 checksums:

  1b0895fa5a0709ae612be50d5a486c137d862168  shepherd-0.10.0.tar.gz
  Dl7kcFFihN35TBunXnj8aPvYImPlGPZlGtthKAlm6zY  shepherd-0.10.0.tar.gz

  The SHA256 checksum is base64 encoded, instead of the
  hexadecimal encoding that most checksum tools default to.

  Use a .sig file to verify that the corresponding file (without the
  .sig suffix) is intact.  First, be sure to download both the .sig file
  and the corresponding tarball.  Then, run a command like this:

    gpg --verify shepherd-0.10.0.tar.gz.sig

  The signature should match the fingerprint of the following key:

    pub   rsa4096 2014-08-11 [SC]
          3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
    uid           [  full  ] Ludovic Court=C3=A8s <[email protected]>
    uid           [  full  ] Ludovic Court=C3=A8s <[email protected]>
    uid           [  full  ] Ludovic Court=C3=A8s (Inria) <ludovic.courtes@=
inria.fr>

  If that command fails because you don't have the required public key,
  or that public key has expired, try the following commands to retrieve
  or refresh it, and then rerun the 'gpg --verify' command.

    gpg --recv-keys 3CE464558A84FDC69DB40CFB090B11993D9AEBB5

  As a last resort to find the key, you can try the official GNU
  keyring:

    wget -q https://ftp.gnu.org/gnu/gnu-keyring.gpg
    gpg --keyring gnu-keyring.gpg --verify shepherd-0.10.0.tar.gz.sig


  This release was bootstrapped with the following tools:
    Autoconf 2.71
    Automake 1.16.5
    Makeinfo 7.0.3
    Help2man 1.49.2


=E2=80=A2 Changes since version 0.9.3 (excerpt from the NEWS file)

  ** Distinguish =E2=80=98starting=E2=80=99 and =E2=80=98stopping=E2=80=99 =
intermediate service statuses

  In previous version, a service would be either =E2=80=9Crunning=E2=80=9D =
or =E2=80=9Cstopped=E2=80=9D.  The
  intermediate states =E2=80=9Cstarting=E2=80=9D and =E2=80=9Cstopping=E2=
=80=9D are now properly captured and
  you can see them when running =E2=80=98herd status=E2=80=99.

  ** =E2=80=98start=E2=80=99 and =E2=80=98stop=E2=80=99 block when service =
is already being started/stopped
    <https://issues.guix.gnu.org/54786#4>

  With previous version, a client running =E2=80=98herd start SERVICE=E2=80=
=99 while SERVICE is
  already being started would cause shepherd to attempt to start a second
  instance of that service, ultimately resulting in confusion, disappointme=
nt,
  and frustration.

  This is no longer the case: when a service is already being started/stopp=
ed,
  additional invocation of =E2=80=98herd start=E2=80=99 or =E2=80=98herd st=
op=E2=80=99 now block until the
  service is running/stopped.

  ** =E2=80=98shepherd=E2=80=99 starts services in parallel

  Services started with =E2=80=98start-in-the-background=E2=80=99 and more =
generally service
  dependencies get started in parallel.  This can reduce startup times in c=
ase
  of a =E2=80=9Cwide=E2=80=9D service dependency graph with some services t=
hat take a while to
  start.

  ** =E2=80=98shepherd=E2=80=99 keeps track of failures and status change t=
imes

  For each service, shepherd maintains an event log including the time of r=
ecent
  status changes as well as the time of startup failures, if any.  The =E2=
=80=98herd
  status SERVICE=E2=80=99 command now shows the time when the service enter=
ed its
  current status and whether it failed to start; =E2=80=98herd status=E2=80=
=99 also prominently
  lists services that failed to start.

  ** New =E2=80=98herd log=E2=80=99 command

  Related to the previous item, the new =E2=80=98herd log=E2=80=99 command =
displays an aggregate
  of the service event logs, showing the time at which each service changed
  statuses.

  ** New =E2=80=98herd graph=E2=80=99 command

  The new =E2=80=98herd graph=E2=80=99 command emits a Graphviz/Dot represe=
ntation of the
  service dependency graph, which can be viewed for example with =E2=80=98x=
dot=E2=80=99:

    herd graph | xdot -

  Guix System users get similar information with =E2=80=98guix system sheph=
erd-graph=E2=80=99
  (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.

  ** =E2=80=98herd=E2=80=99 output is colorized

  At long last!  We hope you=E2=80=99ll enjoy a little bit of coloring to h=
ighlight
  important bits in the output of various commands.

  ** New services shipped: =E2=80=98monitoring=E2=80=99 and =E2=80=98repl=
=E2=80=99

  The Shepherd now ships with optional services=E2=80=94see =E2=80=9CServic=
e Collection=E2=80=9D in the
  manual.  The =E2=80=98monitoring=E2=80=99 service logs resource usage of =
the =E2=80=98shepherd=E2=80=99
  process itself.  The =E2=80=98repl=E2=80=99 service runs a read-eval-prin=
t loop (REPL) in the
  =E2=80=98shepherd=E2=80=99 so you can hack it live=E2=80=94enjoy it, but =
handle it with care!

  ** Socket-actived, systemd-style services can now be started eagerly

  The =E2=80=98make-systemd-constructor=E2=80=99 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 eage=
rly,
  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 =E2=80=98guix publish --advertise=E2=80=99: it should be start=
ed 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 =E2=80=9Cconflicting services=E2=80=9D=
, 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 serv=
ice
  name refers to exactly one service.  The interface related to that featur=
e,
  such as the =E2=80=98conflicts-with=E2=80=99 method, is done.

  ** For systemd and inetd services, retry =E2=80=98bind=E2=80=99 upon EADD=
RINUSE
     <https://issues.guix.gnu.org/58485#13>

  Services started with =E2=80=98make-systemd-constructor=E2=80=99 and =E2=
=80=98make-inetd-constructor=E2=80=99
  will now retry several times when =E2=80=98bind=E2=80=99 returns EADDRINU=
SE (=E2=80=9CAddress already
  in use=E2=80=9D) for their listening socket(s).

  ** =E2=80=98system=E2=80=99 and =E2=80=98make-system-constructor=E2=80=99=
 are now non-blocking
     <https://issues.guix.gnu.org/61803>

  In versions up to 0.9.3, calling Guile=E2=80=99s =E2=80=98system=E2=80=99=
 procedure (which is what
  =E2=80=98make-system-constructor=E2=80=99 does) would block the =E2=80=98=
shepherd=E2=80=99 process until the
  shell spawned by =E2=80=98system=E2=80=99 has terminated.  This is no lon=
ger the case.

  ** GOOPS interface is deprecated

  When it was created in 2002, the Shepherd (n=C3=A9e dmd) embraced GOOPS, =
Guile=E2=80=99s
  object-oriented programming system, then a brand new and promising approa=
ch
  for 21st century programs.  In hindsight, while there were a couple of cl=
asses
  and a bunch of methods, the code base was not really making much use of G=
OOPS.
  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 st=
ill
  write ~(make <service> #:provides =E2=80=A6)~ in your configuration file.=
  However,
  GOOPS support will be removed in the next major series, most likely label=
ed
  1.0.

  A new interface has been defined.  Check out the =E2=80=9CLegacy GOOPS In=
terface=E2=80=9D
  section of the manual for more information, and email [email protected] =
if
  you have any questions or concerns.

  ** Interfaces removed and changed

  Several obscure or undocumented interfaces were removed:

    - support for the =E2=80=98unknown=E2=80=99 service;
    - support for =E2=80=9Cpersistency=E2=80=9D (sic);
    - the =E2=80=98cd=E2=80=99 action of the =E2=80=98root=E2=80=99 service;
    - the =E2=80=98launch-service=E2=80=99 procedure of (shepherd service).

  New deprecations:

    - =E2=80=98make-actions=E2=80=99 is deprecated in favor of =E2=80=98act=
ions=E2=80=99;
    - calling =E2=80=98register-services=E2=80=99 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 Shepher=
d has
  undergone a major internal overhaul.  The 0.9.x series introduced the use=
 of
  Fibers, Guile=E2=80=99s lightweight concurrent facility; shepherd took ad=
vantage of it
  notably with the introduction of systemd-style and inetd-style services. =
 This
  new stable series takes it further.

  In particular, each <service> record has an associated fiber called the
  =E2=80=9Cservice controller=E2=80=9D.  Following the actor model, each of=
 these fibers reacts
  to messages it receives, be they event notification=E2=80=94e.g., process
  termination=E2=80=94or user requests=E2=80=94e.g., querying the service s=
tatus, requesting
  that the service be stopped.  Other noteworthy actors include the =E2=80=
=9Cprocess
  monitor=E2=80=9D and the =E2=80=9Cservice registry=E2=80=9D.

  This has allowed us to address a number of race conditions while also lea=
ding
  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 certa=
inly
  easier to hack than other implementations mired in the =E2=80=9Ccallback =
hell=E2=80=9D.

  Documentation has been overhauled as well to reflect all these changes.  =
Check
  out the new subsections under =E2=80=9CServices=E2=80=9D for more informa=
tion.

  ** Updated translations: de, ro, uk

  The Shepherd is fully translated in German, Romanian, and Ukrainian; part=
ial
  translations are available for a dozen of languages.  To help make the
  Shepherd speak your language, check out the Translation Project:

    https://translationproject.org/domain/shepherd.html


Please report bugs to [email protected].
Join [email protected] for discussions.

Ludovic, on behalf of the Shepherd herd.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJBBAEBCgArFiEEPORkVYqE/cadtAz7CQsRmT2a67UFAmRfnaENHGx1ZG9AZ251
Lm9yZwAKCRAJCxGZPZrrtdG+D/9/As42jrBJVq48hJKv5CIA64rAx5KYKf7oVmfX
CVBxMCEwY21DWsgdervZAVDt64tOJvAArjpZmeQJlrP6kQ9sBK8OwOgT9z0Xpv6F
MIr5RavsmTryzRSZ+SqyXbSVpbIl/jD1d6g5SZ6WHmtq9slXC9k0P2oxC63suuLx
D2OuzJBb913x4IMxIc9KLaAciOCq6x/qB13ipU+JPBd8nW/sbpYEWpSdR7ZDE8K3
prLzDvRjDPcZPIYKAUTfns4SXWcTjbMEI6qPrBhEPRJXgpV3MXKaWHq8un0w0nd/
GgZHrPDGNnwzgYLGN6Xarw6oTaTHa4t+kh4yts802cOHPKWhT8Zklk/cGrKT4qpS
Fvh5mzyRgIl/T1I0a4qa/0TBxSrUowo+BI+Tho8uZrtcpkiWooS+ePPbfKMiTksv
g7/PDBcZSvRdWcf2gSoCfQ0u/TO830QgS2BwvlrYXTi6CDz7CNmxw6xJ5CIDKCY1
7Pren2Yo/hN7JuG50N0A9sgpXLb9ViHFHZmTnAULsfcrYF8ABo4vpi4qq4W3KIQf
L8fL/OC9ztvnPjCN+b/VAmJswiCjyXDKJibZUwGQ8CZl69E3ZfhG6xANYjBXpuZJ
fpgiHqscFWNhdD+lTKAaD7Mwo//J8w3JQVKMSw/iD8BsKl+cfXrlGe7QBpmaXgpt
2l3vmQ==
=Q4Aw
-----END PGP SIGNATURE-----
--=-=-=--