You are not logged in.

#1 2021-06-05 23:56:20

FaeFeyFa
Member
Registered: 2019-08-08
Posts: 20

[SOLVED] Various systemd services being stopped

Hi!
I noticed that occasionally systemd-logind just kicks me back to the login screen on the console.
(I'm using startx, though sometimes this issue occurs even if Xorg isn't running.)
Xorg.0.log has a line about

 [  1879.799] (EE) 
Fatal server error:
[  1879.799] (EE) systemd-logind disappeared (stopped/restarted?)

(full log: ix.io/3oSt )

Which led me to check

 #journalctl -u systemd-logind 

Here's the log from the last time it happened:

-- Boot 2601d03885e14662adc7c02f3e10b87e --
Jun 05 12:35:52 dream systemd[1]: Starting User Login Management...
Jun 05 12:35:52 dream systemd-logind[384]: Watching system buttons on /dev/input/event0 (Power Button)
Jun 05 12:35:52 dream systemd-logind[384]: Watching system buttons on /dev/input/event1 (Lid Switch)
Jun 05 12:35:52 dream systemd-logind[384]: New seat seat0.
Jun 05 12:35:52 dream systemd[1]: Started User Login Management.
Jun 05 12:35:53 dream systemd-logind[384]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Jun 05 12:35:53 dream systemd-logind[384]: Watching system buttons on /dev/input/event15 (HP WMI hotkeys)
Jun 05 12:35:59 dream systemd-logind[384]: New session 1 of user faefeyfa.
Jun 05 13:07:15 dream systemd[1]: Starting User Login Management...
Jun 05 13:07:15 dream systemd-logind[2412]: New seat seat0.
Jun 05 13:07:15 dream systemd-logind[2412]: Watching system buttons on /dev/input/event0 (Power Button)
Jun 05 13:07:15 dream systemd-logind[2412]: Watching system buttons on /dev/input/event1 (Lid Switch)
Jun 05 13:07:15 dream systemd-logind[2412]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Jun 05 13:07:15 dream systemd-logind[2412]: Watching system buttons on /dev/input/event15 (HP WMI hotkeys)
Jun 05 13:07:15 dream systemd[1]: Started User Login Management.
Jun 05 13:07:15 dream systemd-logind[2412]: New session 3 of user faefeyfa.

(full log: ix.io/3oSp)
But there doesn't seem to be anything telling me why it's doing this. In a few previous boots systemd-logind was recorded as going into "scheduled restarts", so I went into /usr/lib/systemd/system/systemd-logind.service and changed

 Restart=no 

which removed the message about "scheduled restarts" in the logs, but did not actually fix the issue.

I think this started happening after a kernel/systemd update, but I've tried downgrading both and nothing happened. (I'll try again sometime later, this time with older versions, and see if I can get better results.) The other think I remember changing is changing my logind.conf to hibernate on lid switch instead of suspend, which I suppose could have broken something, but I don't know where to start debugging.

So now I have no idea what to do. Please send help.

Thanks!

Last edited by FaeFeyFa (2021-06-09 01:34:37)

Offline

#2 2021-06-06 08:43:54

opensorcerer
Member
From: Germany
Registered: 2021-06-05
Posts: 14

Re: [SOLVED] Various systemd services being stopped

Xorg is apparently correct, systemd-logind was started again. The absence of any messages prior to the launch looks to me like something SIGKILLed systemd-logind. I'd imagine a restart being indicated with at least Stopping systemd-logind in the logs which is not there around this time. So that's probably why Restart=no did not work.
I also imagine crashes being noticed by Systemd and also noted in the logs. Or maybe not?

I don't see suspend/hibernate config being at fault, as the log output prior to the mysterious restart hints at those events being handled as they should. Still, you could post the logind.conf. Maybe pressing some button configured there makes systemd-logind crash unnoticed?

Offline

#3 2021-06-08 19:18:21

FaeFeyFa
Member
Registered: 2019-08-08
Posts: 20

Re: [SOLVED] Various systemd services being stopped

logind.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]
NAutoVTs=12
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
HandlePowerKey=ignore
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=hibernate
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Here's the .service file:

#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=User Login Management
Documentation=man:sd-login(3)
Documentation=man:systemd-logind.service(8)
Documentation=man:logind.conf(5)
Documentation=man:org.freedesktop.login1(5)

Wants=user.slice modprobe@drm.service
After=nss-user-lookup.target user.slice modprobe@drm.service

# Ask for the dbus socket.
Wants=dbus.socket
After=dbus.socket

[Service]
BusName=org.freedesktop.login1
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG CAP_LINUX_IMMUTABLE
DeviceAllow=block-* r
DeviceAllow=char-/dev/console rw
DeviceAllow=char-drm rw
DeviceAllow=char-input rw
DeviceAllow=char-tty rw
DeviceAllow=char-vcs rw
ExecStart=/usr/lib/systemd/systemd-logind
FileDescriptorStoreMax=512
IPAddressDeny=any
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateTmp=yes
ProtectProc=invisible
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectSystem=strict
ReadWritePaths=/etc /run
Restart=always
RestartSec=0
RestrictAddressFamilies=AF_UNIX AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RuntimeDirectory=systemd/sessions systemd/seats systemd/users systemd/inhibit systemd/shutdown
RuntimeDirectoryPreserve=yes
StateDirectory=systemd/linger
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
WatchdogSec=3min

