systemd
user instance diedI normally keep emacs
running using a systemd service unit. It runs in the systemd user instance, as controlled by systemctl --user
.
Earlier today the entire systemd user unit crashed. I don't understand why. (Probably something I did.) Here are some symptoms:
d@fifty:~$ systemctl --user status
Failed to read server status: Input/output error
d@fifty:~$ systemctl --user
Failed to list units: Process org.freedesktop.systemd1 exited with status 1
It took a long time searching to find anything helpful. Finally, I found this helpful comment by Michael Schmidt, which suggested to run the following:
d@fifty:~$ systemctl status user@$(id -u)
● user@1000.service - User Manager for UID 1000
Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)
Active: inactive (dead)
May 15 20:42:33 fifty systemd[2197]: Closed GnuPG cryptographic agent (access for web browsers).
May 15 20:42:33 fifty systemd[2197]: Closed GnuPG cryptographic agent and passphrase cache (restricted).
May 15 20:42:33 fifty systemd[2197]: Closed D-Bus User Message Bus Socket.
May 15 20:42:33 fifty systemd[2197]: Closed GnuPG cryptographic agent and passphrase cache.
May 15 20:42:33 fifty systemd[2197]: Closed GnuPG network certificate management daemon.
May 15 20:42:33 fifty systemd[2197]: Reached target Shutdown.
May 15 20:42:33 fifty systemd[2197]: Starting Exit the Session...
May 15 20:42:33 fifty systemd[2197]: Stopped target Paths.
May 15 20:42:33 fifty systemd[2197]: Stopped target Timers.
May 15 20:42:33 fifty systemd[2197]: Received SIGRTMIN+24 from PID 12901 (kill).
Well, there's the problem.
d@fifty:~$ ps 12901
PID USER TT %MEM %CPU STARTED CMD
No idea what that is or was. But in any case, the fix is easy:
d@fifty:~$ sudo systemctl start user@$(id -u)
After which everything is as it should be:
d@fifty:~$ systemctl status user@$(id -u)
● user@1000.service - User Manager for UID 1000
Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)
Active: active (running) since Wed 2019-05-15 21:42:56 EDT; 8s ago
Main PID: 15936 (systemd)
Status: "Startup finished in 4.510s."
Tasks: 6
CGroup: /user.slice/user-1000.slice/user@1000.service
├─dbus.service
│ └─15956 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
├─emacs.service
│ ├─15942 /usr/bin/emacs --daemon
│ └─15991 /usr/bin/aspell -a -m -B --encoding=utf-8
└─init.scope
├─15936 /lib/systemd/systemd --user
└─15937 (sd-pam)