From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nicolas Graves via "Development of GNU Guix and the GNU System distribution." Newsgroups: gmane.comp.gnu.guix.devel,gmane.emacs.devel Subject: Re: [Nicolas Graves] [PATCH v6 01/10] rde: emacs: Start emacs in --daemon mode, with shepherd and pid-file Date: Sat, 13 Apr 2024 17:09:41 +0200 Message-ID: <87bk6d47uy.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> Reply-To: Nicolas Graves Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25291"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Andrew Tropin , Stefan Monnier To: Ludovic =?utf-8?Q?Court=C3=A8s?= , "Nicolas Graves via Development of GNU Guix and the GNU System distribution." Original-X-From: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sat Apr 13 17:10:38 2024 Return-path: Envelope-to: gcggd-guix-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rvf1a-0006Lg-07 for gcggd-guix-devel@m.gmane-mx.org; Sat, 13 Apr 2024 17:10:38 +0200 Original-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 Original-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 Original-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 Original-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) Original-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) Original-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 Authentication-Results: garm.ovh; auth=pass (GARM-109S003f2767a0b-7e03-4c75-840b-459d8b37af0b, 680F127F37A04776A64DED9A59A7121AD484C431) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 In-Reply-To: <87frvp4a4u.fsf@ngraves.fr> X-Ovh-Tracer-Id: 11544414696309252789 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeiiedgkeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeefieethffggfeggfdtjeejleeuvdffheeuieekffeukeffhfetteelgeehveevgeenucffohhmrghinhepfhhrvggvuggvshhkthhophdrohhrghdpghhnuhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdguvghvvghlsehgnhhurdhorhhgpdfovfetjfhoshhtpehmoheh keefpdhmohguvgepshhmthhpohhuth 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: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Original-Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.comp.gnu.guix.devel:69913 gmane.emacs.devel:317710 Archived-At: 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