# Increase the default a bit in order to allow many simultaneous logins since
# we keep one fd open per session.
LimitNOFILE=524288

Before I tried Restart=no, the logs looked like this:

-- Boot 8090fca6b4054cc2a8c821f2ace98eec --
Jun 04 15:48:01 dream systemd[1]: Starting User Login Management...
Jun 04 15:48:01 dream systemd-logind[359]: Watching system buttons on /dev/input/event0 (Power Button)
Jun 04 15:48:01 dream systemd-logind[359]: Watching system buttons on /dev/input/event1 (Lid Switch)
Jun 04 15:48:01 dream systemd-logind[359]: New seat seat0.
Jun 04 15:48:01 dream systemd[1]: Started User Login Management.
Jun 04 15:48:02 dream systemd-logind[359]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Jun 04 15:48:02 dream systemd-logind[359]: Watching system buttons on /dev/input/event12 (HP WMI hotkeys)
Jun 04 15:48:09 dream systemd-logind[359]: New session 1 of user faefeyfa.
Jun 04 16:18:44 dream systemd[1]: systemd-logind.service: Deactivated successfully.
Jun 04 16:18:44 dream systemd[1]: systemd-logind.service: Scheduled restart job, restart counter is at 1.
Jun 04 16:18:44 dream systemd[1]: Stopped User Login Management.
Jun 04 16:18:44 dream systemd[1]: Starting User Login Management...
Jun 04 16:18:45 dream systemd-logind[2741]: New seat seat0.
Jun 04 16:18:45 dream systemd-logind[2741]: Watching system buttons on /dev/input/event0 (Power Button)
Jun 04 16:18:45 dream systemd-logind[2741]: Watching system buttons on /dev/input/event1 (Lid Switch)
Jun 04 16:18:45 dream systemd-logind[2741]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Jun 04 16:18:45 dream systemd-logind[2741]: Watching system buttons on /dev/input/event12 (HP WMI hotkeys)
Jun 04 16:18:45 dream systemd[1]: Started User Login Management.
Jun 04 16:18:45 dream systemd-logind[2741]: New session 1 of user faefeyfa.
Jun 04 16:18:45 dream systemd-logind[2741]: Session 1 logged out. Waiting for processes to exit.
Jun 04 16:18:45 dream systemd-logind[2741]: Removed session 1.
Jun 04 16:32:30 dream systemd-logind[2741]: New session 3 of user faefeyfa.
Jun 04 16:51:50 dream systemd[1]: systemd-logind.service: Deactivated successfully.
Jun 04 16:51:50 dream systemd[1]: systemd-logind.service: Scheduled restart job, restart counter is at 2.
Jun 04 16:51:50 dream systemd[1]: Stopped User Login Management.
Jun 04 16:51:50 dream systemd[1]: Starting User Login Management...
Jun 04 16:51:50 dream systemd-logind[3406]: New seat seat0.
Jun 04 16:51:50 dream systemd-logind[3406]: Watching system buttons on /dev/input/event0 (Power Button)
Jun 04 16:51:50 dream systemd-logind[3406]: Watching system buttons on /dev/input/event1 (Lid Switch)
Jun 04 16:51:50 dream systemd-logind[3406]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)
Jun 04 16:51:50 dream systemd-logind[3406]: Watching system buttons on /dev/input/event12 (HP WMI hotkeys)
Jun 04 16:51:50 dream systemd[1]: Started User Login Management.
Jun 04 16:51:50 dream systemd-logind[3406]: New session 3 of user faefeyfa.
Jun 04 16:51:50 dream systemd-logind[3406]: Session 3 logged out. Waiting for processes to exit.
Jun 04 16:51:51 dream systemd-logind[3406]: Removed session 3.
Jun 04 16:51:57 dream systemd-logind[3406]: New session 5 of user faefeyfa.
Jun 04 17:05:10 dream systemd-logind[3406]: System is rebooting.
Jun 04 17:05:10 dream systemd-logind[3406]: Session 5 logged out. Waiting for processes to exit.
Jun 04 17:05:10 dream systemd-logind[3406]: Removed session 5.
Jun 04 17:05:10 dream systemd[1]: Stopping User Login Management...
Jun 04 17:05:10 dream systemd[1]: systemd-logind.service: Deactivated successfully.
Jun 04 17:05:10 dream systemd[1]: Stopped User Login Management.

Which does note that systemd-logind is stopping.
Also, here's a full log of a boot where I log in and wait until everything restarts: http://ix.io/3pfl
It seems like it's not just systemd-logind being stopped, but a bunch of (possibly all?) systemd services.

Offline

#4 2021-06-08 21:50:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,443

Re: [SOLVED] Various systemd services being stopped

Try not using dhcpcd as dhcp client for NM, use dhclient or the built-in instead.
https://bbs.archlinux.org/viewtopic.php?id=266452

Offline

#5 2021-06-09 01:48:01

FaeFeyFa
Member
Registered: 2019-08-08
Posts: 20

Re: [SOLVED] Various systemd services being stopped

Thanks!

Offline

Board footer

Powered by FluxBB