DSL Ideas and Suggestions :: chown in persistent home



/etc/init.d/dsl-config, line 267:
Code Sample
   260          if [ -d "/mnt/$MYHOME$HOME" ]; then
   261             mount --bind "/mnt/$MYHOME$HOME" "$HOME/"
   262          else
   263             mkdir -p "/mnt/$MYHOME$HOME"
   264             mount --bind "/mnt/$MYHOME$HOME" "$HOME/"
   265             tar -C /KNOPPIX/etc/skel -cf - . | tar -C "$HOME" -xf -
   266             printf 'wm: %s\nicons: %s\n' "$DESKTOP" "$ICONS" > "$HOME"/.desktop
   267             chown -Rh "$USER".staff "$HOME"
   268          fi


To me this looks like chown occurs only if the home directory does not already exist, but for some reason it seems to happen every time I boot.  I had a suspicion this was happening, but never actually looked into it until this morning.  Everything in my home directory is dsl.staff, even though I know positively that yesterday it wasn't.

I keep all my work files, including mydsl extensions, in a persistent home. Every time I package an extension I have to chown the files even if I'd already done it last time i worked on that project.  If I'm currently working on an extension and compress it to test, if I shut down, go to bed, and then decide I need to make a change the next day, I have to chown the files all over again.

It's not just the extensions, though. I also have a peculiar way of doing a partially persistent /root. Some of root's configuration files are linked to or copied from files in a subdirectory of /home/dsl, and they should belong to root. There are also a couple of system files that are copied from a subdirectory in home. This is done from bootlocal, so I can always chown them after the copy, but I shouldn't need to do this.

So....is this happening to anyone else with a persistent home?
My boot options:
root=/dev/hda3 vga=791 knoppix_name=KNOPPIX-4.2.3 dsl syslog legacy noswap noacpi noapm dma noscsi frugal home=hda4 mydsl=hda4/home/dsl/mydsl host=bungle

Perhaps there's a conflict with using mydsl inside home?

In any case, it doesn't seem like I'm doing anything technically wrong, so this might be considered a bug report, or at least a suggestion of something to look into.

Isn't this one of the changes made to accommodate the user cheatcode?

Edit: Why not change it to:
Code Sample
chown -Rh 1000:1000 "$HOME"

so that ownership doesn't change based on names of user.group?

That would require a remaster, wouldn't it?
But I am interested in knowing what difference 1000:1000 has. Is that a special uid/gid?

In any case, there shouldn't be a chown of any kind on a persistent directory once the directory has been set up and chowned the first time. If you change user and have the same partition for a persistent home, the home directory wouldn't be the same as the previous one anyway, so the user boot option should not have any influence on file ownership after the first boot.

Maybe I'm missing some vital information.  As I said above, the script looks to me like it should already be doing this properly, but for some reason all files in /home/dsl always end up dsl.staff every time I reboot.  I've also seen times when I'd get messages saying that the system couldn't change ownership of certain files in /home/dsl, which was the first time I noticed the autochown.

Fortunately -h was included, or I'd be seriously pissed =o)

Quote
But I am interested in knowing what difference 1000:1000 has. Is that a special uid/gid?
iirc I've seen most interactive user id/groups start at 1000.  So since the default (first) is dsl.staff, it is 1000:1000.  LSB says it can start at 500: http://refspecs.freestandards.org/LSB_3.2....ge.html

If it's set on numerical ownership, it doesn't matter if you're user dsl or user mikshaw or user foo. It wouldn't need to be remastered if Robert changes the script.
Next Page...
original here.