2017년 5월 19일 금요일

FIX :: ssh 접속이 느리고, /var/log/messages에 systemd-logind.service failed. 메시지가 남을 때

ssh 접속이 느릴 때가 있습니다. 보통은DNS가 제대로 설정되지 않았는데 /etc/ssh/sshd_config에 UseDNS가 yes로 되어 있을 때 발생합니다.

위와 같을 경우 /etc/ssh/sshd_config파일에서 아래와 같이 수정 후 sshd를 재시작 합니다.

> vi /etc/ssh/sshd_config
...
UseDNS no

> systemctl restart sshd

Client문제일 경우도 있습니다. GSSAPIAuthentication값이 제대로 yes로 되어 있을 경우 입니다. /etc/ssh/ssh_config나 ~/.ssh/config 파일에서 해당 옵션을 no로 변경합니다.

이번 문제는 위와 다르게 특이한 경우를 설명 합니다.
증상은 아래와 같습니다.

1. DNS, GSSAPI 설정 정상
2. 하지만 ssh 접속이 느림
3. /var/log/messages에 아래와 같은 로그가 남음

> less /var/log/messages
...
systemd-logind: Failed to enable subscription: Connection timed out
systemd-logind: Failed to fully start up daemon: Connection timed out
systemd: systemd-logind.service: main process exited, code=exited, status=1/FAILURE
systemd: Failed to start Login Service.
systemd: Unit systemd-logind.service entered failed state.
systemd: systemd-logind.service failed.
systemd: systemd-logind.service has no holdoff time, scheduling restart.
systemd: Starting Login Service...
...

dbus와 systemd-logind에 있는 버그 입니다. 어떤 이유에서 dbus서비스는 재시작 되어 업데이트 되었지만 systemd-logind가 업데이트 되지 않아 생기는 문제 입니다.

아래와 같이 해결 합니다.

> systemctl restart systemd-logind

위와 같이 했는데 재시작시 에러가 발생하면 dbus.service도 재시작 합니다.

> systemctl restart dbus.service <= .service를 꼭 입력
> systemctl restart systemd-logind

완료 후  /var/log/messages를 확인하면 정상적으로 동작하는 것을 확인할 수 있습니다.

> tail -20 /var/log/messages
...
systemd: Started Login Service.
systemd-logind: New seat seat0.
systemd-logind: Watching system buttons on /dev/input/event0 (Power Button)
systemd-logind: New session 1 of user nvkvs.
systemd-logind: New session 13 of user nvkvs.
systemd-logind: New session 2 of user nvkvs.
systemd: Created slice user-0.slice.
systemd: Starting user-0.slice.
systemd-logind: New session 2220 of user root.
systemd: Started Session 2220 of user root.

댓글 없음:

FIX :: ssh 접속이 느리고, /var/log/messages에 systemd-logind.service failed. 메시지가 남을 때

ssh 접속이 느릴 때가 있습니다. 보통은DNS가 제대로 설정되지 않았는데 /etc/ssh/sshd_config에 UseDNS가 yes로 되어 있을 때 발생합니다. 위와 같을 경우 /etc/ssh/sshd_config파일에서 아래와 같이 수정 후 ...