unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73110: 29.4; emacs.service failed with result 'timeout'
@ 2024-09-07 17:22 Patrick Nicodemus
  2024-09-07 17:45 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Nicodemus @ 2024-09-07 17:22 UTC (permalink / raw)
  To: 73110

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))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
  2024-09-07 17:22 bug#73110: 29.4; emacs.service failed with result 'timeout' Patrick Nicodemus
@ 2024-09-07 17:45 ` Eli Zaretskii
  2024-09-21  9:05   ` Eli Zaretskii
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-07 17:45 UTC (permalink / raw)
  To: Patrick Nicodemus; +Cc: 73110

> From: Patrick Nicodemus <gadget142@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
  2024-09-07 17:45 ` Eli Zaretskii
@ 2024-09-21  9:05   ` Eli Zaretskii
       [not found]     ` <CADZEZBaL7ktCnB6J6sBw-NXve0R1bS=dpZ3gtObh7hdL5=6Keg@mail.gmail.com>
  2024-10-13 11:26   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]   ` <670bae7e.a70a0220.3720fa.5d6fSMTPIN_ADDED_BROKEN@mx.google.com>
  2 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-21  9:05 UTC (permalink / raw)
  To: gadget142; +Cc: 73110

Ping! Patrick, could you please respond and confirm that this issue is
because of how you built your Emacs?

> Cc: 73110@debbugs.gnu.org
> Date: Sat, 07 Sep 2024 20:45:23 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Patrick Nicodemus <gadget142@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.
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
       [not found]     ` <CADZEZBaL7ktCnB6J6sBw-NXve0R1bS=dpZ3gtObh7hdL5=6Keg@mail.gmail.com>
@ 2024-10-12 12:39       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-10-12 12:39 UTC (permalink / raw)
  To: Patrick Nicodemus; +Cc: 73110

[Please use Reply All to reply, to keep the bug tracker CC'ed.]

> From: Patrick Nicodemus <gadget142@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
  2024-09-07 17:45 ` Eli Zaretskii
  2024-09-21  9:05   ` Eli Zaretskii
@ 2024-10-13 11:26   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]   ` <670bae7e.a70a0220.3720fa.5d6fSMTPIN_ADDED_BROKEN@mx.google.com>
  2 siblings, 0 replies; 7+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-13 11:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73110, Patrick Nicodemus

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Patrick Nicodemus <gadget142@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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
       [not found]   ` <670bae7e.a70a0220.3720fa.5d6fSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2024-10-13 15:43     ` Patrick Nicodemus
  2024-10-13 19:05       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Nicodemus @ 2024-10-13 15:43 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Eli Zaretskii, 73110

[-- Attachment #1: Type: text/plain, Size: 2849 bytes --]

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@thaodan.de> wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Patrick Nicodemus <gadget142@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?
>

[-- Attachment #2: Type: text/html, Size: 3905 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73110: 29.4; emacs.service failed with result 'timeout'
  2024-10-13 15:43     ` Patrick Nicodemus
@ 2024-10-13 19:05       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 7+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-13 19:05 UTC (permalink / raw)
  To: Patrick Nicodemus; +Cc: Eli Zaretskii, 73110

Patrick Nicodemus <gadget142@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@thaodan.de> wrote:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Patrick Nicodemus <gadget142@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. 





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-13 19:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-07 17:22 bug#73110: 29.4; emacs.service failed with result 'timeout' Patrick Nicodemus
2024-09-07 17:45 ` Eli Zaretskii
2024-09-21  9:05   ` Eli Zaretskii
     [not found]     ` <CADZEZBaL7ktCnB6J6sBw-NXve0R1bS=dpZ3gtObh7hdL5=6Keg@mail.gmail.com>
2024-10-12 12:39       ` Eli Zaretskii
2024-10-13 11:26   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <670bae7e.a70a0220.3720fa.5d6fSMTPIN_ADDED_BROKEN@mx.google.com>
2024-10-13 15:43     ` Patrick Nicodemus
2024-10-13 19:05       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).