0

Some variant of this has been asked before - emacs daemon crashing when it has been built with Gtk3 etc - but I couldn't find any solution to this.

I've built Emacs 27.1 from source on Xubuntu 20.04 with --with-x-toolkit=lucid. I then copied emacs.service into $HOME/.config/system/user/ and ran systemctl --user start emacs.service.

It ran for a while and crashed with the following message:

Job for emacs.service failed because a timeout was exceeded.
See "systemctl --user status emacs.service" and "journalctl --user -xe" for details.

Note: I don't need to open a file or resize emacs etc. The daemon fails even when I don't start an emacsclient.

The outputs of both the recommended commands are given below:

journalctl:

anaravi@anaravi-xxxxx:~$ journalctl --user -xe
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit UNIT has finished with a failure.
-- 
-- The job identifier is 249 and the job result is failed.
Dec 27 21:37:26 anaravi-xxxxx systemd[2390]: emacs.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit UNIT has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Dec 27 21:37:26 anaravi-xxxxx systemd[2390]: Stopped Emacs text editor.
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit UNIT has finished.
-- 
-- The job identifier is 265 and the job result is done.
Dec 27 21:37:26 anaravi-xxxxx systemd[2390]: Starting Emacs text editor...
-- Subject: A start job for unit UNIT has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit UNIT has begun execution.
-- 
-- The job identifier is 265.
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/init.el (source)...
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/init.el (source)...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/recentf...
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/recentf...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Cleaning up the recentf list...
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Cleaning up the recentf list...done (0 removed)
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Starting Emacs daemon.
Dec 27 21:37:28 anaravi-xxxxx gnome-keyring-daemon[2403]: asked to register item /org/freedesktop/secrets/collection/login/1, but it's already registered
Dec 27 21:37:39 anaravi-xxxxx gnome-keyring-daemon[2403]: asked to register item /org/freedesktop/secrets/collection/login/1, but it's already registered

systemctl:

anaravi@anaravi-xxxxx:~$ systemctl --user status emacs
● emacs.service - Emacs text editor
     Loaded: loaded (/home/anaravi/.config/systemd/user/emacs.service; disabled; vendor preset: enabled)
     Active: activating (start) since Sun 2020-12-27 21:35:53 IST; 1min 16s ago
       Docs: info:emacs
             man:emacs(1)
             https://gnu.org/software/emacs/
   Main PID: 2890 (emacs)
     CGroup: /user.slice/user-1000.slice/user@1000.service/emacs.service
             └─2890 /usr/local/lib/emacs/27.1/bin/emacs --fg-daemon

Dec 27 21:35:57 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/init.el (source)...
Dec 27 21:35:58 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...
Dec 27 21:35:58 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...done
Dec 27 21:36:02 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/init.el (source)...done
Dec 27 21:36:02 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/recentf...
Dec 27 21:36:02 anaravi-xxxxx emacs[2890]: Loading /home/anaravi/.emacs.d/recentf...done
Dec 27 21:36:02 anaravi-xxxxx emacs[2890]: Cleaning up the recentf list...
Dec 27 21:36:02 anaravi-xxxxx emacs[2890]: Cleaning up the recentf list...done (0 removed)
Dec 27 21:36:07 anaravi-xxxxx emacs[2890]: Starting Emacs daemon.
Dec 27 21:36:18 anaravi-xxxxx emacs[2890]: unable to open file '/etc/dconf/db/local': Failed to open file “/etc/dconf/db/local”: open() failed: No such file or di>
anaravi@anaravi-xxxxx:~$ systemctl --user status emacs
● emacs.service - Emacs text editor
     Loaded: loaded (/home/anaravi/.config/systemd/user/emacs.service; disabled; vendor preset: enabled)
     Active: activating (start) since Sun 2020-12-27 21:37:26 IST; 3s ago
       Docs: info:emacs
             man:emacs(1)
             https://gnu.org/software/emacs/
   Main PID: 3264 (emacs)
     CGroup: /user.slice/user-1000.slice/user@1000.service/emacs.service
             └─3264 /usr/local/lib/emacs/27.1/bin/emacs --fg-daemon

Dec 27 21:37:26 anaravi-xxxxx systemd[2390]: Starting Emacs text editor...
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/init.el (source)...
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...
Dec 27 21:37:26 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/config/cfg-custom.el (source)...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/init.el (source)...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/recentf...
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Loading /home/anaravi/.emacs.d/recentf...done
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Cleaning up the recentf list...
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Cleaning up the recentf list...done (0 removed)
Dec 27 21:37:27 anaravi-xxxxx emacs[3264]: Starting Emacs daemon.

1
  • Typically any Emacs crash implies an Emacs bug. Consider reporting this: M-x report-emacs-bug.
    – Drew
    Dec 27 '20 at 19:45
1

Found the problem in the configuration status while building:

  ...
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   yes
  Does Emacs use -lsystemd?                               no
  Does Emacs use -ljansson?                               yes
  Does Emacs use -lgmp?                                   yes
  ...

Emacs was built without lsystemd because I was missing libsystemd-dev. Installing that package seems to have solved the problem.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.