Quantcast
Channel: User Thomas - Ask Ubuntu
Viewing all articles
Browse latest Browse all 41

Answer by Thomas for How to start emacs as service?

$
0
0

The systemd service file seems to need some modifications to work. From the link you provided, the --fg-daemon option is only available for Emacs 26.1+, whereas version below should use --daemon (was introduced in Emacs 23.1).
Further the Type= should be adopted to forking, since emacs is forking.

So the resulting systemd unit should look like as follows.

user@host:~$ cat .config/systemd/user/emacs.service [Unit]Description=Emacs text editorDocumentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/[Service]Type=forkingExecStart=/usr/bin/emacs --daemonExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"Environment=SSH_AUTH_SOCK=%t/keyring/sshRestart=on-failure[Install]WantedBy=default.target

After you have applied your changes, do not forget to reload the configuration.

user@host:~$ systemctl daemon-reload --user

Then start the service as regular user.

user@host:~$ systemctl start --user emacs

Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>