Emacs systemd service causes slow shutdown/reboot

I am getting slow shutdown and reboots. Not timed exactly (will report back later…).

  • Removed nowatchdog from grub and rebuilt (no effect).

  • Edited the emacs service file to solve part of the problem.

Other than that, no sure what to do next. Will reboot in the next 30 minutes or so.

Other than this, everything working well.

Just out of curiosity do you have any external USB drives connected?

I could paste a:

journalctl -b 1

No USB attached. Will reboot shortly.

Average delay is 1:30, but can be upto 3:00 (minutes). Journalctl is just failed & errors (baloo spamming the logs, forgot to disable, it hates pcloud and spazzes out!!).

OK, it is emacs. The solution I had for Manjaro does not work here. Looking in to it.

2020-07-30 9:21 ➜ ~ ➜ emacsclient -e '(kill-emacs)'
2020-07-30 9:23 ➜ ~ took 1m 30s ➜

Above is the service files method of closing emacs, run from the command line - this is the problem!!

Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/

TimeoutStopSec= 10
ExecStart=/usr/bin/emacs --fg-daemon
ExecStop=systemctl stop emacs --user
# The location of the SSH auth socket varies by distribution, and some
# set it from PAM, so don't override by default.
# Environment=SSH_AUTH_SOCK=%t/keyring/ssh


This works (only rebooted once), better than before and not waiting for my nose hair to grow :smiley:

1 Like

Also remember that you can add overrides for services using systemctl edit, then you can add in just the specific changes, e.g.:


This means the packaged service file isn’t changed and those changes won’t be lost when the package is upgraded.

I got the big hammer out :smiley: It aint ever gonna change. (chattr).