Subject: bug#24218: closed (Re: bug#24218: 25.1.50; server-name, server-socket-dir and daemon start through, systemd socket)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 12 Feb 2018 20:59:02 +0000

Your bug report

#24218: 25.1.50; server-name, server-socket-dir and daemon start through systemd socket

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24218: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24218
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#24218: 25.1.50; server-name, server-socket-dir and daemon start through, systemd socket
From: Paul Eggert <[email-masked]>
To: Matthew Leach <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 12 Feb 2018 12:58:33 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 02/12/2018 06:24 AM, Matthew Leach wrote:
> This last patch looks good to me.

Thanks for checking; I installed the patches into 'master' and am 
marking this bug as done.

Subject: 25.1.50; server-name, server-socket-dir and daemon start through systemd socket
From: Vladimir Lomov <[email-masked]>
To: [email-masked]
Date: Sun, 14 Aug 2016 00:35:57 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,
first of all I not sure if this is a bug report or more likely it is a
feature request.

Recently Emacs got code to start daemon by means of systemd. For this
one needs to create two files: `emacs.socket` and `emacs.service`, for
example, the content of these files can be found in the manual.

The problem is that when emacs daemon is started this way any it's
client doesn't have correct values for `server-name` and
`server-socket-dir` variables. Moreover, attemp to set these variables
manually in `.emacs` triggers (that is not surprise, I think) failure in
emacs daemon start.

I think it should be possible to set these variables to correct values
in `.emacs` that don't cause failure in emacs daemon start, especially
taking into account that there is `:use-external-socket` variable.

To illustrate the situation consider the following `emacs.socket` file

    [Socket]
    ListenStream=%t/emacs

    [Install]
    WantedBy=sockets.target

almost litteraly copied from Emacs manual and following `emacs.service`
file

    [Unit]
    Description=Emacs

    [Service]
    Type=forking
    ExecStart=/path/to/emacs --daemon
    ExecStop=/path/to/emacsclient --eval "(kill-emacs)"
    Restart=always

    [Install]
    WantedBy=default.target

If one starts `emacs.socket` file

    $ systemctl --user start emacs.socket

and connect to the daemon (which is not started yet) by means of the
socket file assuming that `.emacs` is empty

    $ emacsclient -c -s /run/user/1000/emacs

then all is Ok except the values of `server-name` and
`server-socket-dir`: they are wrong (they have "default" values:
`server` and `/tmp/emacs1000`).

If one would use `.emacs` with settings of these variables

    (setq server-name "emacs" server-socket-dir "/run/user/1000")

and run the same command for `emacsclient` in clean conditions (this
means that `service` and `socket` must be stopped before that and
`socket` must be started again) one finds that daemon is not started.

P.S. Sorry if this description isn't clean enough.

In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.8)
 of 2016-08-11 built on smoon6-1.vl-lomov.ru
Repository revision: cd3524061346dec4ec820c98b6ca8046eda290c3
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
Recent messages:
Auto-saving...done
Saving file /home/vladimir/works/org/.git/COMMIT_EDITMSG...
bzip2ing .COMMIT_EDITMSG.~undo-tree~.bz2...done
Wrote /home/vladimir/works/org/.git/.COMMIT_EDITMSG.~undo-tree~.bz2
Wrote /home/vladimir/works/org/.git/COMMIT_EDITMSG
Git finished [2 times]
Type C-h i to view popup manual, ? to describe an argument or action.
Running git push -v origin master:refs/heads/master [2 times]
Git finished [2 times]
When done with this frame, type C-x 5 0

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
 --libexecdir=/usr/lib --with-x-toolkit=gtk3 --without-gconf
 'CFLAGS=-march=x86-64 -mtune=native -O2 -pipe -fstack-protector-strong'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro
 CPPFLAGS=-D_FORTIFY_SOURCE=2'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 LIBSYSTEMD

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: ru_RU.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  global-undo-tree-mode: t
  undo-tree-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  pdf-occur-global-minor-mode: t
  shell-dirtrack-mode: t
  ido-everywhere: t
  display-time-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/org/org-list hides /usr/share/emacs/25.1.50/lisp/org/org-list
/usr/share/emacs/site-lisp/org/org-element hides /usr/share/emacs/25.1.50/lisp/org/org-element
/usr/share/emacs/site-lisp/org/org-mouse hides /usr/share/emacs/25.1.50/lisp/org/org-mouse
/usr/share/emacs/site-lisp/org/org-attach hides /usr/share/emacs/25.1.50/lisp/org/org-attach
/usr/share/emacs/site-lisp/org/org-agenda hides /usr/share/emacs/25.1.50/lisp/org/org-agenda
/usr/share/emacs/site-lisp/org/ob-screen hides /usr/share/emacs/25.1.50/lisp/org/ob-screen
/usr/share/emacs/site-lisp/org/ox-html hides /usr/share/emacs/25.1.50/lisp/org/ox-html
/usr/share/emacs/site-lisp/org/ob-sass hides /usr/share/emacs/25.1.50/lisp/org/ob-sass
/usr/share/emacs/site-lisp/org/ob-ditaa hides /usr/share/emacs/25.1.50/lisp/org/ob-ditaa
/usr/share/emacs/site-lisp/org/ob-keys hides /usr/share/emacs/25.1.50/lisp/org/ob-keys
/usr/share/emacs/site-lisp/org/ob-core hides /usr/share/emacs/25.1.50/lisp/org/ob-core
/usr/share/emacs/site-lisp/org/ob-ocaml hides /usr/share/emacs/25.1.50/lisp/org/ob-ocaml
/usr/share/emacs/site-lisp/org/ob-comint hides /usr/share/emacs/25.1.50/lisp/org/ob-comint
/usr/share/emacs/site-lisp/org/ob-ruby hides /usr/share/emacs/25.1.50/lisp/org/ob-ruby
/usr/share/emacs/site-lisp/org/ob-calc hides /usr/share/emacs/25.1.50/lisp/org/ob-calc
/usr/share/emacs/site-lisp/org/ob-plantuml hides /usr/share/emacs/25.1.50/lisp/org/ob-plantuml
/usr/share/emacs/site-lisp/org/org-macro hides /usr/share/emacs/25.1.50/lisp/org/org-macro
/usr/share/emacs/site-lisp/org/org-irc hides /usr/share/emacs/25.1.50/lisp/org/org-irc
/usr/share/emacs/site-lisp/org/org-inlinetask hides /usr/share/emacs/25.1.50/lisp/org/org-inlinetask
/usr/share/emacs/site-lisp/org/ox-beamer hides /usr/share/emacs/25.1.50/lisp/org/ox-beamer
/usr/share/emacs/site-lisp/org/org-info hides /usr/share/emacs/25.1.50/lisp/org/org-info
/usr/share/emacs/site-lisp/org/org-indent hides /usr/share/emacs/25.1.50/lisp/org/org-indent
/usr/share/emacs/site-lisp/org/ox-ascii hides /usr/share/emacs/25.1.50/lisp/org/ox-ascii
/usr/share/emacs/site-lisp/org/org-id hides /usr/share/emacs/25.1.50/lisp/org/org-id
/usr/share/emacs/site-lisp/org/org-habit hides /usr/share/emacs/25.1.50/lisp/org/org-habit
/usr/share/emacs/site-lisp/org/org-gnus hides /usr/share/emacs/25.1.50/lisp/org/org-gnus
/usr/share/emacs/site-lisp/org/org-footnote hides /usr/share/emacs/25.1.50/lisp/org/org-footnote
/usr/share/emacs/site-lisp/org/org-timer hides /usr/share/emacs/25.1.50/lisp/org/org-timer
/usr/share/emacs/site-lisp/org/org-feed hides /usr/share/emacs/25.1.50/lisp/org/org-feed
/usr/share/emacs/site-lisp/org/ox hides /usr/share/emacs/25.1.50/lisp/org/ox
/usr/share/emacs/site-lisp/org/org-faces hides /usr/share/emacs/25.1.50/lisp/org/org-faces
/usr/share/emacs/site-lisp/org/ox-texinfo hides /usr/share/emacs/25.1.50/lisp/org/ox-texinfo
/usr/share/emacs/site-lisp/org/org-eshell hides /usr/share/emacs/25.1.50/lisp/org/org-eshell
/usr/share/emacs/site-lisp/org/org-table hides /usr/share/emacs/25.1.50/lisp/org/org-table
/usr/share/emacs/site-lisp/org/org-entities hides /usr/share/emacs/25.1.50/lisp/org/org-entities
/usr/share/emacs/site-lisp/org/org-src hides /usr/share/emacs/25.1.50/lisp/org/org-src
/usr/share/emacs/site-lisp/org/org-rmail hides /usr/share/emacs/25.1.50/lisp/org/org-rmail
/usr/share/emacs/site-lisp/org/org-docview hides /usr/share/emacs/25.1.50/lisp/org/org-docview
/usr/share/emacs/site-lisp/org/org-protocol hides /usr/share/emacs/25.1.50/lisp/org/org-protocol
/usr/share/emacs/site-lisp/org/org-datetree hides /usr/share/emacs/25.1.50/lisp/org/org-datetree
/usr/share/emacs/site-lisp/org/org-plot hides /usr/share/emacs/25.1.50/lisp/org/org-plot
/usr/share/emacs/site-lisp/org/org-ctags hides /usr/share/emacs/25.1.50/lisp/org/org-ctags
/usr/share/emacs/site-lisp/org/ox-publish hides /usr/share/emacs/25.1.50/lisp/org/ox-publish
/usr/share/emacs/site-lisp/org/org-crypt hides /usr/share/emacs/25.1.50/lisp/org/org-crypt
/usr/share/emacs/site-lisp/org/ox-org hides /usr/share/emacs/25.1.50/lisp/org/ox-org
/usr/share/emacs/site-lisp/org/org-compat hides /usr/share/emacs/25.1.50/lisp/org/org-compat
/usr/share/emacs/site-lisp/org/org-pcomplete hides /usr/share/emacs/25.1.50/lisp/org/org-pcomplete
/usr/share/emacs/site-lisp/org/org-colview hides /usr/share/emacs/25.1.50/lisp/org/org-colview
/usr/share/emacs/site-lisp/org/org-clock hides /usr/share/emacs/25.1.50/lisp/org/org-clock
/usr/share/emacs/site-lisp/org/ox-odt hides /usr/share/emacs/25.1.50/lisp/org/ox-odt
/usr/share/emacs/site-lisp/org/org-capture hides /usr/share/emacs/25.1.50/lisp/org/org-capture
/usr/share/emacs/site-lisp/org/org-mobile hides /usr/share/emacs/25.1.50/lisp/org/org-mobile
/usr/share/emacs/site-lisp/org/org-bibtex hides /usr/share/emacs/25.1.50/lisp/org/org-bibtex
/usr/share/emacs/site-lisp/org/org-mhe hides /usr/share/emacs/25.1.50/lisp/org/org-mhe
/usr/share/emacs/site-lisp/org/org-bbdb hides /usr/share/emacs/25.1.50/lisp/org/org-bbdb
/usr/share/emacs/site-lisp/org/ox-md hides /usr/share/emacs/25.1.50/lisp/org/ox-md
/usr/share/emacs/site-lisp/org/org-macs hides /usr/share/emacs/25.1.50/lisp/org/org-macs
/usr/share/emacs/site-lisp/org/org-archive hides /usr/share/emacs/25.1.50/lisp/org/org-archive
/usr/share/emacs/site-lisp/org/org-w3m hides /usr/share/emacs/25.1.50/lisp/org/org-w3m
/usr/share/emacs/site-lisp/org/org hides /usr/share/emacs/25.1.50/lisp/org/org
/usr/share/emacs/site-lisp/org/ob hides /usr/share/emacs/25.1.50/lisp/org/ob
/usr/share/emacs/site-lisp/org/ob-tangle hides /usr/share/emacs/25.1.50/lisp/org/ob-tangle
/usr/share/emacs/site-lisp/org/ox-man hides /usr/share/emacs/25.1.50/lisp/org/ox-man
/usr/share/emacs/site-lisp/org/ob-table hides /usr/share/emacs/25.1.50/lisp/org/ob-table
/usr/share/emacs/site-lisp/org/ox-latex hides /usr/share/emacs/25.1.50/lisp/org/ox-latex
/usr/share/emacs/site-lisp/org/ob-sqlite hides /usr/share/emacs/25.1.50/lisp/org/ob-sqlite
/usr/share/emacs/site-lisp/org/ox-icalendar hides /usr/share/emacs/25.1.50/lisp/org/ox-icalendar
/usr/share/emacs/site-lisp/org/ob-sql hides /usr/share/emacs/25.1.50/lisp/org/ob-sql
/usr/share/emacs/site-lisp/org/ob-shen hides /usr/share/emacs/25.1.50/lisp/org/ob-shen
/usr/share/emacs/site-lisp/org/ob-scheme hides /usr/share/emacs/25.1.50/lisp/org/ob-scheme
/usr/share/emacs/site-lisp/org/ob-scala hides /usr/share/emacs/25.1.50/lisp/org/ob-scala
/usr/share/emacs/site-lisp/org/ob-python hides /usr/share/emacs/25.1.50/lisp/org/ob-python
/usr/share/emacs/site-lisp/org/ob-ref hides /usr/share/emacs/25.1.50/lisp/org/ob-ref
/usr/share/emacs/site-lisp/org/ob-lisp hides /usr/share/emacs/25.1.50/lisp/org/ob-lisp
/usr/share/emacs/site-lisp/org/ob-fortran hides /usr/share/emacs/25.1.50/lisp/org/ob-fortran
/usr/share/emacs/site-lisp/org/ob-exp hides /usr/share/emacs/25.1.50/lisp/org/ob-exp
/usr/share/emacs/site-lisp/org/ob-perl hides /usr/share/emacs/25.1.50/lisp/org/ob-perl
/usr/share/emacs/site-lisp/org/ob-lilypond hides /usr/share/emacs/25.1.50/lisp/org/ob-lilypond
/usr/share/emacs/site-lisp/org/ob-eval hides /usr/share/emacs/25.1.50/lisp/org/ob-eval
/usr/share/emacs/site-lisp/org/ob-org hides /usr/share/emacs/25.1.50/lisp/org/ob-org
/usr/share/emacs/site-lisp/org/ob-ledger hides /usr/share/emacs/25.1.50/lisp/org/ob-ledger
/usr/share/emacs/site-lisp/org/ob-emacs-lisp hides /usr/share/emacs/25.1.50/lisp/org/ob-emacs-lisp
/usr/share/emacs/site-lisp/org/ob-maxima hides /usr/share/emacs/25.1.50/lisp/org/ob-maxima
/usr/share/emacs/site-lisp/org/ob-haskell hides /usr/share/emacs/25.1.50/lisp/org/ob-haskell
/usr/share/emacs/site-lisp/org/ob-dot hides /usr/share/emacs/25.1.50/lisp/org/ob-dot
/usr/share/emacs/site-lisp/org/ob-mscgen hides /usr/share/emacs/25.1.50/lisp/org/ob-mscgen
/usr/share/emacs/site-lisp/org/ob-js hides /usr/share/emacs/25.1.50/lisp/org/ob-js
/usr/share/emacs/site-lisp/org/ob-matlab hides /usr/share/emacs/25.1.50/lisp/org/ob-matlab
/usr/share/emacs/site-lisp/org/ob-java hides /usr/share/emacs/25.1.50/lisp/org/ob-java
/usr/share/emacs/site-lisp/org/ob-css hides /usr/share/emacs/25.1.50/lisp/org/ob-css
/usr/share/emacs/site-lisp/org/ob-octave hides /usr/share/emacs/25.1.50/lisp/org/ob-octave
/usr/share/emacs/site-lisp/org/ob-latex hides /usr/share/emacs/25.1.50/lisp/org/ob-latex
/usr/share/emacs/site-lisp/org/ob-lob hides /usr/share/emacs/25.1.50/lisp/org/ob-lob
/usr/share/emacs/site-lisp/org/ob-io hides /usr/share/emacs/25.1.50/lisp/org/ob-io
/usr/share/emacs/site-lisp/org/ob-clojure hides /usr/share/emacs/25.1.50/lisp/org/ob-clojure
/usr/share/emacs/site-lisp/org/ob-makefile hides /usr/share/emacs/25.1.50/lisp/org/ob-makefile
/usr/share/emacs/site-lisp/org/ob-gnuplot hides /usr/share/emacs/25.1.50/lisp/org/ob-gnuplot
/usr/share/emacs/site-lisp/org/ob-R hides /usr/share/emacs/25.1.50/lisp/org/ob-R
/usr/share/emacs/site-lisp/org/ob-awk hides /usr/share/emacs/25.1.50/lisp/org/ob-awk
/usr/share/emacs/site-lisp/org/ob-C hides /usr/share/emacs/25.1.50/lisp/org/ob-C
/usr/share/emacs/site-lisp/org/ob-picolisp hides /usr/share/emacs/25.1.50/lisp/org/ob-picolisp
/usr/share/emacs/site-lisp/org/ob-asymptote hides /usr/share/emacs/25.1.50/lisp/org/ob-asymptote
/usr/share/emacs/site-lisp/org/org-loaddefs hides /usr/share/emacs/25.1.50/lisp/org/org-loaddefs
/usr/share/emacs/site-lisp/org/org-version hides /usr/share/emacs/25.1.50/lisp/org/org-version
/usr/share/emacs/site-lisp/org/org-install hides /usr/share/emacs/25.1.50/lisp/org/org-install

Features:
(shadow sort spook cookie1 mail-extr emacsbug sendmail linum cal-move
parse-time calc-map calc-stat calc-vec calc-ext calc-menu calc-aent calc
calc-loaddefs calc-macs org-table cdlatex texmathp org-annotate-file
org-id org-habit org-info org-docview doc-view org-bibtex bibtex
org-bbdb vc-git thingatpt flymake magit-version undo-tree diff
magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit package url-handlers magit-apply magit-wip
magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert
autorevert filenotify magit-process magit-popup magit-mode magit-git crm
magit-section magit-utils git-commit help-fns radix-tree log-edit
message subr-x puny rfc822 mml mml-sec epa epg epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log with-editor tramp-sh server dash
auto-complete-config auto-complete popup calfw-ical url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse url-vars mailcap icalendar diary-lib diary-loaddefs
calfw-org org-capture org-agenda calfw holidays hol-loaddefs cl ob-shell
ob-R ob-perl ob-latex ob-asymptote ob-gnuplot ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii
ox-publish ox preview-latex tex-site auto-loads pdf-sync pdf-outline
pdf-occur ibuf-ext ibuffer ibuffer-loaddefs pdf-links pdf-isearch
let-alist pdf-history pdf-annot tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet org-element avl-tree org org-macro
org-footnote org-pcomplete org-list org-faces org-entities noutline
outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob
ob-table ob-keys ob-exp ob-comint tramp tramp-compat tramp-loaddefs
trampver ucs-normalize shell pcomplete auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache ob-core ob-eval
org-compat org-macs org-loaddefs find-func cal-menu calendar
cal-loaddefs pdf-misc imenu pdf-tools compile comint ansi-color ring
cus-edit cus-start cus-load wid-edit pdf-view jka-compr pdf-cache
pdf-info tq pdf-util image-mode dired+ image-dired format-spec
image-file dired-aux bookmark+ bookmark+-key edmacro kmacro easy-mmode
advice derived dired-x dired dired-loaddefs bookmark+-1 bookmark+-bmu
bookmark+-lit bookmark pp ido seq byte-opt gv bytecomp byte-compile
cl-extra cconv quail help-mode easymenu cl-loaddefs pcase cl-lib time
flyspell ispell time-date paren mule-util cyril-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 496832 58236)
 (symbols 48 50535 0)
 (miscs 40 177 481)
 (strings 32 118385 14977)
 (string-bytes 1 3804225)
 (vectors 16 78228)
 (vector-slots 8 1869287 211061)
 (floats 8 507 374)
 (intervals 56 1311 69)
 (buffers 976 23))

--
WBR, Vladimir Lomov

SUN Microsystems:
	The Network IS the Load Average.

EuroFed ASPIC Attorney General Pipe bomb undercover Leuken-Baden Federal
Aviation Administration Reflection Palestine Liberation Organization
Chemical burn Incident SWS 22nd SAS Sugar Grove Dirty bomb

--