From patchwork Wed Feb 21 16:47:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 60874 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3207F27BBE2; Wed, 21 Feb 2024 17:11:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D47A027BBE9 for ; Wed, 21 Feb 2024 17:11:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcq7G-0003Ye-TV; Wed, 21 Feb 2024 12:10:42 -0500 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 1rcq7E-0003Y2-T5 for guix-patches@gnu.org; Wed, 21 Feb 2024 12:10:40 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcq7E-0006Bb-I0 for guix-patches@gnu.org; Wed, 21 Feb 2024 12:10:40 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcq7a-00088y-R1 for guix-patches@gnu.org; Wed, 21 Feb 2024 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69302] [PATCH 2/2] doc: Add =?utf-8?b?4oCcSW5zcGVjdGluZyBTZXJ2?= =?utf-8?b?aWNlc+KAnQ==?= section. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Feb 2024 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69302 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69302@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 69302-submit@debbugs.gnu.org id=B69302.170853541231119 (code B ref 69302); Wed, 21 Feb 2024 17:11:02 +0000 Received: (at 69302) by debbugs.gnu.org; 21 Feb 2024 17:10:12 +0000 Received: from localhost ([127.0.0.1]:55147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcq6m-00085p-CC for submit@debbugs.gnu.org; Wed, 21 Feb 2024 12:10:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcptZ-0004ht-NI for 69302@debbugs.gnu.org; Wed, 21 Feb 2024 11:56:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcpl3-0008WV-7k; Wed, 21 Feb 2024 11:47:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ofQVT7g62sEJgTdJrwpeenupjuO0qtlaJfyIPf0BMTs=; b=AkDr4bVwNmiGcwmTsDZo BwidyGYdRZO+k2bkAQBovnXHrkbbAK6GschhBNyMluCVuHOlcnWgqR3quiWC9cQNfSXBvOSksn+wZ GhBHCSNprYBGNXeGjA8NKNghLS5qyFVsvNVq6cCr+5zYXIwL9LPlbDqYs9P2HMfJnH7w0RHzHFLls zoLhE9D783kKjqpx5Kvf66NirAQmbYEz1Frdn8uHIJtKUguL3/9bdWcPkqZ51EEonQj+HFfD6b/yr QSwyA9hh5kpKPm9HO6HydVDc45Q6bV2B+2aJyLPoHIWbd9q+hhJDk6OIX9Hr4ZcdlCHrSOwsWGW5M k2QrGHzDdbCq5A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 21 Feb 2024 17:47:30 +0100 Message-ID: <29cc7ff49d15dda51a3c2eb091a4bf603d1f097b.1708527097.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Inspecting Services): New subsection. Change-Id: I71378101de913a494e0d0e93cc76434c5a70b520 --- doc/guix.texi | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index e7f59c8bfd..ea2629a768 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17513,6 +17513,61 @@ Using the Configuration System (delete avahi-service-type)) @end lisp +@unnumberedsubsec Inspecting Services + +@cindex troubleshooting, for system services +@cindex inspecting system services +@cindex system services, inspecting +As you work on your system configuration, you might wonder why some +system service doesn't show up or why the system as not as you expected. +There are several ways to inspect and troubleshoot problems. + +@cindex dependency graph, of Shepherd services +First, you can inspect the dependency graph of Shepherd services like +so: + +@example +guix system shepherd-graph /etc/config.scm | \ + guix shell xdot -- xdot - +@end example + +This lets you visualize the Shepherd services as defined in +@file{/etc/config.scm}. Each box is a service as would be shown by +@command{herd status} on the running system, and each arrow denotes a +dependency (in the sense that if service @var{A} depends on @var{B}, +then @var{B} must be started before @var{A}). + +@cindex extension graph, of services +Not all ``services'' are Shepherd services though, since Guix System +uses a broader definition of the term (@pxref{Services}). To visualize +system services and their relations at a higher level, run: + +@example +guix system extension-graph /etc/config.scm | \ + guix shell xdot -- xdot - +@end example + +This lets you view the @dfn{service extension graph}: how services +``extend'' each other, for instance by contributing to their +configuration. @xref{Service Composition}, to understand the meaning of +this graph. + +Last, you may also find it useful to inspect your system configuration +at the REPL (@pxref{Using Guix Interactively}). Here is an example +session: + +@example +$ guix repl +scheme@@(guix-user)> ,use (gnu) +scheme@@(guix-user)> (define os (load "config.scm")) +scheme@@(guix-user)> ,pp (map service-kind (operating-system-services os)) +$1 = (# + @dots{}) +@end example + +@xref{Service Reference}, to learn about the Scheme interface to +manipulate and inspect services. + @unnumberedsubsec Instantiating the System @cindex system instantiation