Hello Ansgar,

On Fri 21 Dec 2018 at 11:01am +0100, Ansgar Burchardt wrote:

> I was asked on IRC to test this with the Debian package (1:26.1+1-2).
> It works:
>
> After starting the emacs.socket unit, systemd opens the socket:
>
> +---
> | [...] /run/user/[...]/emacs [...] users:(("systemd",pid=2375,fd=23))
> +---[ `ss -lxp | grep emacs` ]
>
> Running `emacsclient` then starts `emacs` and the socket is passed to
> emacs:
>
> +---
> | [...] /run/user/[...]/emacs [...] 
> users:(("emacs",pid=12153,fd=3),("systemd",pid=2375,fd=23))
> +---[ `ss -lxp | grep emacs` ]
>
> I've attached the .socket and .service units I'm using as someone was
> asking for them (enable only emacs.socket to start emacs on demand); I
> also have a wrapper script `e` which calls `emacsclient` with the
> `--socket-name=${XDG_RUNTIME_DIR}/emacs` option (this would probably
> also be safe to use by default if XDG_RUNTIME_DIR is set).

Thank you for this.  Emacs is shipping an emacs.service but no
emacs.socket atm, and I had thought that perhaps we could ship your
emacs.socket in the Debian package.  Then a user who wanted Emacs to
start when they login could simply enable emacs.service, and a user who
wanted the Emacs daemon launched on demand could simply enable
emacs.socket.

It looks like your emacs.socket, though, requires modifications to
emacs.service, and also requires passing a --socket-name option to
emacsclient.  I.e. a simple `systemctl --user enable emacs.socket` would
not be sufficient to make plain emacsclient work.

Exactly what units it would be beneficial to be shipped should be
discussed upstream, it would seem.

-- 
Sean Whitton

Attachment: signature.asc
Description: PGP signature

Reply via email to