Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1439990

Summary: why so many sessions scope file didn't been deleted?
Product: Red Hat Enterprise Linux 7 Reporter: muahao <muahao>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-13 08:17:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description muahao 2017-04-07 03:23:17 UTC
Description of problem:

Hello , I have so many docker container , and appear this problem, why there 
are so many session-xxxx.scope.d files and directorys in /run/systemd/system/ , I find my container ssh delays too slowly about 30s , I am puzzled that why so many "session-xxxx.scope.d" directorys didn't be deleted? I don't know if this is relate to https://github.com/systemd/systemd/issues/2925



Version-Release number of selected component (if applicable):


```
#rpm -q dbus
dbus-1.6.12-13.1.el7.x86_64
```

```
#rpm -q systemd
systemd-219-19.el7_2.13.x86_64.rpm 
```

```
[root /home/ahao.mah]
#ls -ld /run/systemd/system/session-*.scope* |wc -l
25981



```
[root /home/ahao.mah]
#ls -ld /run/systemd/system/session-*.scope* |wc -l
25981
```

```
[root /home/ahao.mah]
#ls -ld /run/systemd/system/session-*.scope* |head -n 100
-rw-r--r-- 1 root root  17 Mar  7 17:53 /run/systemd/system/session-1000019.scope
drwxr-xr-x 2 root root 140 Mar  7 17:53 /run/systemd/system/session-1000019.scope.d
-rw-r--r-- 1 root root  17 Mar  7 17:53 /run/systemd/system/session-1000020.scope
drwxr-xr-x 2 root root 140 Mar  7 17:53 /run/systemd/system/session-1000020.scope.d
-rw-r--r-- 1 root root  17 Mar  7 17:56 /run/systemd/system/session-1000404.scope
drwxr-xr-x 2 root root 140 Mar  7 17:56 /run/systemd/system/session-1000404.scope.d
-rw-r--r-- 1 root root  17 Mar  1 19:17 /run/systemd/system/session-100056.scope
drwxr-xr-x 2 root root 140 Mar  1 19:17 /run/systemd/system/session-100056.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:00 /run/systemd/system/session-1000871.scope
drwxr-xr-x 2 root root 140 Mar  7 18:00 /run/systemd/system/session-1000871.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:01 /run/systemd/system/session-1001130.scope
drwxr-xr-x 2 root root 140 Mar  7 18:01 /run/systemd/system/session-1001130.scope.d
-rw-r--r-- 1 root root  17 Mar  1 19:20 /run/systemd/system/session-100129.scope
drwxr-xr-x 2 root root 140 Mar  1 19:20 /run/systemd/system/session-100129.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:04 /run/systemd/system/session-1001450.scope
drwxr-xr-x 2 root root 140 Mar  7 18:04 /run/systemd/system/session-1001450.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:05 /run/systemd/system/session-1001572.scope
drwxr-xr-x 2 root root 140 Mar  7 18:05 /run/systemd/system/session-1001572.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:05 /run/systemd/system/session-1001573.scope
drwxr-xr-x 2 root root 140 Mar  7 18:05 /run/systemd/system/session-1001573.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:08 /run/systemd/system/session-1001866.scope
drwxr-xr-x 2 root root 140 Mar  7 18:08 /run/systemd/system/session-1001866.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:08 /run/systemd/system/session-1001867.scope
drwxr-xr-x 2 root root 140 Mar  7 18:08 /run/systemd/system/session-1001867.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:10 /run/systemd/system/session-1002216.scope
drwxr-xr-x 2 root root 140 Mar  7 18:10 /run/systemd/system/session-1002216.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:10 /run/systemd/system/session-1002217.scope
drwxr-xr-x 2 root root 140 Mar  7 18:10 /run/systemd/system/session-1002217.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:16 /run/systemd/system/session-1002918.scope
drwxr-xr-x 2 root root 140 Mar  7 18:16 /run/systemd/system/session-1002918.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:20 /run/systemd/system/session-1003641.scope
drwxr-xr-x 2 root root 140 Mar  7 18:20 /run/systemd/system/session-1003641.scope.d
-rw-r--r-- 1 root root  17 Mar  7 18:25 /run/systemd/system/session-1004120.scope
drwxr-xr-x 2 root root 140 Mar  7 18:25 /run/systemd/system/session-1004120.scope.d
-rw-r--r-- 1 root root  17 Mar  1 19:25 /run/systemd/system/session-100418.scope
```

```
[root /home/ahao.mah]
#cat /run/systemd/system/session-*.scope.d/50-Description.conf
[Unit]
Description=Session 1000019 of user mysql
[Unit]
Description=Session 1000020 of user root
[Unit]
Description=Session 1000404 of user mysql
[Unit]
Description=Session 100056 of user root
[Unit]
Description=Session 1000871 of user mysql
[Unit]
Description=Session 1001130 of user mysql
[Unit]
Description=Session 100129 of user mysql
[Unit]
Description=Session 1001450 of user root
[Unit]
Description=Session 1001572 of user mysql
[Unit]
Description=Session 1001573 of user root
[Unit]
Description=Session 1001866 of user root
[Unit]
Description=Session 1001867 of user mysql
[Unit]
Description=Session 1002216 of user mysql
[Unit]
Description=Session 1002217 of user mysql
[Unit]
Description=Session 1002918 of user mysql
```

looks like there is not so many connections 

```
[root /home/ahao.mah]
#netstat -antlupe | wc -l
35

[root /home/ahao.mah]
#lsof -i :22 |wc -l
6
```

Comment 2 Lukáš Nykrýn 2017-04-13 08:17:57 UTC

*** This bug has been marked as a duplicate of bug 1439989 ***