diff options
author | Simon Rettberg | 2020-04-23 16:17:48 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-04-23 16:17:48 +0200 |
commit | 0dbbf00865f42dffde61399dcbbef1e22ced632e (patch) | |
tree | a6a0433b97ba596c1588a92a891b1c04ccd48395 | |
parent | Fix null pointer access (diff) | |
download | idle-daemon-0dbbf00865f42dffde61399dcbbef1e22ced632e.tar.gz idle-daemon-0dbbf00865f42dffde61399dcbbef1e22ced632e.tar.xz idle-daemon-0dbbf00865f42dffde61399dcbbef1e22ced632e.zip |
Tweak session killing, don't try login process right away
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -97,9 +97,9 @@ void killSession( const struct user * user ) if ( user->sessionName[0] != '\0' ) { printf( "Terminating session %s of %s.\n", user->sessionName, user->user ); run( true, "loginctl", "terminate-session", user->sessionName ); - sleep( 5 ); - if ( kill( user->sessionLeader, 0 ) == -1 - && ( user->sessionHead == 0 || kill( user->sessionHead, 0 ) == -1 ) ) + sleep( 2 ); + if ( kill( user->sessionLeader, SIGTERM ) == -1 + || user->sessionHead == 0 || kill( user->sessionHead, 0 ) == -1 ) exit( 0 ); } if ( user->sessionHead != 0 && kill( user->sessionHead, SIGTERM ) == 0 ) { |