summaryrefslogtreecommitdiffstats
path: root/remote/modules/pam/data/opt
diff options
context:
space:
mode:
authorJonathan Bauer2013-12-02 15:34:11 +0100
committerJonathan Bauer2013-12-02 15:34:11 +0100
commitcc6bac243700d68f6dc6a8cfb6404566d1b732c5 (patch)
tree83d2315d2d5a128abff5c11aaf3ff2e890e347f1 /remote/modules/pam/data/opt
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-cc6bac243700d68f6dc6a8cfb6404566d1b732c5.tar.gz
tm-scripts-cc6bac243700d68f6dc6a8cfb6404566d1b732c5.tar.xz
tm-scripts-cc6bac243700d68f6dc6a8cfb6404566d1b732c5.zip
[pam] add a timeout for pkill check
Diffstat (limited to 'remote/modules/pam/data/opt')
-rwxr-xr-xremote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close9
1 files changed, 6 insertions, 3 deletions
diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
index 4d26d685..c568c4cf 100755
--- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
+++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
@@ -12,9 +12,12 @@ if [ "x${OPENSESSIONS}" == "x1" ]; then
# last sessions, close all ghost user processes
pkill -u "${PAM_USER}"
- # check if it worker
- while ps aux | grep -v grep | grep -q "${PAM_USER}"; do
- sleep 1
+ # check if user's process are still running
+ for TIMEOUT in 1 1 1 2; do
+ if ! ps aux | grep -v grep | grep -q "${PAM_USER}"; then
+ break;
+ fi
+ sleep "${TIMEOUT}"
done
# all done, kill it again to be sure
pkill -9 -u "${PAM_USER}"