Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude directories owned by the filesystem package #666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eoly
Copy link

@eoly eoly commented Apr 12, 2016

Description

This addresses #663.

Directories owned by the filesystem package should be excluded from the RPM produced by Omnibus.

From: https://fedoraproject.org/wiki/Packaging:Guidelines#File_and_Directory_Ownership

Directory ownership is a little more complex than file ownership. Packages must own all directories they put files in, except for:
any directories owned by the filesystem, man, or other explicitly created -filesystem packages
any directories owned by other packages in your package's natural dependency chain


/cc @chef/omnibus-maintainers <- This ensures the Omnibus Maintainers team are notified to review this PR.

@yzl
Copy link
Contributor

yzl commented Apr 13, 2016

Hello @eoly, thanks for your work so far on this! Omitting the systems directories will cause compatibility issues with rpm5, which requires that the full tree be declared. omnibus handles this case by writing spec file entries for directories owned by the filesystem package that specify the same ownership and permissions they are given in the filesystem package. Is this a change you would have time/inclination to make?

@eoly
Copy link
Author

eoly commented Apr 13, 2016

Hi @yzl,

After looking a little deeper the issue I was running into in #663 happens because I was doing it wrong. I was trying to install my systemd unit file into /lib/systemd/system but should have been using /usr/lib/systemd/system. See RHEL Docs

Manually copying the unit file was working because /lib symlinks to /usr/lib. However the RPM builder code does not handle the symlink properly and results in a conflict when trying to install the package.

I'm not sure that any code changes need to be made. If you agree please feel free to close this out.

Thanks,
Eric

(details below)

[root@localhost omnibus-test]# ls -lah /
total 70K
dr-xr-xr-x. 19 root root 4.0K Apr  8 11:29 .
dr-xr-xr-x. 19 root root 4.0K Apr  8 11:29 ..
lrwxrwxrwx.  1 root root    7 Apr  4 17:57 bin -> usr/bin
dr-xr-xr-x.  5 root root 1.0K Apr  8 09:43 boot
drwxr-xr-x. 18 root root 2.9K Apr 13 15:49 dev
drwxr-xr-x. 82 root root 4.0K Apr 13 15:49 etc
drwxr-xr-x.  3 root root 4.0K Apr  4 18:08 home
lrwxrwxrwx.  1 root root    7 Apr  4 17:57 lib -> usr/lib
lrwxrwxrwx.  1 root root    9 Apr  4 17:57 lib64 -> usr/lib64

In my project definition I was declaring:

extra_package_file "/lib/systemd/system/thing.service"

Which causes /lib to get added the RPM SPEC like so:

%dir %attr(0755,root,root) /lib

That seems to be where the conflict with the filesystem package happens.

By changing the extra_package_file definition of the systemd service to:

extra_package_file "/usr/lib/systemd/system/thing.service"

The RPM SPEC sets the proper permissions on the /usr and /usr/lib dirs:

%dir %attr(0755,root,root) /usr
%dir %attr(0555,root,root) /usr/lib

The code here handles the /usr/lib permissions properly but not /lib as it is a symllink.

tomashley pushed a commit to tomashley/omnibus that referenced this pull request Aug 9, 2016
hacky see: chef#666

could really do with omnibus passing in config file options
much as the brilliant fpm does
cwjohnston added a commit to sensu/omnibus that referenced this pull request Jan 18, 2017
We've found that RHEL 5 ships with mode 0755 on /usr/bin, while RHEL 6
and 7 ship with mode 0555. As a result, installing packages built for RHEL 6 or
7 contain files destined for /usr/bin will fail thusly:

```
file /usr/bin from install of sensu-1:0.27.0.beta.2-1.el7.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64
```

An solution solution would be to implement an approach which considers the
permissions specified by the system's `filesystem` package at build time (see
chef#666 (comment)). For now, we'll
kick the can down the road a bit.

Signed-off-by: Cameron Johnston <cameron@rootdown.net>
cwjohnston added a commit to sensu/omnibus that referenced this pull request Jan 18, 2017
We've found that RHEL 5 ships with mode 0755 on /usr/bin, while RHEL 6
and 7 ship with mode 0555. As a result, installing packages built for RHEL 6 or
7 contain files destined for /usr/bin will fail thusly:

```
file /usr/bin from install of sensu-1:0.27.0.beta.2-1.el7.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64
```

An solution solution would be to implement an approach which considers the
permissions specified by the system's `filesystem` package at build time (see
chef#666 (comment)). For now, we'll
kick the can down the road a bit.

Signed-off-by: Cameron Johnston <cameron@rootdown.net>
cwjohnston added a commit to sensu/omnibus that referenced this pull request Jan 18, 2017
We've found that RHEL 5 ships with mode 0755 on /usr/bin, while RHEL 6
and 7 ship with mode 0555. As a result, installing packages built for RHEL 6 or
7 contain files destined for /usr/bin will fail thusly:

```
file /usr/bin from install of sensu-1:0.27.0.beta.2-1.el7.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64
```

An solution solution would be to implement an approach which considers the
permissions specified by the system's `filesystem` package at build time (see
chef#666 (comment)). For now, we'll
kick the can down the road a bit.

Signed-off-by: Cameron Johnston <cameron@rootdown.net>
@tas50 tas50 removed the Signed CLA label Aug 10, 2018
amdprophet pushed a commit to sensu/omnibus that referenced this pull request Mar 8, 2019
We've found that RHEL 5 ships with mode 0755 on /usr/bin, while RHEL 6
and 7 ship with mode 0555. As a result, installing packages built for RHEL 6 or
7 contain files destined for /usr/bin will fail thusly:

```
file /usr/bin from install of sensu-1:0.27.0.beta.2-1.el7.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64
```

An solution solution would be to implement an approach which considers the
permissions specified by the system's `filesystem` package at build time (see
chef#666 (comment)). For now, we'll
kick the can down the road a bit.

Signed-off-by: Cameron Johnston <cameron@rootdown.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants