1

In makefile, i used 'install' command as below

command:'install -o 1010 -g 100 -m 0755 -D path'

instead of checking user name and group name i would like to check uid and gid.

Consider the following scenario.

Step 1:

System 1: User corresponding to UID 1010 is “XXXX”. Using “System 1” create RPM installer.

Step 2:

System 2: User corresponding to UID 1010 is “YYYY” While installing RPM file we get a warning message saying “warning: user XXXX does not exist – using root”

In this step i assume the logged in user’s UID should be equal to “1010” for the RPM installer to install successfully. But what actually happens is, the RPM installer expects the user name to be equal in the installation system

2 Answers 2

1

Well, across different machines the uid/oid/gid can have different values unless you're using something like LDAP. Even then, the users which are defined on your system will have their own id-s. There is no guarantee that the user will exist on another machine.

Perhaps you should further explain your use case?

1

Use the %files section of your RPM's .spec file to set the ownership expected on the installed system (System 2 in your question).

You may also use the %pre section of your RPM's .spec file to determine if the expected users and groups actually exist on the installed system (System 2 in your question).

%files
# Set file permissions and ownership

%pre
# Check if expected user 'myuser' exists. If not, exit with an error.
# Check if expected group 'mygroup' exists. If not, exit with an error

Further reading at rpm.org.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .