diff options
author | Jonathan Bauer | 2013-12-02 15:34:11 +0100 |
---|---|---|
committer | Jonathan Bauer | 2013-12-02 15:34:11 +0100 |
commit | cc6bac243700d68f6dc6a8cfb6404566d1b732c5 (patch) | |
tree | 83d2315d2d5a128abff5c11aaf3ff2e890e347f1 /remote/modules/pam/data/opt | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-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-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 9 |
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}" |