diff options
| -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}" |
