From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id mGCZHW2gGmbmjAAA62LTzQ:P1 (envelope-from ) for ; Sat, 13 Apr 2024 17:10:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mGCZHW2gGmbmjAAA62LTzQ (envelope-from ) for ; Sat, 13 Apr 2024 17:10:37 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713021037; h=from:from:sender:sender:reply-to: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; bh=mWEEXnsCwVIeePF5iA9KueOyZfthm041h6o3dYpg4KI=; b=fTS/dkkiOBJJ2I8mwN475jmNDP+6nfSngHsM8QUYLfYNf4HqGTnA91rvrD5TlISI7RuLR/ WTpFgvPH4O5UJDM8e6QQMc5gHxsb2cL0wgfC+zihuzV/63tkEqxzbtmSYIr6E4am/4d6mm vTLCiq/mnbO8MRiq+ya9kAlWoitTswuk4fzr0/PjH0LwEYie6HOwN7HGpNwFKc112gyrKu GwneoKs32MpNTSICPZEUhlZtcObrCnXbEsPAaVsDKB6LjMFFqluaQWl90mFyURoySrE52+ kaUoQsUshjuFtJ/SAd1o13COpzKTwk7z/Ziecr4UJtul4+ZjTBi+h4tcdFRK1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713021037; a=rsa-sha256; cv=none; b=C7xgF6sPaEmPkfpmLckrUcyyjtQNJbBt6pAHgy1yJwYG3Zbg5u+AtP9BXG3ej+sfIlOEzG JlraRV1iorCSTEmcm0KLIJX9XOIaGQMSu1vrHsJS+Vw8ie2YRHuITxHYm5hSn2Jzebphhj tJ/LWqfPHLCdru0J+2+UVbg3gIC2LtUM7Ute2Z5F6d39v6BCX+tdpUuLKeeld5atC5AF+T UE7kkNFo93oDinT6QB8ydpM3m3Tfw3f1fqpQjHObOFV4U2vfqE3IST+KyJV0pcd8SZ/Ve8 Ys+rydIXrJ7DGbvjZbS5t6rKmZzeo5hjygPXnAd7S3k+nnV18Xf1i4CWt603Mg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=pass (policy=none) header.from=gnu.org 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 55D1E30546 for ; Sat, 13 Apr 2024 17:10:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvf0r-0007xx-Uv; Sat, 13 Apr 2024 11:09:54 -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 1rvf0n-0007xQ-IC for guix-devel@gnu.org; Sat, 13 Apr 2024 11:09:49 -0400 Received: from 12.mo583.mail-out.ovh.net ([46.105.39.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvf0l-0001Tt-8R for guix-devel@gnu.org; Sat, 13 Apr 2024 11:09:49 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.108.17.95]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4VGxgB6DhGz1RSR for ; Sat, 13 Apr 2024 15:09:42 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-9sc49 (unknown [10.110.96.9]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 2FA1D1FE67; Sat, 13 Apr 2024 15:09:42 +0000 (UTC) Received: from ngraves.fr ([37.59.142.109]) by ghost-submission-6684bf9d7b-9sc49 with ESMTPSA id FqUKCDagGmbobgEAFz+ftA (envelope-from ); Sat, 13 Apr 2024 15:09:42 +0000 X-OVh-ClientIp: 81.67.146.208 To: Ludovic =?utf-8?Q?Court=C3=A8s?= , "Nicolas Graves via Development of GNU Guix and the GNU System distribution." Cc: emacs-devel@gnu.org, Andrew Tropin , Stefan Monnier Subject: Re: [Nicolas Graves] [PATCH v6 01/10] rde: emacs: Start emacs in --daemon mode, with shepherd and pid-file In-Reply-To: <87frvp4a4u.fsf@ngraves.fr> References: <20240410234923.29319-2-ngraves@ngraves.fr> <875xwotg35.fsf@trop.in> <87zfu0m9ps.fsf@ngraves.fr> <87jzl22u5w.fsf@gnu.org> <87frvp4a4u.fsf@ngraves.fr> Date: Sat, 13 Apr 2024 17:09:41 +0200 Message-ID: <87bk6d47uy.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 11544414696309252789 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeiiedgkeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeefieethffggfeggfdtjeejleeuvdffheeuieekffeukeffhfetteelgeehveevgeenucffohhmrghinhepfhhrvggvuggvshhkthhophdrohhrghdpghhnuhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdguvghvvghlsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.39.65; envelope-from=ngraves@ngraves.fr; helo=12.mo583.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: , Reply-to: Nicolas Graves From: Nicolas Graves via "Development of GNU Guix and the GNU System distribution." 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: -6.88 X-Spam-Score: -6.88 X-Migadu-Queue-Id: 55D1E30546 X-Migadu-Scanner: mx12.migadu.com X-TUID: zNMZf6pVq4WG On 2024-04-13 16:20, Nicolas Graves wrote: > On 2024-04-12 22:38, Ludovic Court=C3=A8s wrote: > >> Hi Nicolas, >> >> Nicolas Graves skribis: >> >>> As promised to Stefan a few months ago, here's a use case of >>> Shepherd/Emacs implementation that we developped in RDE. >> >> Would be nice to have it in Guix Home! > > I am commited to merge RDE contributions upstream when this is possible, > I will when it's mature enough / adapted for Guix ;) > >> >>> We're using the --daemon option on the Shepherd side to launch the >>> server in the background, include code in Emacs configuration to make it >>> create a pid-file as soon as the server has started, and redefine >>> kill-emacs to be managed by the Shepherd. >> >> Emacs supports systemd-style socket activation so, instead of using a >> PID file, you could use =E2=80=98make-systemd-constructor=E2=80=99. >> >> Now, that code in emacs.c is unfortunately implemented via libsystemd >> and thus disabled in Guix. Using libsystemd in this case is unnecessary >> (and increases the attack surface, as we=E2=80=99ve seen with the xz bac= kdoor): >> it could read the =E2=80=98LISTEN_FDS=E2=80=99 and =E2=80=98LISTEN_PID= =E2=80=99 environment variables >> instead of calling the sd_* functions. >> >> https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.= html >> https://www.gnu.org/software/shepherd/manual/html_node/Service-De_002d= -and-Constructors.html#index-make_002dsystemd_002dconstructor > > Thanks Ludo, that is precisely the feedback I was looking for. > > Maybe some feedback on the Emacs side about this? There are indeed very > few places where systemd sd_* functions are called in emacs.c, should we > try and re-implement them instead of using the library as is? Would that > be a contribution Emacs devs would be interested in? That would > definitely be beneficial for Emacs on Guix as highlighted by Ludo'. For the Guix side: it seems to be possible without Emacs source code change and by using elogind instead of systemd, there seems to be some code in configure.ac to handle this case. Will try this. > >> >> Thanks, >> Ludo=E2=80=99. --=20 Best regards, Nicolas Graves