From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QBqYDfNkhGVIEAEAkFu2QA (envelope-from ) for ; Thu, 21 Dec 2023 17:16:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id wDnKCfNkhGUwaQAAqHPOHw (envelope-from ) for ; Thu, 21 Dec 2023 17:16:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=cock.li header.s=mail header.b=P8QE5vsj; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703175411; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1ayNYp7D1FRyCvKZiAFKpK7v9pd/HJqVKzzM8BcJt30=; b=gir7AiqVZZTn9ru6acO+OVLqPki5lEyOr4bH0Y9DHhPRC+EQwkZUJUPFWgVuHSU/EB85gw JyJaaMHCXN+RyRDZlF4Rqi4DtmXm+Ly4oMcSSdRKLa/YyggaU9TJd9oruIMuvgOW60Ox1h mFlmdBb+qJ65ELzZrtADKp7LDevWyYr/UedmvdkWPtPcVUrn22rfYTlHrfCu0ECEM6q0ZW /l1qoOHktyIQLGreIZYsyCN7H7CKNLOOMd8qEH26uHN4mRR7SiORWQJAYFYwirPzksNm6C f8gkKysuSpyxhyA7wdIWf5y6QW0DZAWIdkfB/sSs2ewD7sZYlPa/3IE1R1HByQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703175411; a=rsa-sha256; cv=none; b=Bd/PgLt6iPgYgwE3YRJCdXRvC5Z4NabRz832B6emvd4gkoLshkQqecJfsCK6wVPUhExBmx mSLdzMuY3eU0TQ+9tRfrXnyMrBQSJulQmhF3Yz+JFptWqZLD7FWvTnvHnE6IPuneaMbuWl mjdYOHgihQ37hsCg/bhgwkAGOBmQPZZFHewth2LtzJltBS4jvTesQT6zP9hfAapGSYbG+D na4plBkO5rHCQixn1ecz9hh3yBDkLX+JULYsoRGKFK65uU1TIFTsi8qO5cHXE0qkat/8Su BYDsJzlDS3teqL0Nvxp9Vf4NeJTMGhGIjIOsD73YNOlKVO97BHANbLubID+OPw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=cock.li header.s=mail header.b=P8QE5vsj; 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"; dmarc=none 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 008D01B9A4 for ; Thu, 21 Dec 2023 17:16:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGLil-0007BV-BZ; Thu, 21 Dec 2023 11:16:27 -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 1rGKJl-0003Ru-3w for guix-devel@gnu.org; Thu, 21 Dec 2023 09:46:38 -0500 Received: from mail.cock.li ([37.120.193.123]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGKJi-0004ot-Om for guix-devel@gnu.org; Thu, 21 Dec 2023 09:46:32 -0500 From: Justin Veilleux DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cock.li; s=mail; t=1703169984; bh=NVtHILFEnr7+l+2oOGYNEer4xDacmDVUY/SGNeio/Dc=; h=From:To:Subject:Date:From; b=P8QE5vsjLMkTYlNf/rLkCU9YanJXJkGnIvE28UvJbggEajM70oYI+eWdhK7CNQlDb gti6Ho37FvFf4JDywJMc54bg2FRPD6Ib1nIKi19KmzMQVFjA+00tiD60ssG2bs8as5 9xkJDWs2jwsgD6LqW8LjQAhbdqoclhFJcwtKgHc/CKf0QcVwFmvywbp6Vt4g+Vy/9y gaiWpoNEdgX7ri5S7LdfFkELhBiWKGC5ZyhTU7/Lw8b+YOc/cUcm2ttieG68qsQ96I 6088lIf6IoWTr2/XCg1H81pzvACz5VlVjuUnP2junr8xeikKBwCQby9aBNn//NvZ/k NSmA7yg4Qb+dA== To: guix-devel@gnu.org Subject: using shepherd's (shepherd service repl) in guix system Date: Thu, 21 Dec 2023 09:46:21 -0500 Message-ID: <87r0jfliki.fsf@cock.li> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=37.120.193.123; envelope-from=terramorpha@cock.li; helo=mail.cock.li X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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-Mailman-Approved-At: Thu, 21 Dec 2023 11:16:24 -0500 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 X-Migadu-Spam-Score: -5.08 X-Spam-Score: -5.08 X-Migadu-Queue-Id: 008D01B9A4 X-Migadu-Scanner: mx12.migadu.com X-TUID: +KyxsdJZUeLR Hi. I thought it would be interesting to have a shepherd service run a repl like in https://www.gnu.org/software/shepherd/manual/html_node/REPL-Service.html. Since there is no shepherd repl service in a (gnu services *) module, I created a shepherd-service-type and shepherd-service (I copied the code from `(shepherd service repl)`) The `reconfigure` runs and after fiddling with permission bits and connecting to the socket through emacs and geiser (like in the manual), I am able to execute expressions such as `(+ 2 2)` and `(display "test\n")` and everything works as expected. However, when I try to evaluate `lookup-service` (without calling it), the repl gets stuck in an infinite loop of > scheme@(shepherd-user) [1]> While reading expression: > Attempt to suspend fiber within continuation barrier This is annoying, since inspecting the state of shepherd is my main use case for the REPL service. Has anyone encountered this problem? The `shepherd-repl-service-type`: > (define shepherd-repl-service-type > (service-type > (name 'shepherd-repl) > (description "Run a shepherd repl") > (default-value "/var/run/shepherd/repl") > (extensions > (list > (service-extension > shepherd-root-service-type > (lambda (socket-file) > (list > (shepherd-service > (documentation "Run the shepherd repl") > (provision '(repl)) > (requirement '()) > (start #~(lambda args > (format #t "socket file: ~s\n" #$socket-file) > (with-exception-handler > (lambda (exn) > #f) > (lambda () > (delete-file #$socket-file)) > #:unwind? #t) > (let ((socket (open-server-socket #$socket-file))) > ((@@ (shepherd service repl) spawn-repl-service) socket) > socket))) > (stop #~(lambda (socket) > (close-port socket) > #f)) > (modules (cons* > '(shepherd service repl) > '(shepherd comm) > %default-modules))))))))))