[Unit]
Description=Emacs

[Service]
Type=forking
ExecStart=/usr/bin/emacs --bg-daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=on-failure
TimeoutStartSec=0

[Install]
WantedBy=default.target