From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Leach Newsgroups: gmane.emacs.devel Subject: Re: [PATCH v5] Add systemd socket launching support Date: Thu, 21 Apr 2016 21:59:30 +0100 Message-ID: <874maun0el.fsf@mattleach.net> References: <871t6do8w1.fsf@mattleach.net> <87inzkrs8c.fsf@mattleach.net> <5713224F.9040602@cs.ucla.edu> <87h9f0ealq.fsf@mattleach.net> <57147449.4060307@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461272401 18111 80.91.229.3 (21 Apr 2016 21:00:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Apr 2016 21:00:01 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 21 22:59:51 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1atLhV-00018u-T4 for ged-emacs-devel@m.gmane.org; Thu, 21 Apr 2016 22:59:50 +0200 Original-Received: from localhost ([::1]:47972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atLhV-00057L-HL for ged-emacs-devel@m.gmane.org; Thu, 21 Apr 2016 16:59:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atLhE-00054d-Td for emacs-devel@gnu.org; Thu, 21 Apr 2016 16:59:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atLh9-0007X3-UD for emacs-devel@gnu.org; Thu, 21 Apr 2016 16:59:32 -0400 Original-Received: from mx0.mattleach.net ([176.58.118.143]:56130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atLh9-0007VP-PT for emacs-devel@gnu.org; Thu, 21 Apr 2016 16:59:27 -0400 Original-Received: by mx0.mattleach.net (Postfix, from userid 99) id 74A8C6222E; Thu, 21 Apr 2016 21:59:26 +0100 (BST) Original-Received: from spline.mattleach.net (host109-154-75-208.range109-154.btcentralplus.com [109.154.75.208]) by mx0.mattleach.net (Postfix) with ESMTPSA id A73B762225; Thu, 21 Apr 2016 21:59:25 +0100 (BST) In-Reply-To: <57147449.4060307@cs.ucla.edu> (Paul Eggert's message of "Sun, 17 Apr 2016 22:44:41 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 176.58.118.143 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203156 Archived-At: Hi Paul, Paul Eggert writes: > Matthew Leach wrote: >> There is no specific reason other than 226 is what is installed on my >> system and what I have tested against. If you are able to test on an >> earlier version, this number could be reduced. > > Thanks. Can you please investigate which is the earliest number for > which it's plausible that the new systemd code will work? In the > meantime I installed the attached patch, which lists that as a FIXME > and addresses the other problem I mentioned along with a few minor > style glitches. I've just been looking at the patch (sorry, it probably should have been sooner) and it looks as though there is an issue, I'm afraid. Please see the comment below. > From fd379e7ed99557bb4348e215bfc711af2d9360e8 Mon Sep 17 00:00:00 2001 > From: Paul Eggert > Date: Sun, 17 Apr 2016 22:41:14 -0700 > Subject: [PATCH] Minor fixups for external socket launching > > * configure.ac (HAVE_LIBSYSTEMD): Change earliest version to 222. > * doc/emacs/misc.texi (Emacs Server): > * etc/NEWS: Spelling and doc fixes. > * src/emacs.c (main) [HAVE_LIBSYSTEMD]: > Check for sd_is_socket returning positive, not zero. > * src/process.c (external_sock_fd): Instead of initializing here ... > (init_process_emacs): ... initialize it here, so that it does the > right thing after dump/restore. > (connect_network_socket): Simplify socket_to_use test. > --- > configure.ac | 5 ++++- > doc/emacs/misc.texi | 2 +- > etc/NEWS | 12 ++++++------ > src/emacs.c | 26 ++++++++++++-------------- > src/process.c | 35 ++++++++++++++++------------------- > 5 files changed, 39 insertions(+), 41 deletions(-) > [...] > @@ -7775,7 +7772,7 @@ init_process_emacs (void) > FD_ZERO (&non_keyboard_wait_mask); > FD_ZERO (&non_process_wait_mask); > FD_ZERO (&write_mask); > - max_process_desc = max_input_desc = -1; > + max_process_desc = max_input_desc = external_sock_fd = -1; Setting `external_sock_fd' here doesn't work as 'init_process_emacs' is called later in 'main' than 'set_external_socket_descriptor' is; any descriptor that is passed through from systemd would be overwritten with -1. Thanks, -- Matt