I am trying to run an identical emacsserver setup as the emacs I normally use.
I am having issues because the emacsserver has a different exec-path
variable when it starts than when normal emacs
does.
To start emacsserver I am using:
/usr/bin/emacs --daemon
in a systemd script. To start emacs normally I just type emacs
emacsserver (which I connect to by typing emacsclient) has the following value for
exec-path`:
exec-path is a variable defined in `C source code'.
Its value is
("PATH" "/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/lib/emacs/24.5/x86_64-linux-gnu")
Whereas "normal" emacs has the full path I normally use:
exec-path is a variable defined in `C source code'.
Its value is
("/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "/usr/local/games" "/snap/bin" "/bin" "/usr/local/bin" "/sbin" "/usr/bin" "/usr/local/sbin" "/opt/node-v4.2.1-linux-x64/bin" "/opt/node-v4.2.1-li\
nux-x64/bin/node" "/home/optonox/.npm-global/bin" "/usr/local/mongodb/bin" "/snap/bin" "/bin" "/usr/local/bin" "/sbin" "/usr/bin" "/usr/local/sbin" "/opt/node-v4.2.1-linux-x64/bin" "/opt/node-v4.2.1-linux-x64/bin/node" "/home/optono\
x/.npm-global/bin" "/usr/local/mongodb/bin" "/usr/lib/emacs/24.5/x86_64-linux-gnu")
Why is this happening / can I start it normally somehow?
exec-path
to whatever value you want, or you can change the environment that systemd launches emacs in. For example, you could addEnvironment="EMACSPATH=/foo/bar:…"
to your systemd unit file. – db48x Oct 19 '16 at 07:09EMACSPATH
is just an example variable correct? I would really want to setPATH
correct? – Startec Oct 19 '16 at 17:54EMACSPATH
andPATH
, as you can see in the source code that I linked to. I recommend settingEMACSPATH
unless you specifically need to setPATH
for some reason you haven't mentioned in your question. It's safer, because only Emacs will use it. – db48x Oct 20 '16 at 03:47