Bug 248843

Summary: sysutils/beats6: Hardlinks between usr/local/share and var/db
Product: Ports & Packages Reporter: Eirik Oeverby <ltning-freebsd>
Component: Individual Port(s)Assignee: Juraj Lutter <otis>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: iron.udjin, marcarianalexandru, otis, rene
Priority: --- Flags: bugzilla: maintainer-feedback? (elastic)
Version: Latest   
Hardware: Any   
OS: Any   

Description Eirik Oeverby 2020-08-23 08:38:07 UTC
The port is creating hardlinks in stagedir which pollutes the package, making it impossible to install on systems where /usr/local/share and /var/db are on different filesystems (which will be a lot of systems).

Example file:
stage# find . -name Filebeat-Postgresql-slowlogs.json|xargs ls -i
313585 ./usr/local/share/beats/filebeat/module/postgresql/_meta/kibana/6/dashboard/Filebeat-Postgresql-slowlogs.json
313585 ./var/db/beats/filebeat/kibana/6/dashboard/Filebeat-Postgresql-slowlogs.json

The COPYTREE_SHARE macro uses cpio -l, which creates links instead of actually copying files.

Note: This probably also applies to sysutils/beats7
Comment 1 Juraj Lutter freebsd_committer freebsd_triage 2020-08-23 08:47:12 UTC
Thanks for the report, I will take care of it. Currently also beats7 is scheduled for update (final tests are pending), so I will look also on it.
Comment 2 Juraj Lutter freebsd_committer freebsd_triage 2020-08-23 09:23:46 UTC
beats7 does not install anything under /var/db/beats.

I'm also investigating why beats6 need(ed) kibana files under /var/db/beats.
Comment 3 iron.udjin 2020-09-14 09:42:00 UTC
I've got the same problem with hardlink:

===>  Installing for beats6-6.8.12
===>  Checking if beats6 is already installed
===>   Registering installation for beats6-6.8.12
Installing beats6-6.8.12...
pkg-static: Fail to create hardlink: /var/db/beats/filebeat/kibana/5/dashboard/.pkgtemp.0d3f2380-fa78-11e6-ae9b-81e5311e8cab.json.C1FvaODKD1bT:Cross-device link
*** Error code 70

Previous version of beats6 installs fine.
Comment 4 Eirik Oeverby 2020-10-09 21:33:45 UTC
Any progress on beats6?
Comment 5 Alex 2020-11-10 11:01:24 UTC
The problem was fixed in HEAD/beats6-6.8.13. Can you backport this to the 2020Q4 branch as well? 

Thanks very much!
Comment 6 Alex 2021-01-03 18:24:19 UTC
clean install and it's still happening unfortunately

Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        beats6: 6.8.13

Number of packages to be installed: 1

The process will require 23 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing beats6-6.8.13...
[1/1] Extracting beats6-6.8.13:  73%
pkg: Fail to create hardlink: /var/db/beats/filebeat/kibana/5/dashboard/.pkgtemp.0d3f2380-fa78-11e6-ae9b-81e5311e8cab.json.jko6i8c1p4lK:Cross-device link
[1/1] Extracting beats6-6.8.13: 100%
Comment 7 Rene Ladan freebsd_committer freebsd_triage 2023-01-01 12:44:10 UTC
Note that beats6 expired today, closing as OBE.