Commit 4bbe44f5 authored by Benjamin Baer's avatar Benjamin Baer
Browse files

userlogout now only stops tl-xinit, waits for 5 seconds, kills all task left of the user.

parent bb9fd91a
......@@ -6,6 +6,7 @@ import logging
import re
import shutil
import subprocess
import time
import pwd
import stat
import deployit.deployitlogging
......@@ -33,17 +34,10 @@ class LogoutUser(managementagent.RabbitModule):
for username in usernames:
logger.debug('trying to kill user %s', username)
if 'force' in instructions:
force = instructions['force']
force = False
if force == True:
process = subprocess.Popen(['/usr/bin/pkill', '-u', username, '-KILL'])
process = subprocess.Popen(['/usr/bin/pkill', '-u', username])
process = subprocess.Popen(['/usr/bin/pkill', '-u', username, ' tl-xinit'])
subprocess.Popen(['/usr/bin/pkill', '-u', username, '-KILL'])
Please register or sign in to reply
if process.returncode != 0:
logger.warning("Failed to logout user %s", username)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment