[gdm-list] PostLogin $HOME is not doing anything



Hi there,

I'm trying to create a random directory, set the current sessions home directory to it, copy the default profile to it and then make sure proper ownership is set.  I am trying to create a public terminal kiosk where the autologin is the same via XDMCP.  I have created a Default script for PostLogin, which works except after it runs on Login the session is still on the original home directory.

 A quote from http://library.gnome.org/admin/gdm/stable/configuration.html.en

After the user has been successfully authenticated GDM will run the PostLogin script. This is done before any session setup has been done, including before the pam_open_session call. This script is useful for doing any session initialization that needs to happen before the session starts. For example, you might setup the user's $HOME directory if needed.

So I created this:

 #!/bin/bash
#
# Note: this is a sample and will not be run as is.  Change the name of this
# file to <gdmconfdir>/PostLogin/Default for this script to be run.  This
# script will be run before any setup is run on behalf of the user and is
# useful if you for example need to do some setup to create a home directory
# for the user or something like that.  $HOME, $LOGIN and such will all be
# set appropriately and this script is run as root.
env > /tmp/aaa
if [ $USER == "google-chrome" ]
        then
        echo "Inside Loop" >> /tmp/aaa
        export HOME=/home/google-chrome-`date +%N | md5sum | awk '{ print \$1; }'`
        rsync -avz /home/google-chrome/* $HOME
        chown -R google-chrome:google-chrome $HOME
        env >> /tmp/aaa
        fi

-----

Which I would have expected to have done what I needed but after this is ran the login still reverts back to the original home directory.  If I use usermod -d $HOME google-chrome here as well I still end up with the original home directory.  Could someone please shed some light on how to do this.  I can figure out how to check for duplicates later and how to remove stale ones at the end of the day, but I need to get the session to listen to me first.

/tmp/aaa:

fuzzy@wifi-term:/etc/gdm3/PreSession$ cat /tmp/aaa
SHELL=/bin/bash
USER=google-chrome
X_SERVERS=/var/lib/gdm3/:12.Xservers
USERNAME=google-chrome
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
PWD=/var/lib/gdm3
GDM_PARENT_DISPLAY=:0
SHLVL=1
HOME=/home/google-chrome
GDM_PARENT_XAUTHORITY=/var/run/gdm3/auth-for-fuzzy-a8PRo9/database
LOGNAME=google-chrome
DISPLAY=:12
RUNNING_UNDER_GDM=true
XAUTHORITY=/var/run/gdm3/auth-for-Debian-gdm-nGxNR1/database
_=/usr/bin/env
Inside Loop
SHELL=/bin/bash
USER=google-chrome
X_SERVERS=/var/lib/gdm3/:12.Xservers
USERNAME=google-chrome
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
PWD=/var/lib/gdm3
GDM_PARENT_DISPLAY=:0
SHLVL=1
HOME=/home/google-chrome-60d0c68156f857b1a2e02f701bb029b2
GDM_PARENT_XAUTHORITY=/var/run/gdm3/auth-for-fuzzy-a8PRo9/database
LOGNAME=google-chrome
DISPLAY=:12
RUNNING_UNDER_GDM=true
XAUTHORITY=/var/run/gdm3/auth-for-Debian-gdm-nGxNR1/database
_=/usr/bin/env





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]