diff options
Diffstat (limited to 'remote/modules')
| -rw-r--r-- | remote/modules/busybox/openslx-busybox-config | 2 | ||||
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/remote/modules/busybox/openslx-busybox-config b/remote/modules/busybox/openslx-busybox-config index ae9f9ede..1dcae3db 100644 --- a/remote/modules/busybox/openslx-busybox-config +++ b/remote/modules/busybox/openslx-busybox-config @@ -924,7 +924,7 @@ CONFIG_KILLALL=y CONFIG_PIDOF=y # CONFIG_FEATURE_PIDOF_SINGLE is not set # CONFIG_FEATURE_PIDOF_OMIT is not set -CONFIG_PKILL=y +# CONFIG_PKILL is not set CONFIG_PS=y CONFIG_FEATURE_PS_WIDE=y CONFIG_FEATURE_PS_LONG=y 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..7c533405 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 @@ -6,15 +6,21 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/o # NSA needs to know slxlog "session-close" "$PAM_USER logged out on $PAM_TTY" +# do not kill all root processes :) +[ "x${PAM_USER}" == "xroot" ] && exit 0 + OPENSESSIONS=$(loginctl | grep "${PAM_USER}" | wc -l) 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}" |
