I attached an excel file of the ps -alx command.

Regarding the other command, It is long because of the problem :) here is its 
content
Feb 07 10:09:08 vps.server.local systemd[1]: Starting Login Service...          
                                                                                
                                               Feb 07 10:09:08 vps.server.local 
systemd-logind[122]: New seat seat0.                                            
                                                                                
              Feb 07 10:09:08 vps.server.local systemd[1]: Started Login 
Service.                                                                        
                                                                    Feb 07 
10:09:19 vps.server.local systemd[1]: Stopping Login Service...                 
                                                                                
                                        Feb 07 10:09:19 vps.server.local 
systemd[1]: Stopped Login Service.                                              
                                                                                
              Feb 07 10:09:33 vps.server.local systemd[1]: Starting Login 
Service...                                                                      
                                                                   Feb 07 
10:09:33 vps.server.local systemd-logind[104]: New seat seat0.                  
                                                                                
                                        Feb 07 10:09:33 vps.server.local 
systemd[1]: Started Login Service.                                              
                                                                                
              Feb 07 10:10:45 vps.server.local systemd[1]: Stopping Login 
Service...                                                                      
                                                                   Feb 07 
10:10:45 vps.server.local systemd[1]: Stopped Login Service.                    
                                                                                
                                        Feb 07 10:11:03 vps48064754.local 
systemd[1]: Starting Login Service...                                           
                                                                                
             Feb 07 10:11:04 vps48064754.local systemd-logind[163]: New seat 
seat0.                                                                          
                                                               Feb 07 10:11:04 
vps48064754.local systemd[1]: Started Login Service.                            
                                                                                
                               Feb 07 10:13:53 vps48064754.local 
systemd-logind[163]: New session c1 of user root.                               
                                                                                
             Feb 07 10:15:34 vps48064754.local systemd[1]: 
/lib/systemd/system/systemd-logind.service:32: Unknown lvalue 
'RestrictSUIDSGID' in section 'Service'                                         
                   Feb 07 10:17:54 vps48064754.local systemd-logind[163]: New 
session c2 of user debian-spamd.                                                
                                                                    Feb 07 
10:18:23 vps48064754.local systemd-logind[163]: New session c3 of user 
debian-spamd.                                                                   
                                                 Feb 07 10:21:08 
vps48064754.local systemd-logind[163]: Removed session c1.                      
                                                                                
                               Feb 07 10:21:08 vps48064754.local systemd[1]: 
Stopping Login Service...                                                       
                                                                                
 Feb 07 10:21:08 vps48064754.local systemd[1]: Stopped Login Service.           
                                                                                
                                                Feb 07 10:21:36 
vps48064754.local systemd[1]: Starting Login Service...                         
                                                                                
                               Feb 07 10:21:36 vps48064754.local 
systemd-logind[151]: New seat seat0.                                            
                                                                                
             Feb 07 10:21:36 vps48064754.local systemd[1]: Started Login 
Service.         

Then a lot of

Feb 07 10:56:52 vps48064754.local systemd-logind[151]: New session cxxx
of user domain.

Then

Feb 07 18:19:18 vps48064754.local systemd[1]: Stopping Login Service...
Feb 07 18:19:18 vps48064754.local systemd[1]: Stopped Login Service.
Feb 07 18:19:47 vps48064754.local systemd[1]: Starting Login Service...
Feb 07 18:19:47 vps48064754.local systemd-logind[148]: New seat seat0.
Feb 07 18:19:47 vps48064754.local systemd[1]: Started Login Service.

Then a lot of

Feb 07 18:22:09 vps48064754.local systemd-logind[148]: New session cxxx
of user domain.

Then a lot of  (probably my terminate-user command)

Feb 08 12:44:32 vps48064754.local systemd-logind[148]: Removed session
cxxx.

Then again a lot of

Feb 08 12:47:08 vps48064754.local systemd-logind[148]: New session cxxx
of user domain.

Then a lot of ping pong between new session … and removed session… until
today

** Attachment added: "ps -alx.xls"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1863228/+attachment/5331722/+files/ps%20-alx.xls

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1863228

Title:
  loginctl list-sessions shows ghost sessions that are never completely
  closed

Status in systemd package in Ubuntu:
  Incomplete

Bug description:
  I setup a new VPS with ubuntu 18.04.4, including virtualmin/usermin.
  In auth.log I see a lot of

      su[12936]: Successful su for domain by root
      su[12936]: + ??? root:domain 
      systemd-logind[148]: New session c315 of user domain .
      su[12936]: pam_unix(su:session): session opened for user domain by (uid=0)
      su[12936]: pam_unix(su:session): session closed for user domain 

  in syslog, I see a lot of

      systemd[1]: Started Session c314 of user domain.
      systemd[1]: Started Session c315 of user domain.

  domain is the user of my virtual server defined in the VPS. c314/c315
  increased by 1 each time, every 5 minutes (see explanation below).
  When running `loginctl list-sessions` those sessions number grow as
  "active=yes" and "state=closing" and never disappear from the list.

  a random session as an example:

      loginctl session-status c315
      c315 - domain (1000)
                 Since: Sat 2020-02-08 20:27:08 UTC; 23h ago
                Leader: 12936
                   TTY: ???
                Remote: user root
               Service: su; type tty; class user
                 State: closing
                  Unit: session-c315.scope

  I did a simple test: logged in with ssh, logged out (exit) and re-
  logged in. I saw 2 sessions in loginctl list-sessions and the previous
  one, which I obviously closed, never disappeared from the list.

  as a "bonus": Virtualmin apparently open/close a session for the
  virtual server user to do its stuff causing the number of ghost
  sessions to grow forever...

  I posted this question in server fault,  askubuntu, ubuntuforums and
  virtualmin - no one knew what to tell me. I have no idea what/where to
  look for... Please advice :) Thanks in advance.

  FWIW: Someone from virtualmin forum told me that he had a similar
  problem with debian 9 and it was fixed in debian 10.

  After a boot I see this, maybe related?

  Feb 13 06:39:48 domain systemd[1]: Starting User Manager for UID 1000...
  Feb 13 06:39:48 domain systemd[636]: Failed to create 
/user.slice/user-1000.slice/user@1000.service/init.scope control group: 
Permission denied
  Feb 13 06:39:48 domain systemd[636]: Failed to allocate manager object: 
Permission denied
  Feb 13 06:39:48 domain systemd[1]: user@1000.service: Failed with result 
'protocol'.
  Feb 13 06:39:48 domain systemd[1]: Failed to start User Manager for UID 1000

  lsb_release -a; uname -a; grep 1000 /etc/passwd
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description: Ubuntu 18.04.4 LTS
  Release: 18.04
  Codename: bionic
  Linux domain.com 4.15.0 #1 SMP Mon Dec 9 19:36:21 MSK 2019 x86_64 x86_64 
x86_64 GNU/Linux
  domain:x:1000:1000::/home/domain:/bin/bash

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1863228/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to