I am experiencing a behavior in the installation of a .deb package that I don't really understand.
I have a set of "things" in my computer that I deploy to remote computers using a .deb package. I work in my local machine logged as the user "
borrajax". There's also a "
borrajax" user in the remote machine where I install my .deb. When I need to deploy my "things", I create a .deb package in my machine (with
sudo dpkg --build), copy it to the remote machine and install it with
sudo dpkg -i myPackage.deb . When I do that, the "expanded" (or installed) files become owned by the local user
borrajax, which is good.
Now, I have a coworker that also tries to do the same thing but he is logged in as a different local username (he doesn't have a
borrajax user in his machine, but...
foobar - I guess his parents didn't like him much-). He follows exactly the same process I do with my local user
borrajax but with his local
foobar user: Create the
.deb in his machine, copy it to the remote machine and install it with
dpkg -i. Well... In that case, the installed files become owned by
root, which prevents the installation to continue (which is not a bug, but a feature).
All these machines are Ubuntu (11.10 mine, 12.04 the remote one and my coworker's one) so what I would like is the package become installed with whatever user has the uuid 1000. I would expect the name not to be so relevant (It may be just a coincidence there's a
borrajax user in my machine and in the remote one).
So in this case, the username seems very relevant. Why is that? As I mentioned earlier, my local user
borrajax, my coworker's
foobar and the
borrajax in the remote machine are all the uid=1000. Why does the user's name (seem to be) so important? My local
borrajax user may not have anything to see at all with the
borrajax in the remote machine. If the package was created by the user with uid 1000, why "sometimes" (if I've created it) it is installed with whatever user has the uid 1000 in the remote machine and "sometimes" it's installed with root (if my coworker has created it)?
I can always change the owner of the installed files using
chown 1000 in the postint script, or use some other kind of workaround but I would like to understand first why is this happening, and how is it that the username in two different machines seems so important?
Thank you in advance