GNU bug report logs -
#68799
30.0.50; emacs --fg-daemon fails silently if server-start fails
Previous Next
Reported by: Spencer Baugh <sbaugh <at> janestreet.com>
Date: Mon, 29 Jan 2024 16:55:02 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #89 received at 68799 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Spencer Baugh <sbaugh <at> janestreet.com>
>> Cc: 68799 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, jasonr <at> gnu.org
>> Date: Tue, 13 Feb 2024 15:20:21 -0500
>>
>> To be clear, the patch I posted which checks DAEMON_RUNNING *does* solve
>> that.
>>
>> $ ./src/emacs -Q --fg-daemon=/tmp/foo
>> Starting Emacs daemon.
>> ‘/tmp’ is not a safe directory because it is not owned by you (owner = root (0))
>> $
>>
>> (which previously would have hung)
>>
>> The issue now is solely that the printed error message is maybe not
>> informative enough.
>>
>> So how about the following diff, which changes the output to:
>>
>> $ ./src/emacs -Q --fg-daemon=/tmp/foo
>> Starting Emacs daemon.
>> Unable to start daemon: ‘/tmp’ is not a safe directory because it is not owned by you (owner = 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.
[0001-Add-context-to-errors-thrown-by-server-start-during-.patch (text/x-patch, inline)]
From d65f34b76c4d4496bdb2c53bede45db1869af232 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh <at> janestreet.com>
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
This bug report was last modified 1 year and 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.