I have a problem with emacs started as daemon using Systemd.
Every shutdown/reboot if I don't stop emacs daemon service manually, the history of recent opened files in current session is lost. I think this is because of the Systemd that can't properly kill Emacs when in a shutdown state.
What can I do to solve this problem?
My recentf config in init.el:
(use-package recentf
:config (progn (setq recentf-auto-cleanup 'never
recentf-max-menu-items 50
recentf-max-saved-items 400
recentf-save-file
(expand-file-name "temp/.recentf" user-emacs-directory))
(recentf-mode t)))
Systemd emacs service config:
[Unit]
Description=Emacs: the extensible, self-documenting text editor
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=always
User=%i
#WorkingDirectory=%h
[Install]
WantedBy=multi-user.target