0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pam_systemd(sshd:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions.

Posted at

/var/log/secureに以下のようなログが記録されていました。

crond[387333]: pam_systemd(crond:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions.
sshd[386880]: pam_systemd(sshd:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions.

結論から書くと再起動後事象は収まりました。

loginctl list-sessionsで確認すると確かにセッションが8192存在します。

$ loginctl list-sessions
SESSION  UID USER SEAT TTY
 147258 1000 user1
 147435    0 root
 147436 1000 user1
 147437 1000 user1
 147438    0 root
 147439    0 root
 147440 1000 user1
 147441    0 root
 147442    0 root

(中略)

 155618 1000 user1
 155619    0 root
 155620    0 root
 155621 1000 user1
 155622 1000 user1
 155623    0 root
 155624    0 root
 155625 1000 user1

8192 sessions listed.

loginctl show-sessionコマンドで詳細を確認するも何をしていいか分かりませんでした。

$ loginctl show-session 155624
Id=155624
User=0
Name=root
Timestamp=Thu 2023-05-04 14:05:01 JST
TimestampMonotonic=15574661310283
VTNr=0
Remote=no
Service=crond
Scope=session-155624.scope
Leader=3598257
Audit=155624
Type=unspecified
Class=background
Active=yes
State=closing
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no
$
$ loginctl show-session 155623
Id=155623
User=0
Name=root
Timestamp=Thu 2023-05-04 14:00:01 JST
TimestampMonotonic=15574360680079
VTNr=0
Remote=no
Service=crond
Scope=session-155623.scope
Leader=3597225
Audit=155623
Type=unspecified
Class=background
Active=yes
State=closing
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no

必要のないセッションを切ればいい気がしたのですが、who -aコマンドで確認するも、ごくごく普通でした。
psコマンドで確認しても、切ってもいいプロセスはありませんでした。
user1のセッションが3840あったのですが、そもそもuser1のプロセスは3840もありませんでした。
以上からこれ以上何をしていいか分からなかったので仕方なく再起動しました。
再起動後はセッション数はそれなりな数に戻り、今のところ着々を増えていくことはありません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?