GNU bug report logs - #73110
29.4; emacs.service failed with result 'timeout'

Previous Next

Package: emacs;

Reported by: Patrick Nicodemus <gadget142 <at> gmail.com>

Date: Sat, 7 Sep 2024 17:23:02 UTC

Severity: normal

Found in version 29.4

To reply to this bug, email your comments to 73110 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sat, 07 Sep 2024 17:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Patrick Nicodemus <gadget142 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Sep 2024 17:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Patrick Nicodemus <gadget142 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; emacs.service failed with result 'timeout'
Date: Sat, 7 Sep 2024 13:22:30 -0400
I want to run Emacs as a service and connect to it with a client. I
followed the instructions here:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html

and ran the command
systemctl --user enable emacs

This apparently creates a file at
~/.config/systemd/user/default.target.wants/emacs.service

whose contents are:

[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/

[Service]
Type=notify
ExecStart=/usr/local/bin/emacs --fg-daemon

# Emacs will exit with status 15 after having received SIGTERM, which
# is the default "KillSignal" value systemd uses to stop services.
SuccessExitStatus=15

# The location of the SSH auth socket varies by distribution, and some
# set it from PAM, so don't override by default.
# Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure

[Install]
WantedBy=default.target

The directions also say:
(If your Emacs was installed into a non-standard location, you may need
to copy the emacs.service file to a standard directory such as
~/.config/systemd/user/.)

I built this emacs distribution from source and installed it using "sudo
make install"; the executable is at /usr/local/bin/emacs, so I don't
think it is installed in a non-standard location, and so I did not
follow these instructions.

I modified the [Service] command above to include the -Q flag for the
purposes of this bug report.

After activating the service, restarting, etc., my journalctl output is
as follows:

Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: start operation timed out. Terminating.
Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Failed with result 'timeout'.
Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Failed to start emacs.service - Emacs text editor.
Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Scheduled restart job, restart counter is at 1.
Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Starting emacs.service - Emacs text editor...
Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183514]:
Starting Emacs daemon.
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: start operation timed out. Terminating.
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Failed with result 'timeout'.
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Failed to start emacs.service - Emacs text editor.
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Scheduled restart job, restart counter is at 2.
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Starting emacs.service - Emacs text editor...
Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183623]:
Starting Emacs daemon.
Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: start operation timed out. Terminating.
Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Failed with result 'timeout'.
Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Failed to start emacs.service - Emacs text editor.
Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
emacs.service: Scheduled restart job, restart counter is at 3.
Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
Starting emacs.service - Emacs text editor...
Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183684]:
Starting Emacs daemon.

etc., etc., every ninety seconds.

For some reason emacs is not successfully communicating to systemd that
it has launched successfully, and so systemd terminates emacs.

In GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.0) of 2024-08-30 built on
 patrick-ThinkPad-X1-Carbon-Gen-10
System Description: Ubuntu 24.04.1 LTS

Configured using:
 'configure --with-native-compilation=aot --with-tree-sitter --with-gif
 --with-png --with-jpeg --with-rsvg --with-tiff --with-pgtk
 --with-imagemagick --with-x-toolkit=gtk3 --with-xwidgets'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr misearch multi-isearch emacsbug message mailcap
yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc6068 epg-config gnus-util text-property-search
time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader cl-loaddefs comp comp-cstr warnings icons subr-x rx
cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 77452 8067)
 (symbols 48 7163 0)
 (strings 32 19673 2120)
 (string-bytes 1 600176)
 (vectors 16 15676)
 (vector-slots 8 327945 14726)
 (floats 8 44 40)
 (intervals 56 233 0)
 (buffers 984 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sat, 07 Sep 2024 17:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Patrick Nicodemus <gadget142 <at> gmail.com>
Cc: 73110 <at> debbugs.gnu.org
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sat, 07 Sep 2024 20:45:23 +0300
> From: Patrick Nicodemus <gadget142 <at> gmail.com>
> Date: Sat, 7 Sep 2024 13:22:30 -0400
> 
> I want to run Emacs as a service and connect to it with a client. I
> followed the instructions here:
> 
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
> 
> and ran the command
> systemctl --user enable emacs
> 
> This apparently creates a file at
> ~/.config/systemd/user/default.target.wants/emacs.service
> 
> whose contents are:
> 
> [Unit]
> Description=Emacs text editor
> Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
> 
> [Service]
> Type=notify
> ExecStart=/usr/local/bin/emacs --fg-daemon
> 
> # Emacs will exit with status 15 after having received SIGTERM, which
> # is the default "KillSignal" value systemd uses to stop services.
> SuccessExitStatus=15
> 
> # The location of the SSH auth socket varies by distribution, and some
> # set it from PAM, so don't override by default.
> # Environment=SSH_AUTH_SOCK=%t/keyring/ssh
> Restart=on-failure
> 
> [Install]
> WantedBy=default.target
> 
> The directions also say:
> (If your Emacs was installed into a non-standard location, you may need
> to copy the emacs.service file to a standard directory such as
> ~/.config/systemd/user/.)
> 
> I built this emacs distribution from source and installed it using "sudo
> make install"; the executable is at /usr/local/bin/emacs, so I don't
> think it is installed in a non-standard location, and so I did not
> follow these instructions.
> 
> I modified the [Service] command above to include the -Q flag for the
> purposes of this bug report.
> 
> After activating the service, restarting, etc., my journalctl output is
> as follows:
> 
> Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: start operation timed out. Terminating.
> Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Failed with result 'timeout'.
> Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Failed to start emacs.service - Emacs text editor.
> Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Scheduled restart job, restart counter is at 1.
> Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Starting emacs.service - Emacs text editor...
> Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183514]:
> Starting Emacs daemon.
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: start operation timed out. Terminating.
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Failed with result 'timeout'.
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Failed to start emacs.service - Emacs text editor.
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Scheduled restart job, restart counter is at 2.
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Starting emacs.service - Emacs text editor...
> Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183623]:
> Starting Emacs daemon.
> Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: start operation timed out. Terminating.
> Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Failed with result 'timeout'.
> Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Failed to start emacs.service - Emacs text editor.
> Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> emacs.service: Scheduled restart job, restart counter is at 3.
> Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> Starting emacs.service - Emacs text editor...
> Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183684]:
> Starting Emacs daemon.
> 
> etc., etc., every ninety seconds.
> 
> For some reason emacs is not successfully communicating to systemd that
> it has launched successfully, and so systemd terminates emacs.

According to this:

> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
> IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
> NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

your Emacs is built without libsystemd support, which I think is
required for this to work?  Or maybe I'm missing something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sat, 21 Sep 2024 09:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: gadget142 <at> gmail.com
Cc: 73110 <at> debbugs.gnu.org
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sat, 21 Sep 2024 12:05:29 +0300
Ping! Patrick, could you please respond and confirm that this issue is
because of how you built your Emacs?

