# [2020.06.08] Running Emacs with systemd

Usually, I started Emacs manually, but today I decided to follow the
instructions from its help page about using `systemd`. In general,
everything is as simple as written: `systemctl --user enable emacs`.
This generates a file, in my case it was
`/usr/local/lib/systemd/user/emacs.service`. I had two problems, the
first was Emacs installed by `snap`, and its binary location was
non-standard. That was immediate to fix. The second problem was weird
since Emacs crashed and restarted about every minute with no
particular reason. I didn't find anything useful in logs but running
in forking mode helped. That meant using an old `emacs --daemon`
command instead of newer `emacs --fg-daemon` and changing the service
type from `notify` to `forking`.