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