From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SG+gFu5AU2K6ugAAgWs5BA (envelope-from ) for ; Sun, 10 Apr 2022 22:41:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CPgTFO5AU2LaVwEA9RJhRA (envelope-from ) for ; Sun, 10 Apr 2022 22:41:18 +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 1C5628ED3 for ; Sun, 10 Apr 2022 22:41:18 +0200 (CEST) Received: from localhost ([::1]:51260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndeN2-00043l-Us for larch@yhetil.org; Sun, 10 Apr 2022 16:41:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndeMa-00043Y-SH for guix-devel@gnu.org; Sun, 10 Apr 2022 16:40:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndeMa-00047J-J9; Sun, 10 Apr 2022 16:40:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=oB8Vfz1A5le/fi7PWJFNDr8xPkl1bfGcse3BSFEVcZY=; b=BYCTsb65hJ0Y31GflrAZ q+M5qBJazNPmH6ifs9QBjJcgZw7NsqYz1nqA9z8xKYumP/NbwRaqXB1k5VEO1YxxKJ8hBCWDDMv5p 3h7G2oks7m3ZZJL6Kkx3jL8uEBsLCmh+pI/QahWD5Qb+axhBLGR/w9KLj/6vPK+RYHS56zW1/YMAR RvNol5W8hxK2C8aMsKh4tG5Deakb+/nIrNUrb5Jvxnj6CJbv7fYpDdjRWoUpHs350lpGUkBlAoJ/j KVEFs+G84Mfi2C6LHFdl1zUTHS7EzYTCiZFOF2Bihkhr5gkx83lJEYjtJpdcfZ2nOrzVHXfhLXR61 vx3e4YvpKaFDTA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54939 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndeMa-0007LO-6M; Sun, 10 Apr 2022 16:40:48 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Liliana Marie Prikler Subject: Re: Sockets in Shepherd, and Emacs, oh my! References: <8de0693f22bf19263406b448f587f6b0eb0195a0.camel@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 21 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 10 Apr 2022 22:40:46 +0200 In-Reply-To: <8de0693f22bf19263406b448f587f6b0eb0195a0.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 08 Apr 2022 20:40:30 +0200") Message-ID: <87o8184qpd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649623278; 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:dkim-signature; bh=oB8Vfz1A5le/fi7PWJFNDr8xPkl1bfGcse3BSFEVcZY=; b=LaxtQtEHGcLh6xswoOFytHBE4IiSMHjOKVejFlD52zRfE8Z4qHehvtEvXhb4Fdhw6VsepL 8+/PVit3NRQBn6Tc3KphFHQs+TdlO9BMhwww0uzARai3ib+1m9Xbn73c8Vzvk/pcQdNdz0 QrLcc+4fYjSGagv1/ycoAiSjcIy5wobPONdd+LoG7nlXHkdcO6PoK3eZswLaHbrg/RDXY3 W3YD8lmKFmZ2P2/KyvCyVx/3RmOT1rZoqLOsB15kGgIQD9dylPbex5pAD13QLOjHy34zty 8ln3328tlh1KcmZh79MdRIKUACoj+dDHSEfRkbeU9xPF2mFjFuREXFHulIP0aA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649623278; a=rsa-sha256; cv=none; b=Exd7xNY6ivgu4lAda/dOS+mvHgynLhgaYReFNzDSAES1sHH0NoFdvQ/W9FQobSU/3f9nkC if7mNqLOxTvq+N5GZAPJVVV5fk2PgkyWrVTx590LlFSvBWQXaFA48jPvYc+iYRpgpiQ7ql iRw07rTBguYH6S368a7DhwI2EVwThZvsiQBTnPUZ0/2W88T76P6k4MaxEUVLPMKYwQjauy xGHp1jyIvDWIkDN7Z4k1Gu+3mZ+3NKbwE8wlA8fXj+Pn7R2XypsXt5uGhWhz7oBU0td2a4 qavk1QU5K5oB+jaW+/DbEjciRFgCQCr+qgVm7NOqMm7YbS9ZYvy2s1DpxPIWpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=BYCTsb65; dmarc=pass (policy=none) header.from=gnu.org; 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: -9.57 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=BYCTsb65; dmarc=pass (policy=none) header.from=gnu.org; 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-Queue-Id: 1C5628ED3 X-Spam-Score: -9.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: BJFzzPf1veww Hallo! Liliana Marie Prikler skribis: > given that Shepherd 0.9.0 adds support for systemd-style socket > activation and Emacs supports that (if linked against systemd!) I > wanted to try it out. Here's my "generic" recipe for constructing > an Emacs service: > > (define* (emacs #:key (name 'server) > (uid (getuid)) > (gid (getgid))) > (make > #:provides (list > (symbol-append 'emacs@ name)) > #:requires '() > #:start > (make-systemd-constructor > (list "emacs" "--fg-daemon") > (list (endpoint > (make-socket-address AF_UNIX > (format #f "/run/user/~d/emacs/~s" > uid name)) > #:socket-owner uid > #:socket-group gid))) > #:stop (make-systemd-destructor))) Fun! Good to see this put to good use. :-) > There appear to be some bugs, though. If shepherd launches a process > via systemd-constructor and it dies before claiming the socket, it > will become a zombie. What do you mean by =E2=80=9Cclaiming the socket=E2=80=9D? Do you have a l= og file showing this, or at (better yet) a small reproducer? You can use =E2=80=98tests/systemd.sh=E2=80=99 as a starting point. > Further, if the process dies after having claimed the socket, shepherd > will not reset service's entry points and running value. Both should > be fixable in my opinion. The running value is changed as soon as the child process is started by =E2=80=98make-systemd-constructor=E2=80=99, AFAICS. But maybe I=E2=80=99m = overlooking something. > So, what's for the future? If someone wants to do so, they could > adapt my shepherd service for Guix Home. It'd be very nice to one > day be able to spawn an Emacs service fine-tuned to desired editing > purposes. Think of using `guix shell --container' building packages > that you'd otherwise rarely need on demand, for example. > > With that in mind, happy hacking! Sounds fun! Ludo=E2=80=99.