> Cc: 73110 <at> debbugs.gnu.org
> Date: Sat, 07 Sep 2024 20:45:23 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Patrick Nicodemus <gadget142 <at> gmail.com>
> > Date: Sat, 7 Sep 2024 13:22:30 -0400
> > 
> > I want to run Emacs as a service and connect to it with a client. I
> > followed the instructions here:
> > 
> > https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
> > 
> > and ran the command
> > systemctl --user enable emacs
> > 
> > This apparently creates a file at
> > ~/.config/systemd/user/default.target.wants/emacs.service
> > 
> > whose contents are:
> > 
> > [Unit]
> > Description=Emacs text editor
> > Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
> > 
> > [Service]
> > Type=notify
> > ExecStart=/usr/local/bin/emacs --fg-daemon
> > 
> > # Emacs will exit with status 15 after having received SIGTERM, which
> > # is the default "KillSignal" value systemd uses to stop services.
> > SuccessExitStatus=15
> > 
> > # The location of the SSH auth socket varies by distribution, and some
> > # set it from PAM, so don't override by default.
> > # Environment=SSH_AUTH_SOCK=%t/keyring/ssh
> > Restart=on-failure
> > 
> > [Install]
> > WantedBy=default.target
> > 
> > The directions also say:
> > (If your Emacs was installed into a non-standard location, you may need
> > to copy the emacs.service file to a standard directory such as
> > ~/.config/systemd/user/.)
> > 
> > I built this emacs distribution from source and installed it using "sudo
> > make install"; the executable is at /usr/local/bin/emacs, so I don't
> > think it is installed in a non-standard location, and so I did not
> > follow these instructions.
> > 
> > I modified the [Service] command above to include the -Q flag for the
> > purposes of this bug report.
> > 
> > After activating the service, restarting, etc., my journalctl output is
> > as follows:
> > 
> > Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: start operation timed out. Terminating.
> > Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Failed with result 'timeout'.
> > Sep 07 12:52:45 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Failed to start emacs.service - Emacs text editor.
> > Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Scheduled restart job, restart counter is at 1.
> > Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Starting emacs.service - Emacs text editor...
> > Sep 07 12:52:46 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183514]:
> > Starting Emacs daemon.
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: start operation timed out. Terminating.
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Failed with result 'timeout'.
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Failed to start emacs.service - Emacs text editor.
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Scheduled restart job, restart counter is at 2.
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Starting emacs.service - Emacs text editor...
> > Sep 07 12:54:16 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183623]:
> > Starting Emacs daemon.
> > Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: start operation timed out. Terminating.
> > Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Failed with result 'timeout'.
> > Sep 07 12:55:46 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Failed to start emacs.service - Emacs text editor.
> > Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > emacs.service: Scheduled restart job, restart counter is at 3.
> > Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 systemd[2704]:
> > Starting emacs.service - Emacs text editor...
> > Sep 07 12:55:47 patrick-ThinkPad-X1-Carbon-Gen-10 emacs[183684]:
> > Starting Emacs daemon.
> > 
> > etc., etc., every ninety seconds.
> > 
> > For some reason emacs is not successfully communicating to systemd that
> > it has launched successfully, and so systemd terminates emacs.
> 
> According to this:
> 
> > Configured features:
> > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
> > IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
> > NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
> > TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
> 
> your Emacs is built without libsystemd support, which I think is
> required for this to work?  Or maybe I'm missing something.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sat, 12 Oct 2024 12:41:02 GMT) Full text and rfc822 format available.

