From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id IAWLGHCrUWYgGAEAqHPOHw:P1 (envelope-from ) for ; Sat, 25 May 2024 11:12:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IAWLGHCrUWYgGAEAqHPOHw (envelope-from ) for ; Sat, 25 May 2024 11:12:16 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PMwKo2xk; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716628336; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=uMQM1ZSvWN9RfRxpynvGYLmgTxZaAhoS8pngWsR6RQ8=; b=VRWqdvA7Boxk26FcGq7xLPGo7gxJvSH++EKWFL40Wj0LECXLnetiFeJ0911S2QvK4FLVb0 OhkMR/dhmB8HDEsLBd7cC0A7feXEDYOnDrIMr84FhxtE82u3PYq3GZT0PCXeWczRaLnM54 AQTxNTvmZQ5eEyp6j4q2ra7usc1VyV3+Fm+YQsR+WrAgJNa/aXPkXv0sMTiyAyFt76sG71 uBzxdF5FWJDoOlW165IeyPAhoaKs4jaB0Ja3bBufrnERxTBp1H3RqGj52zC9lZufg+NbSv 8JspWXu1LAJUC7upoY/99/OEqfPiVbed9F3ljndzLQ3EReVHzThp+3/GMQHdIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PMwKo2xk; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716628336; a=rsa-sha256; cv=none; b=Z0o2jB5tgS5No1bVsqJlMb/rgVHV/sb56tZ2IG4WYsxyIoDjPowDMVtu4QYsefadG5z+XU cB628AXanBGOheRSNUwCx3eT6mdwUUcfgVFisJE5YXtUyPAftgSlKzPo1yXyPqGiqDwAp7 rAfjjmzZjtkANDdiI2lhPqAnDLS7fWI9Y7pC20h2E+vFp9+hSL8QTSdMSf7ZwAC7/HbfVD pnSYaDpdEZpTyhFXtBf1k4yoc/TdKz5NtgZ0Lu6+urXYceKo0xorJ25r1nSGAuF0LYAhtp Tv18ggmISP4yinJMZvLuVU29f8JQZv8C+ExPPYQht7BipjwnrNM1KCKCxVYb6Q== 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 01EE152B52 for ; Sat, 25 May 2024 11:12:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAnRU-00051q-6q; Sat, 25 May 2024 05:11:56 -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 1sAnRT-00051R-8k for bug-guix@gnu.org; Sat, 25 May 2024 05:11:55 -0400 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 1sAnRT-00082H-01 for bug-guix@gnu.org; Sat, 25 May 2024 05:11:55 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAnRa-00024j-Cl for bug-guix@gnu.org; Sat, 25 May 2024 05:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#71144: Interactive prompt opened upon shepherd config file error Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 25 May 2024 09:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71144 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 71144@debbugs.gnu.org Cc: Andreas Enge , Christopher Baines Received: via spool by 71144-submit@debbugs.gnu.org id=B71144.17166282837959 (code B ref 71144); Sat, 25 May 2024 09:12:02 +0000 Received: (at 71144) by debbugs.gnu.org; 25 May 2024 09:11:23 +0000 Received: from localhost ([127.0.0.1]:42253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnQx-00024J-Cp for submit@debbugs.gnu.org; Sat, 25 May 2024 05:11:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnQv-00024C-1X for 71144@debbugs.gnu.org; Sat, 25 May 2024 05:11:21 -0400 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 1sAnQh-0007wF-Tz; Sat, 25 May 2024 05:11:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=uMQM1ZSvWN9RfRxpynvGYLmgTxZaAhoS8pngWsR6RQ8=; b=PMwKo2xkDCZXAz34uSuT Jhz/6U27o1XKaH/hb/Hp7yRJwMVsBC8ZOqq5Vr9kv2tuanPyQAbJQjO+Z3f4f3sF3Efgox4i0bUdn kNFS1KQVeT1/R/GmMnKefDWXeVXblO9PNID545OOTR+byb1KKlIGzgEN4fpzJCJQtLXcJ/xYv8mwg DSOqnarrBlRTXWNawmyNp4EDQGvueCxrcMNP/Gf2smlDcEnu/Ds8c6x2cVO/B/3tvmYRh8SMEegXk /iD4XpCu34gl9MIQb1+iiQ0iLO3Be66PnLvtvyipbG92oAuSwGRGUpqHA15kns/DGyg+TjKO1utyJ 3Uz9cVW8HUiQqw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <87sey894kj.fsf@inria.fr> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 23 May 2024 12:59:40 +0200") References: <87sey894kj.fsf@inria.fr> Date: Sat, 25 May 2024 11:11:04 +0200 Message-ID: <878qzy45p3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.25 X-Spam-Score: -6.25 X-Migadu-Queue-Id: 01EE152B52 X-Migadu-Scanner: mx13.migadu.com X-TUID: 1XCFndaZPkTc --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > I think we should change the above to log and gracefully handle failure > to load an individual service file. With the change below, every service except the offending one is loaded and started as expected: --8<---------------cut here---------------start------------->8--- [ 22.450515] shepherd[1]: Service root running with value #t. [ 22.454624] shepherd[1]: Service root has been started. [ 22.711738] shepherd[1]: Exception caught while loading '/gnu/store/fjis= 6iqpjfcnr90fy8rsg9v4j828jslv-shepherd-gwl-web.go': #<&compound-exception co= mponents: (#<&undefined-variable> #<&origin origin: #f> #<&message message:= "Unbound variable: ~S"> #<&irritants irri [ 22.711839] tants: (make-forkexec-constructor/container)> #<&exception-w= ith-kind-and-args kind: unbound-variable args: (#f "Unbound variable: ~S" (= make-forkexec-constructor/container) #f)>)> [ 22.755146] shepherd[1]: starting services... [ 22.756491] shepherd[1]: Configuration successfully loaded from '/gnu/st= ore/mq7y31xnjcjwjkyf6w7qiaq61g6n9f5x-shepherd.conf'. Uncaught exception in task: In fibers.scm: 172:8 7 (_) In ice-9/exceptions.scm: 406:15 6 (_) In ice-9/boot-9.scm: 1752:10 5 (with-exception-handler _ _ #:unwind? _ # _) In shepherd/service.scm: 824:39 4 (_) In oop/goops.scm: 1567:11 3 (cache-miss #f) 1585:2 2 (_ _ _) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1683:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1683:16: In procedure raise-exception: No applicable method for #< one-shot-service? (1)> in call (one-sh= ot-service? #f) [ 22.798737] shepherd[1]: Starting service user-file-systems... [ 22.800361] shepherd[1]: Starting service root-file-system... [ 22.802015] shepherd[1]: Starting service host-name... [ 22.803688] shepherd[1]: Starting service pam... [ 22.805372] shepherd[1]: Starting service sysctl... [ 22.806926] shepherd[1]: Starting service loopback... [ 22.808225] shepherd[1]: Starting service firewall... --8<---------------cut here---------------end--------------->8--- (There=E2=80=99s still this scary-looking but harmless backtrace in the mid= dle: that=E2=80=99s because (start-in-the-background '(something-that-does-not-e= xist)) throws like that as of 0.10.4.) Once booted, shepherd is fine and you can interact normally with it; the only thing missing is, in this case, the =E2=80=98gwl-web=E2=80=99 service,= which we failed to load. I think that=E2=80=99s a significant improvement. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 455e972535d..f13c52c37ba 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -380,8 +380,7 @@ (define (shepherd-configuration-file services shepherd) (scm->go (cute scm->go <> shepherd))) (define config #~(begin - (use-modules (srfi srfi-34) - (system repl error-handling)) + (use-modules (srfi srfi-1)) (define (make-user-module) ;; Copied from (shepherd support), where it's private. @@ -417,17 +416,22 @@ (define (shepherd-configuration-file services shepherd) ;; Arrange to spawn a REPL if something goes wrong. This is better ;; than a kernel panic. - (call-with-error-handling - (lambda () - (register-services - (parameterize ((current-warning-port - (%make-void-port "w"))) - (map (lambda (file) - (save-module-excursion - (lambda () - (set-current-module (make-user-module)) - (load-compiled file)))) - '#$(map scm->go files)))))) + (register-services + (parameterize ((current-warning-port (%make-void-port "w"))) + (filter-map (lambda (file) + (with-exception-handler + (lambda (exception) + (format #t "Exception caught \ +while loading '~a': ~s~%" + file exception) + #f) + (lambda () + (save-module-excursion + (lambda () + (set-current-module (make-user-module)) + (load-compiled file)))) + #:unwind? #t)) + '#$(map scm->go files)))) (format #t "starting services...~%") (let ((services-to-start --=-=-=--