summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2020-04-23 16:17:48 +0200
committerSimon Rettberg2020-04-23 16:17:48 +0200
commit0dbbf00865f42dffde61399dcbbef1e22ced632e (patch)
treea6a0433b97ba596c1588a92a891b1c04ccd48395
parentFix null pointer access (diff)
downloadidle-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index 3037b30..7cd5e5c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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 ) {