From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#68799: 30.0.50; emacs --fg-daemon fails silently if server-start fails Date: Wed, 14 Feb 2024 11:11:10 -0500 Message-ID: References: <865xysr17s.fsf@gnu.org> <86mss4p83n.fsf@gnu.org> <86jzn8p2px.fsf@gnu.org> <86frxwp1uy.fsf@gnu.org> <86sf1vxgy4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21855"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68799@debbugs.gnu.org, monnier@iro.umontreal.ca, jasonr@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 14 17:12:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1raHre-0005Rr-Lc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Feb 2024 17:12:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raHrY-0007px-09; Wed, 14 Feb 2024 11:11:56 -0500 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 1raHrO-0007kB-Hg for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:11:48 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raHrM-00051H-Gw for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:11:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raHre-0004Lq-5Q for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2024 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68799 X-GNU-PR-Package: emacs Original-Received: via spool by 68799-submit@debbugs.gnu.org id=B68799.170792709716693 (code B ref 68799); Wed, 14 Feb 2024 16:12:02 +0000 Original-Received: (at 68799) by debbugs.gnu.org; 14 Feb 2024 16:11:37 +0000 Original-Received: from localhost ([127.0.0.1]:52887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raHrF-0004LA-1G for submit@debbugs.gnu.org; Wed, 14 Feb 2024 11:11:37 -0500 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:59165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raHrC-0004Kw-8r for 68799@debbugs.gnu.org; Wed, 14 Feb 2024 11:11:35 -0500 In-Reply-To: <86sf1vxgy4.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Feb 2024 16:23:47 +0200") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1707927070; bh=KNg0RzGCRZaCTtOs2wGj0284NhKVDi/C72tk7vuV8fM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=nrXOroN7nszqag2UfmyePUxR4SnBENZxj/GLEfqr7UDBrLa3nAdZkS9wJwRk7TtBH TSMCgqxp5JNbVQpiVwsGzo4c43QWvJ1V/6F2u4CyAie+5ol1HerRwrmk6HsAmAhu5P oJRvszS8dwNFf+TRFUllEi70Yi4OwJ/kzODIxZJRJWaaIbA7tdkOOHpVpLVJji3SLO pb6oMAG1DihK9Z6nl+LV3ytM7JZHxOrdLDX+Smc2xU2NzUrzhe2jJwXd0RHYu+9O2t hKGOANjHU6rl01RM1SDWtEtTt7KkBuGcQ5jwC5nHx31B0ZlMastKDXZHDb9GTTAvbm xkkuO6eL2+t6Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280015 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 68799@debbugs.gnu.org, monnier@iro.umontreal.ca, jasonr@gnu.org >> Date: Tue, 13 Feb 2024 15:20:21 -0500 >>=20 >> To be clear, the patch I posted which checks DAEMON_RUNNING *does* solve >> that. >>=20 >> $ ./src/emacs -Q --fg-daemon=3D/tmp/foo >> Starting Emacs daemon. >> =E2=80=98/tmp=E2=80=99 is not a safe directory because it is not owned b= y you (owner =3D root (0)) >> $=20 >>=20 >> (which previously would have hung) >>=20 >> The issue now is solely that the printed error message is maybe not >> informative enough. >>=20 >> So how about the following diff, which changes the output to: >>=20 >> $ ./src/emacs -Q --fg-daemon=3D/tmp/foo >> Starting Emacs daemon. >> Unable to start daemon: =E2=80=98/tmp=E2=80=99 is not a safe directory b= ecause it is not owned by you (owner =3D root (0)) > > That's an improvement, but maybe it will be even better if you append > "; exiting" at the end of the message? Can do. Here's the patch, which should be applied in addition to the DAEMON_RUNNING patch I posted earlier. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-context-to-errors-thrown-by-server-start-during-.patch >From d65f34b76c4d4496bdb2c53bede45db1869af232 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Wed, 14 Feb 2024 11:09:33 -0500 Subject: [PATCH] Add context to errors thrown by server-start during startup When server-start errors during startup, the error is printed to the terminal without context. To help the user understand better what went wrong, that printed error now mentions that the error came from starting up the daemon. * lisp/startup.el (command-line): Catch and annotate errors thrown by server-start. (bug#68799) --- lisp/startup.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index 773765a4b97..4871cf3d21f 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1627,7 +1627,9 @@ command-line (let ((dn (daemonp))) (when dn (when (stringp dn) (setq server-name dn)) - (server-start) + (condition-case err + (server-start) + (error (error "Unable to start daemon: %s; exiting" (error-message-string err)))) (if server-process (daemon-initialized) (if (stringp dn) -- 2.39.3 --=-=-=--