Message #14 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Patrick Nicodemus <gadget142 <at> gmail.com>
Cc: 73110 <at> debbugs.gnu.org
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sat, 12 Oct 2024 15:39:32 +0300
[Please use Reply All to reply, to keep the bug tracker CC'ed.]

> From: Patrick Nicodemus <gadget142 <at> gmail.com>
> Date: Fri, 11 Oct 2024 12:07:04 -0400
> 
> Hi Eli,
> Sorry for the late reply, I have been busy.
> I have not yet checked that the fix works, but I think you are correct
> that Emacs was not compiled with libsystemd support.
> If it is indeed required for this to work, I think that it's a
> documentation bug that this is not mentioned here -
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html.
> This is especially important because the default behavior for the
> ./configure script is to silently disable libsystemd support if the
> required libraries are not found, rather than failing loudly and
> requiring the user to install the appropriate systemwide packages (in
> my case, as a Ubuntu user, libsystemd-dev.) Moreover there is
> apparently no (documented) --with-libsystemd option one can feed to
> the ./configure script to force this behavior - the flag exists in the
> ./configure script but this appears to be dead code with no observable
> effect.
> Therefore, IMO there is no reason/hint for me as an end user to
> suspect that the problem is due to my configuration script, because I
> specified no options to disable compilation with libsystemd and there
> is no configuration flag I can specify to guarantee that libsystemd is
> enabled.
> 
> Considering that --with-libsystemd exists in the configure script but
> is not documented I assume that it was a previous feature that was
> deprecated/removed, but I personally would have benefited a lot from
> the configure script loudly failing when it couldn't find the
> necessary libraries.

I'll defer to systemd experts, assuming we have some.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sun, 13 Oct 2024 11:28:01 GMT) Full text and rfc822 format available.

Message #17 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Björn Bidar <bjorn.bidar <at> thaodan.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73110 <at> debbugs.gnu.org, Patrick Nicodemus <gadget142 <at> gmail.com>
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sun, 13 Oct 2024 14:26:52 +0300
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Patrick Nicodemus <gadget142 <at> gmail.com>
>> Date: Sat, 7 Sep 2024 13:22:30 -0400
>> 
>> I want to run Emacs as a service and connect to it with a client. I
>> followed the instructions here:
>> 
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
>> 
>> and ran the command
>> systemctl --user enable emacs
>> 
>> This apparently creates a file at
>> ~/.config/systemd/user/default.target.wants/emacs.service
>> For some reason emacs is not successfully communicating to systemd that
>> it has launched successfully, and so systemd terminates emacs.
>
> According to this:
>
>> Configured features:
>> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
>> IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
>> NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
>> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
>
> your Emacs is built without libsystemd support, which I think is
> required for this to work?  Or maybe I'm missing something.

I don't know exactly if libsystemd is required for the service to work,
I think it shouldn't however, but why?
Why would use the systemd user service but also not built with
libsystemd?
Even if there's something wrong why support such as usecase?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sun, 13 Oct 2024 15:45:01 GMT) Full text and rfc822 format available.

Message #20 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Patrick Nicodemus <gadget142 <at> gmail.com>
To: Björn Bidar <bjorn.bidar <at> thaodan.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 73110 <at> debbugs.gnu.org
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sun, 13 Oct 2024 11:43:06 -0400
[Message part 1 (text/plain, inline)]
Neither Eli or I proposed supporting this use case (using systemd as a
service without compiling with support for libsystemd)
I think it's perfectly valid to ask the user to compile Emacs with
libsystemd support for this to work. Thus, this is a documentation bug.

Systemd is able to manage many programs on my computer without them being
compiled with a special support for libsystemd, so I do not expect to
require a special additional library to get Emacs to work if the
documentation does not mention it.

Chapter 40 of the manual does not indicate that running Emacs as a server
is special non-core functionality, therefore as a user I assume that if
this functionality is not working then it is broken, not that I
misconfigured it at compile time. If this is supposed to be core
functionality then the build should fail loudly if the dependencies are not
found at compile time unless the user supplies the --without-libsystemd
flag.

Compare the chapter on images which warns the reader that external
libraries must be available:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Formats.html

Compare the chapter on tree sitter which alerts the reader that support for
tree sitter must be compiled in:

https://www.gnu.org/software/emacs//manual/html_node/elisp/Parsing-Program-Source.html

On Sun, Oct 13, 2024, 7:26 AM Björn Bidar <bjorn.bidar <at> thaodan.de> wrote:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: Patrick Nicodemus <gadget142 <at> gmail.com>
> >> Date: Sat, 7 Sep 2024 13:22:30 -0400
> >>
> >> I want to run Emacs as a service and connect to it with a client. I
> >> followed the instructions here:
> >>
> >>
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
> >>
> >> and ran the command
> >> systemctl --user enable emacs
> >>
> >> This apparently creates a file at
> >> ~/.config/systemd/user/default.target.wants/emacs.service
> >> For some reason emacs is not successfully communicating to systemd that
> >> it has launched successfully, and so systemd terminates emacs.
> >
> > According to this:
> >
> >> Configured features:
> >> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
> >> IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
> >> NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
> >> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
> >
> > your Emacs is built without libsystemd support, which I think is
> > required for this to work?  Or maybe I'm missing something.
>
> I don't know exactly if libsystemd is required for the service to work,
> I think it shouldn't however, but why?
> Why would use the systemd user service but also not built with
> libsystemd?
> Even if there's something wrong why support such as usecase?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73110; Package emacs. (Sun, 13 Oct 2024 19:15:01 GMT) Full text and rfc822 format available.

Message #23 received at 73110 <at> debbugs.gnu.org (full text, mbox):

From: Björn Bidar <bjorn.bidar <at> thaodan.de>
To: Patrick Nicodemus <gadget142 <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 73110 <at> debbugs.gnu.org
Subject: Re: bug#73110: 29.4; emacs.service failed with result 'timeout'
Date: Sun, 13 Oct 2024 22:05:01 +0300
Patrick Nicodemus <gadget142 <at> gmail.com> writes:

> Neither Eli or I proposed supporting this use case (using systemd as a
> service without compiling with support for libsystemd)

I didn't mean to say literally supporting but more like if there's a bug
from such a use case than it shouldn't be worth investing time in.

> I think it's perfectly valid to ask the user to compile Emacs with
> libsystemd support for this to work. Thus, this is a documentation bug.

Now looking at the service again made find the issue I think.
The service uses 'Type=notify' which means that Emacs has to tell
systemd that it is ready.

To quote systemd.service(5):

> Behavior of notify is similar to exec; however, it is
> expected that the service sends a "READY=1" notification
> message via sd_notify(3) or an equivalent call when it has
> finished starting up. systemd will proceed with starting
> follow-up units after this notification message has been
> sent. If this option is used, NotifyAccess= (see below)
> should be set to open access to the notification socket
> provided by systemd. If NotifyAccess= is missing or set to
> none, it will be forcibly set to main.

> Systemd is able to manage many programs on my computer without them being
> compiled with a special support for libsystemd, so I do not expect to
> require a special additional library to get Emacs to work if the
> documentation does not mention it.

It is able to but if a program opts into systemd features such
as notify it has to also support them.

> Chapter 40 of the manual does not indicate that running Emacs as a server
> is special non-core functionality, therefore as a user I assume that if
> this functionality is not working then it is broken, not that I
> misconfigured it at compile time. If this is supposed to be core
> functionality then the build should fail loudly if the dependencies are not
> found at compile time unless the user supplies the --without-libsystemd
> flag.

The service file would have to use another Type such as 'exec'
if not compiled with libsystemd support enabled during build.

>
> On Sun, Oct 13, 2024, 7:26 AM Björn Bidar <bjorn.bidar <at> thaodan.de> wrote:
>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> From: Patrick Nicodemus <gadget142 <at> gmail.com>
>> >> Date: Sat, 7 Sep 2024 13:22:30 -0400
>> >>
>> >> I want to run Emacs as a service and connect to it with a client. I
>> >> followed the instructions here:
>> >>
>> >>
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
>> >>
>> >> and ran the command
>> >> systemctl --user enable emacs
>> >>
>> >> This apparently creates a file at
>> >> ~/.config/systemd/user/default.target.wants/emacs.service
>> >> For some reason emacs is not successfully communicating to systemd that
>> >> it has launched successfully, and so systemd terminates emacs.
>> >
>> > According to this:
>> >
>> >> Configured features:
>> >> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
>> >> IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP
>> >> NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
>> >> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
>> >
>> > your Emacs is built without libsystemd support, which I think is
>> > required for this to work?  Or maybe I'm missing something.
>>
>> I don't know exactly if libsystemd is required for the service to work,
>> I think it shouldn't however, but why?
>> Why would use the systemd user service but also not built with
>> libsystemd?
>> Even if there's something wrong why support such as usecase?
>>


PS: I'm not sure about if there's a netiquette on this list but
top-posting and HTML mails are usually frowned upon. 




This bug report was last modified 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.