diff options
author | Simon Rettberg | 2013-12-20 18:31:28 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-12-20 18:31:28 +0100 |
commit | 7b098d7835923948f4053c23a1266bd8497c2aee (patch) | |
tree | 436c5099db82b0f641f7318fc8c67c2ab27073fe /server | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-7b098d7835923948f4053c23a1266bd8497c2aee.tar.gz tm-scripts-7b098d7835923948f4053c23a1266bd8497c2aee.tar.xz tm-scripts-7b098d7835923948f4053c23a1266bd8497c2aee.zip |
Rework session handling wrt home directory mounting and persistence again. Don't try to force a user's home to /home/<username> anymore.
Diffstat (limited to 'server')
-rwxr-xr-x | server/modules/pam-freiburg/etc/profile.d/00-autostart.sh | 37 | ||||
-rw-r--r-- | server/modules/pam-freiburg/opt/openslx/scripts/pam_script_mount_persistent_user | 34 |
2 files changed, 37 insertions, 34 deletions
diff --git a/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh b/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh new file mode 100755 index 00000000..a6c4744f --- /dev/null +++ b/server/modules/pam-freiburg/etc/profile.d/00-autostart.sh @@ -0,0 +1,37 @@ +#!/bin/ash + +TEMP_HOME_DIR="$HOME" +PERSISTENT_HOME_DIR="$HOME/PERSISTENT" + +if [ -d "$PERSISTENT_HOME_DIR" ]; then + + # Persistent home was mounted, take care of some conveinience + # Dirs + for file in .vim .mozilla .thunderbird .config/chromium .config/htop .config/openslx; do + [ -e "$TEMP_HOME_DIR/$file" ] && break + if [ "x$(dirname "$file")" != "x." ]; then + mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")" + fi + if [ ! -d "$PERSISTENT_HOME_DIR/$file" ]; then + mkdir -p "$PERSISTENT_HOME_DIR/$file" + fi + ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file" + done + # Files + for file in .bashrc .profile .vimrc .gitconfig; do + [ -e "$TEMP_HOME_DIR/$file" ] && break + if [ "x$(dirname "$file")" != "x." ]; then + mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")" + fi + if [ ! -e "$PERSISTENT_HOME_DIR/$file" ]; then + touch "$PERSISTENT_HOME_DIR/$file" + fi + ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file" + done + # Check if user has autostart script and run it (so they can create more symlinks etc.) + if [ -x "$PERSISTENT_HOME_DIR/AUTOSTART" ]; then + "$PERSISTENT_HOME_DIR/AUTOSTART" + fi + +fi + diff --git a/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_mount_persistent_user b/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_mount_persistent_user deleted file mode 100644 index 3f4bba49..00000000 --- a/server/modules/pam-freiburg/opt/openslx/scripts/pam_script_mount_persistent_user +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/ash -# Called by pam_script_mount_persistent -# Run as the user that is opening a session - -# Persistent home was mounted, take care of some conveinience -# Dirs -for file in .vim .mozilla .thunderbird .config/chromium .config/htop .config/openslx; do - if [ "x$(dirname "$file")" != "x." ]; then - mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")" - chown -R "$PAM_USER:$PAM_GROUP" "$TEMP_HOME_DIR/${file%%/*}" - fi - if [ ! -d "$PERSISTENT_HOME_DIR/$file" ]; then - mkdir -p "$PERSISTENT_HOME_DIR/$file" - chown -R "$PAM_USER:$PAM_GROUP" "$PERSISTENT_HOME_DIR/${file%%/*}" - fi - ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file" -done -# Files -for file in .bashrc .profile .vimrc .gitconfig; do - if [ "x$(dirname "$file")" != "x." ]; then - mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")" - chown -R "$PAM_USER:$PAM_GROUP" "$TEMP_HOME_DIR/${file%%/*}" - fi - if [ ! -d "$PERSISTENT_HOME_DIR/$file" ]; then - mkdir -p "$PERSISTENT_HOME_DIR/$file" - chown -R "$PAM_USER:$PAM_GROUP" "$PERSISTENT_HOME_DIR/${file%%/*}" - fi - ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file" -done -# Check if user has autostart script and run it (so they can create more symlinks etc.) -if [ -x "$PERSISTENT_HOME_DIR/AUTOSTART" ]; then - "$PERSISTENT_HOME_DIR/AUTOSTART" -fi - |