summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJonathan Bauer2013-11-14 16:05:08 +0100
committerJonathan Bauer2013-11-14 16:05:08 +0100
commitcfad63ae75c6f855cf89ef0f4c05451edf41fa12 (patch)
treef55aa92ecb63d0e7870b5579cec7ab9381c77a3b /server
parent[rootfs-stage32] Add code to create zram swap partitions (diff)
downloadtm-scripts-cfad63ae75c6f855cf89ef0f4c05451edf41fa12.tar.gz
tm-scripts-cfad63ae75c6f855cf89ef0f4c05451edf41fa12.tar.xz
tm-scripts-cfad63ae75c6f855cf89ef0f4c05451edf41fa12.zip
[pam-freiburg] added check for hung mount home directory stuff
Diffstat (limited to 'server')
-rwxr-xr-xserver/modules/pam-freiburg/opt/openslx/scripts/pam_script_ses_open15
1 files changed, 9 insertions, 6 deletions
diff --git a/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_ses_open b/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_ses_open
index abb353d8..c06f1bbb 100755
--- a/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_ses_open
+++ b/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_ses_open
@@ -27,12 +27,15 @@ if [ $(id -g $PAM_USER) -ge 1000 ]; then
# now we can mount the home directory!
mkdir -p /home/$PAM_USER
- if mount -t nfs4 -o rw,nosuid,nodev,nolock,intr,hard,sloppy,sec=krb5p "$FILESERVER":"$VOLUME" /home/"$PAM_USER"; then
- exit 0
- else
- echo "Failed to mount home directory for $PAM_USER"
- exit 1
+ chown "$PAM_USER" "/home/$PAM_USER"
+ mount -t nfs4 -o rw,nosuid,nodev,nolock,intr,hard,sloppy,sec=krb5p "$FILESERVER":"$VOLUME" /home/"$PAM_USER" &
+ MOUNT_PID=$!
+ for COUNTER in 1 2 4 4; do
+ kill -0 "$MOUNT_PID" || break
+ sleep "$COUNTER"
+ done
+ if kill -9 "$MOUNT_PID"; then
+ echo "Your home directory contents is unavailable. DO NOT SAVE ANYTHING HERE AS ALL WILL BE LOST UPON REBOOT!" > /home/"$PAM_USER"/WARNING.txt
fi
-
fi