On Tue, 2008-03-25 at 19:07 -0500, Brian Cameron wrote:
> I am trying to modify the gnome-cleanup script (refer to "man
> gnome-cleanup) so it will work in a zones environment.  I want to make
> it work so that if you run it as root, you can specify a userid, then it
> will clean away the user's GNOME configuration files in all zones.
> 
> First I get the users $HOME directory by running:
> 
>     /usr/bin/echo ~userid
> 
>     This returns "/home/userid"
> 

getent passwd userid might be a better idea?

> Second, I get the zone names by running this command:
> 
> /usr/sbin/zoneadm list -cv | grep running | grep -v global |
>     nawk '{ print $4}'
> 
> Then I loop over the values returned.  For each value, lets
> call it $ZONE_PATH, I then try to access the user's home
> directory by accessing:
> 
> $ZONE_PATH/root/home/userid
> 
> However, this directory doesn't exist because the real user's
> home directory is $ZONE_PATH/root/export/home/userid.  It seems
> that this gets mapped to $ZONE_PATH/root/home/userid by
> /etc/auto_home.
> 
> Is there any way (short of parsing the /etc/auto_home file
> directly) to figure out what the user's $HOME directory really
> is when the mounts are not yet setup?  Or is there a way to
> cause the mounts to get set up so that the
> $ZONE_PATH/root/home/userid directory will exist?  Or is there
> a better way to achieve what I am trying to do?
> 
> Thanks,
> 
> Brian


If the home dirs are shared between zones, or on a remote server, this
would seem to break down even if you could parse the auto_home. Maybe
the zone should just be required to be booted. Also, is it safe to
assume the username is unique between zones?
-Albert


Reply via email to