1 2 3 4 5 6 7 8 9 10 11 12
[Unit] Description=Emacs [Service] Type=forking ExecStart=/usr/bin/emacs --bg-daemon=MAIN ExecStop=/usr/bin/emacsclient --socket-name=MAIN --eval "(kill-emacs)" Restart=on-failure TimeoutStartSec=0 [Install] WantedBy=default.target