LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cetos 7 login very slow (https://www.linuxquestions.org/questions/linux-newbie-8/cetos-7-login-very-slow-4175722574/)

james000 03-01-2023 07:15 PM

Cetos 7 login very slow
 
Hi,
I have a Centos 7.2 VM and noticed that login is very slow on this, even if I login with local root account. Upon further check, it shows me some org.freedesktop.systemd1 errors and also I see lot of defunct processes, whose parent PID is 1 (systemd).
Without reboot, I am not able to clean defunct processes. Is there any other way, I should be able to fix it? Any suggestions please?
Code:

[root@centos-7-2 ~]# time ssh root@localhost id
root@localhost's password:
uid=0(root) gid=0(root) groups=0(root)

real    0m27.948s
user    0m0.013s
sys    0m0.002s
[root@centos-7-2 ~]# service nscd status
Redirecting to /bin/systemctl status  nscd.service
Failed to get properties: Activation of org.freedesktop.systemd1 timed out
[root@centos-7-2 ~]# service nscd restart
Redirecting to /bin/systemctl restart  nscd.service
Failed to restart nscd.service: Activation of org.freedesktop.systemd1 timed out
[root@centos-7-2 ~]#
[root@centos-7-2 ~]# cat /etc/ssh/sshd_config | grep -i usedns
UseDNS no
[root@centos-7-2 ~]# service sshd status
Redirecting to /bin/systemctl status  sshd.service
Failed to get properties: Activation of org.freedesktop.systemd1 timed out
[root@centos-7-2 ~]#
[root@centos-7-2 ~]# ps -ef | grep defunct | wc -l
5440
[root@centos-7-2 ~]#

I am not sure if these are two different problems, so both are related to each other

Thanks

TenTenths 03-02-2023 07:45 AM

If you're connecting from a machine on the same host / network you might find that putting an entry in /etc/hosts of the target with your source client's IP address helps. Login does some IP checks and if it can't reverse resolve the IP it can "hang" for up to 30 seconds or so when attempting login.

michaelk 03-02-2023 11:17 AM

I am guessing this is a systemd bug. What version of systemd are you using? Run the command:
systemctl --version

Since you have defunct processes look at the output of the command:
systemctl | grep 'of user'| grep 'abandoned'

To delete sessions try running the command
rm -rf /run/systemd/system/sessionscope

To fix runtime issues try:
systemctl daemon-reexec

james000 03-02-2023 06:49 PM

I had to reboot the server finally and that fixed problem


All times are GMT -5. The time now is 04:32 AM.