Re: %attr | Doubt

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

 



On March 12, 2007 1:18:37 PM +0530 Lis Maria <lismariain@xxxxxxxxx> wrote:
Hi

Actually, what happens in my RPM building & releasing is ....

I am creating the RPM in a seperate box as some user, and then i am trying
to install the RPM on a different box as user 'lis'.

The user you use when creating the rpm is irrelevant if you specify a
username with %attr.  The only time the build username is relevant is if
your rpm is "sloppy" (well, this could be by the design of one's build
system but most likely not) and does not specify a username through
%attr or %defattr.  Then files in the rpm take on whatever owner they
have in the %buildroot, generally this is the build user.

So while installing, it actually searches for the user who built the
RPM, and since it is not there it takes root as default.

I have never heard of that, can you demonstrate this to be true?  Yes
if the user that a file in the rpm is owned by is not present on the
install system, it takes root as default, but this generally has nothing
to do with the user who built the rpm, since normally you set the owner
of each file through %defattr or %attr.

I cannot guarantee that the user who built the rpm will be present in the
release box,

As stated above, this normally does not matter, since normally you are
always explicit about who owns each and every file in an rpm through the
%defattr and %attr macros.

but i can ensure the 'lis' user will be there and i want lis
to
own all the files  installed through RPM .... :)

Then you merely need to set %defattr(-,lis,-) to have all files owned by
user lis or %attr(-,lis,-) to have some specific file owned by user lis.

You can do "rpm -qlvp <rpm filename>" on your rpm to see what the owner
is of each file in the rpm.  Like you said, if that user is not on the
system, it will be installed owned by root.  If that command does not
show user lis as the owner, you have done something wrong in your spec
file and are not properly setting the owner.  If that command does show
user lis as the owner, but files are still installed as user root, then
something is wrong with your install step.  Since you're installing with
sudo, my first step would be to try "sudo getent passwd lis" and see if
that works.  In complex environments sometimes sudo won't have the correct
privileges for some things.

-frank

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux