From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68799: 30.0.50; emacs --fg-daemon fails silently if server-start fails Date: Tue, 30 Jan 2024 14:08:28 +0200 Message-ID: <86r0hz2fcz.fsf@gnu.org> References: <86y1c82hfb.fsf@gnu.org> <86wmrs2h41.fsf@gnu.org> <86v87c2fw4.fsf@gnu.org> <86sf2g2btj.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68799@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 30 13:10:06 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 1rUmwI-0007ry-0V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jan 2024 13:10:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUmw6-00057P-Nl; Tue, 30 Jan 2024 07:09:54 -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 1rUmw5-00057B-6d for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 07:09:53 -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 1rUmw4-0004a3-T6 for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 07:09:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUmwD-0007P5-Na for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 07:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jan 2024 12:10:01 +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.170661654528385 (code B ref 68799); Tue, 30 Jan 2024 12:10:01 +0000 Original-Received: (at 68799) by debbugs.gnu.org; 30 Jan 2024 12:09:05 +0000 Original-Received: from localhost ([127.0.0.1]:34496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUmv5-0007N5-AP for submit@debbugs.gnu.org; Tue, 30 Jan 2024 07:09:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUmv3-0007Ms-A8 for 68799@debbugs.gnu.org; Tue, 30 Jan 2024 07:08:49 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUmum-0004RV-P7; Tue, 30 Jan 2024 07:08:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=40OQsoQY3Ov0QagZgsOjCkaciHXltmXK57XZBBpi3zo=; b=mj2cZMn80hDk 6h0YhPdULiHGdOmHSJczFGDpPp3kVBWWQma8bjhjXhbmi6imw4jcrSxLx26IZklt1bhA5LCagzH7R fciUqcFEULXnBoGwWv/hsC2/0KUnzSivBb2AtEMuWPwgy35VMTryLw2QwVf9F7zxMJ19Vm68C/tjJ ouifE4/t0TjPwylmeRK2C5qhybBtUh1V9Fi+GaEr/3inGbkFHTkwfNq2RLqhs0QyKAR5ShVMg5oV5 dAzbrIZTshVis3ZmHUCGPq3Kczla9J+kAB1SE/+hcKGXrJ1ZBkuaVQ9J9wGtiIPvO6pg7Qdgs9T79 vs+LacThBp/bChWtF1RLkg==; In-Reply-To: (message from Spencer Baugh on Mon, 29 Jan 2024 15:28:47 -0500) 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:279165 Archived-At: > From: Spencer Baugh > Cc: 68799@debbugs.gnu.org > Date: Mon, 29 Jan 2024 15:28:47 -0500 > > >> --- a/lisp/startup.el > >> +++ b/lisp/startup.el > >> @@ -1627,7 +1627,11 @@ command-line > >> (let ((dn (daemonp))) > >> (when dn > >> (when (stringp dn) (setq server-name dn)) > >> - (server-start) > >> + (condition-case err > >> + (server-start) > >> + (error > >> + (message "%s" (error-message-string err)) > >> + (kill-emacs 1))) > > > > Thanks, this needs a comment explaining why we need condition-case and > > where does error-message-string come from. > > Actually, on second thought, we could fail anywhere in startup.el, not > just in server-start. So should we actually have a wrapper around all > of normal-top-level which detects an error at startup in a daemon? I'd prefer to handle each specific problem specially, to make sure the error message is self-explanatory. Also, if the error happens after the server has been started, there's no reason to forcibly exit. So I think we should for now solve this particular issue, and not try generalizing too much.