LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   systemd-logind slow logins (https://www.linuxquestions.org/questions/debian-26/systemd-logind-slow-logins-4175543760/)

Shadow_7 05-27-2015 01:24 PM

systemd-logind slow logins
 
Using su to change users takes 30-ish seconds to change users. Except when the network is completely down. This seems to happen to my system semi-regularly and I've been fixing it by doing a fresh install. This last time it took less than 30 days. Normally it takes 3 to 6 months.

I have managed a work around/fix it would seem.

# apt-get install --reinstall systemd
# systemctl restart systemd-logind


Before fixing the issue:

# loginctl list-seats

Would time out.

# grep -i login /var/log/syslog

May 27 12:13:14 hostname dbus[844]: [system] Failed to activate service 'org.freedesktop.login1': timed out

Are but a few of the symptoms. The main usability issue being that it takes 30-ish seconds to su to another user. Issues like this one (and others) make me a little more concerned about the security of my system(s). This seems to be an issue that spans several distros. And may be amd64 specific. And may be related to installing i386 packages on said systems. The mbrola-us3 package (for espeak) in my case. The issue does not self correct once said package(s) are uninstalled. At least not until systemd is reinstalled in my case.

Just putting this out there for the others that are affected. And to remind my aging self of a potential solution when it happens again.

Shadow_7 05-27-2015 08:12 PM

It seems that on reboot I have the same issue.

# systemctl restart systemd-logind

Seems to be the only step needed to solve it (at each boot). If done after dhclient brings the network up.

EDDY1 05-28-2015 12:32 AM

What is your partition layout? If you are using separate /usr it will slow down boot times.

Shadow_7 05-28-2015 06:11 PM

/ is it's own partition, and the only partition. Boot time is not the issue. The issue is that once I bring up the network (dhclient/ethernet), when I try to su to another user, that login takes 30+ seconds (locally). As long as the network is down it's not an issue as local logins are almost instantaneous. Restarting systemd-logind fixes the login delay after bringing up the network with dhclient. (temporarily / doesn't carry over to the next boot). This isn't an issue when the install is fresh, but creaps in fairly consistently to an issue within a few months of regular updates. At least with the jessie variant, when it was still testing, and apparently now when it's the stable branch.

I tend to do fairly minimal installs via debootstrap. And boot to the console/CLI by default. At which point I do a few things manually depending on what I want to do with my computer that day. A window manager of cwm from sources, via .xinitrc and startx, and a custom kernel, 3.19+ (4.0.1 atm) are about the only exotics things with this otherwise minimal desktop-ish system.

EDDY1 05-28-2015 10:32 PM

Have you checked /var/log/messges or dmesg to reserch problems?

Shadow_7 05-29-2015 09:59 AM

So I rebooted to recreate the issue and check recent logs. And it's no longer an issue. Maybe it's just something that happens when you reboot after a couple weeks of uptime. It's certainly not the first time I've had this issue and probably not the last.

As mentioned in the first post, /var/log/syslog had a timeout message. And "loginctl list-seats" would time out when the issue was active. I'll check /var/log/messages the next time that it is an issue. But at the moment, not an active issue.

Shadow_7 06-01-2015 03:42 PM

Well it's back. /var/log/messages shows nothing of interest.

/var/log/syslog
Code:

Jun  1 15:22:30 ...hostname... dbus[841]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service'
Jun  1 15:22:55 ...hostname... dbus[841]: [system] Failed to activate service 'org.freedesktop.login1': timed out

Is about the only thing of interest. This only activates after running "dhclient -4 -v eth0" and getting an outbound connection. And of course "systemctl restart systemd-logind" makes the logins spiffy again. Where ...hostname... is an edit.

Perhaps something in /etc/dbus-1/system.conf is at fault here. That seems to be the only hit of interest in /etc/* with egrep.

---------- Post added 06-01-15 at 03:43 PM ----------

Per the log, 25 seconds from activation to timed out.

Shadow_7 06-07-2015 08:19 PM

I suppose that I shouldn't have systemd-logind and login running at the same time. Because I do after restarting systemd-logind.

I'm starting to wonder if doing system installs via chroot (debootstrap style) is the trigger? Since I did an i386 install for the old laptop on this amd64 laptop around the same time this crept up this time. I shutdown to undo the chroot and it's mount points. Since functioning in the chroot binds the host udev and stuff when using apt to install stuff post chroot setup, like a kernel to make it bootable.

Shadow_7 06-11-2015 09:14 AM

It appeared that systemd and systemd-sysv were both installed. I did an apt-get remove systemd-sysv and it did that and added other new packages. This reboot there is no login delay when su-ing between users multiple times, and I didn't have to restart systemd-logind. Maybe it'll hold this time around. There was an odd message, that doesn't appear to have made it to any of the logs. It said something about an unrecognized unit for (user)@1000.service. Shortly after logging in after a cold boot. With the user id and username of the user that I was logged in with at the time.

Head_on_a_Stick 06-11-2015 01:18 PM

Quote:

Originally Posted by Shadow_7 (Post 5375611)
It appeared that systemd and systemd-sysv were both installed.

The systemd-sysv package just creates a symlink from /sbin/init to /lib/systemd/systemd -- this sets systemd as PID1 (/sbin/init is called by the kernel).

I take it you are now using SysVinit as PID1?

Post the output of:
Code:

ls -l /sbin/init
cat /proc/1/comm


Shadow_7 06-12-2015 09:59 AM

Quote:

Originally Posted by Head_on_a_Stick (Post 5375714)
I take it you are now using SysVinit as PID1?

I'm using whatever the default is for jessie as installed with debootstrap circa may 2, 2015. PID1 is init. Or at least default after manually doing apt-get remove systemd-sysv.

init-+-cgmanager

as listed with pstree

Head_on_a_Stick 06-12-2015 01:36 PM

Quote:

Originally Posted by Shadow_7 (Post 5376087)
I'm using whatever the default is for jessie as installed with debootstrap circa may 2, 2015. PID1 is init. Or at least default after manually doing apt-get remove systemd-sysv.

That's my point -- the systemd-sysv packages overwrites /sbin/init with a symlink to systemd.

"PID1" is the first process called by the kernel after booting up: ie, init.

Please post the output I have requested as this will clarify which init system you are using.

Shadow_7 06-14-2015 01:07 AM

Quote:

Originally Posted by Head_on_a_Stick (Post 5375714)
Post the output of:
Code:

ls -l /sbin/init
cat /proc/1/comm


ls -l /sbin/init
-rwxr-xr-x 1 root root 40648 Apr 6 13:44 /sbin/init

cat /proc/1/comm
init

Head_on_a_Stick 06-14-2015 03:58 AM

Quote:

Originally Posted by Shadow_7 (Post 5376890)
ls -l /sbin/init
-rwxr-xr-x 1 root root 40648 Apr 6 13:44 /sbin/init

cat /proc/1/comm
init

You are no longer using systemd as your init system -- you have switched to SysVinit.

You should either re-install the systemd-sysv package to switch back or run this command to make sure the switch is complete:
Code:

# apt-get install sysvinit-core systemd-shim systemd-sysv-

Shadow_7 06-16-2015 04:38 AM

$ dpkg -l | grep -i systemd
Code:

ii  libpam-systemd:amd64                215-17+deb8u1                        amd64        system and service manager - PAM module
ii  libsystemd0:amd64                    215-17+deb8u1                        amd64        systemd utility library
ii  systemd                              215-17+deb8u1                        amd64        system and service manager
ii  systemd-shim                        9-1                                  amd64        shim for systemd

That's a lot of systemd for not running systemd. But sysvinit-core was installed. Odd naming convention to install systemd-sysv to ?stop? using sysv?

# apt-get install systemd-sysv

Odder still that running that mentions upstart. Debuntu? Or more of a curiousity. And more oddities, just to be sure that I'm running systemd-sysv at the next reboot.

# apt-get install --reinstall systemd-sysv systemd

Ends in:
E: Couldn't configure systemd-sysv:amd64, probably a dependency cycle.

Although:

# apt-get install --reinstall systemd-sysv

Succeeds without the E:. I guess that means that it's time to reboot and see if I have slow logins again.


All times are GMT -5. The time now is 06:49 PM.