Browse Source

Absolutely make sure that all clients of the session are closed when closing the session. This solves the invisible, hidden clients still running even after nsmd quit itself. Also Decrease wait time for such clients at session quit from extreme 60s to very long 30s.

tags/v1.6.1
Nils 2 years ago
parent
commit
0835ca284e
2 changed files with 30 additions and 9 deletions
  1. +6
    -0
      CHANGELOG
  2. +24
    -9
      src/nsmd.cpp

+ 6
- 0
CHANGELOG View File

@@ -5,6 +5,12 @@ Two empty lines before the next entry.
External contributors notice at the end of the line: (LastName, FirstName / nick)


## 2022-10-15 1.6.1
Absolutely make sure that all clients of the session are closed when closing the session.
This solves the invisible, hidden clients still running even after nsmd quit itself.
Decrease wait time for such clients at session quit from extreme 60s to very long 30s.


## 2022-04-15 1.6.0
nsmd:
Now follows the XDG Base Directory Specifications.


+ 24
- 9
src/nsmd.cpp View File

@@ -1158,12 +1158,14 @@ wait_for_killed_clients_to_die ( )
{
struct signalfd_siginfo fdsi;

MESSAGE( "Waiting for killed clients to die." );

for ( int i = 0; i < 60; i++ )
MESSAGE( "Waiting 30 seconds for killed clients to die." );
for ( int i = 0; i < 30; i++ )
{
if ( ! killed_clients_are_alive() )
goto done;
{
MESSAGE( "All clients have died." );
return;
}

ssize_t s = read(signal_fd, &fdsi, sizeof(struct signalfd_siginfo));

@@ -1181,13 +1183,26 @@ wait_for_killed_clients_to_die ( )
sleep(1);
}

WARNING( "Killed clients are still alive" );

/* The clients that are still alive are dangerous to the user.
* Their GUI will be most likely hidden or non-responsive, their jack client still open.
* And now the session will close, maybe even nsmd will quit. The hanging process is left
* open and invisible to the user. As a last resort it must be killed until we lose control over
* the process.
*/
WARNING( "Killed clients are still alive" );
std::list<Client*> *cl = &client;
for ( std::list<Client*>::iterator i = cl->begin();
i != cl->end();
++i )
{
if ( (*i)->pid > 0 )
{
WARNING( "SIGKILL to: %s", (*i)->name_with_id );
kill( (*i)->pid, SIGKILL );
}
}
return;

done:

MESSAGE( "All clients have died." );
}




Loading…
Cancel
Save