diff options
| author | Simon Rettberg | 2013-12-02 15:56:14 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2013-12-02 15:56:14 +0100 |
| commit | 5d92f3a8f8fdfeb6b15819898154ee7a40e8d901 (patch) | |
| tree | 38a496bd84b8fd79959348486aeff8a01d4d8a9d /remote/modules | |
| parent | ...ash compat... (diff) | |
| parent | [pam] do not kill root processes on logout :) (diff) | |
| download | tm-scripts-5d92f3a8f8fdfeb6b15819898154ee7a40e8d901.tar.gz tm-scripts-5d92f3a8f8fdfeb6b15819898154ee7a40e8d901.tar.xz tm-scripts-5d92f3a8f8fdfeb6b15819898154ee7a40e8d901.zip | |
Merge branch 'master' of dnbd3:openslx-ng/tm-scripts
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}" |
