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: Mon, 29 Jan 2024 15:28:47 -0500 Message-ID: References: <86y1c82hfb.fsf@gnu.org> <86wmrs2h41.fsf@gnu.org> <86v87c2fw4.fsf@gnu.org> <86sf2g2btj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24521"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68799@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 29 21:30:19 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 1rUYGn-00069O-PI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jan 2024 21:30:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUYGT-00062C-QN; Mon, 29 Jan 2024 15:29:57 -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 1rUYGQ-000614-Gi for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 15:29:55 -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 1rUYGQ-00018Y-3y for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 15:29:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUYGY-0004Oe-4Z for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 15:30: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: Mon, 29 Jan 2024 20:30: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.170656014316807 (code B ref 68799); Mon, 29 Jan 2024 20:30:02 +0000 Original-Received: (at 68799) by debbugs.gnu.org; 29 Jan 2024 20:29:03 +0000 Original-Received: from localhost ([127.0.0.1]:33572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUYFa-0004N1-PJ for submit@debbugs.gnu.org; Mon, 29 Jan 2024 15:29:03 -0500 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:44627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUYFZ-0004MY-96 for 68799@debbugs.gnu.org; Mon, 29 Jan 2024 15:29:01 -0500 In-Reply-To: <86sf2g2btj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Jan 2024 21:12:40 +0200") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1706560127; bh=ExQyKctevVj7qUnHsRrSM4qgj+dBTltvLEP+ElSWrqo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=cskk6hxshvErFcrK3e4SgiUtserDKqEf0nM95gEGz7bfuOVxI8Orm4KsJ66dU+gVN znfso2dAddE9+ewyTFqH3gkmI038JlHLtf6dxEY9BH2nAmarXVqgpWMlvuRh3eYnjA q1bxqF8xJTKM0wvVfGey/syt7zT5lSB/PA7tESNdmD2KM4fRNjq4jaCIHo6e+zTd9i caesaDWI4GEVkJR7F2WwKtf/ayloJV6f7XwhPtFkOdXttr4ERusbNvyr8S3w+B/w0w wPJirWRP6UCZ/0+lPz+dKXB0Sv2NSNdsSEKaqxLmYKly6fg0aLyFU+KOlkSFubM+CX 3yf/74K+GzGOg== 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:279143 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 68799@debbugs.gnu.org >> Date: Mon, 29 Jan 2024 13:13:42 -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? For example, this will also fail to start the server and hang with no error message: emacs --eval '(error)' --daemon Likewise any errors raised in init.el will also just hang without starting the server, although that at least causes some logs to be printed. Maybe we should handle this in the C top_level_1, conditional on IS_DAEMON?