Browse Source

Fix package versioning issues. (#15125)

* Fix RPM version conditionals in plugin packages.

* Match versioning behavior between DEB and RPM.

* Make plugin dependencies strictly versioned.

* Fix debugfs DEB package building.

* Properly fix DEB version conflicts.

* Fix plugin ownership in DEB packages.

* Fix plugin permission ordering.
Austin S. Hemmelgarn 1 year ago
parent
commit
108b570e36

+ 23 - 23
contrib/debian/control

@@ -64,7 +64,7 @@ Package: netdata-plugin-cups
 Architecture: any
 Depends: cups,
          ${shlibs:Depends},
-         netdata (>= ${source:Version})
+         netdata (= ${source:Version})
 Description: The CUPS metrics collection plugin for the Netdata Agent
  This plugin allows the Netdata Agent to collect metrics from the Common
  UNIX Printing System.
@@ -73,7 +73,7 @@ Package: netdata-plugin-freeipmi
 Architecture: any
 Depends: freeipmi,
          ${shlibs:Depends},
-         netdata (>= ${source:Version})
+         netdata (= ${source:Version})
 Description: The FreeIPMI metrics collection plugin for the Netdata Agent
  This plugin allows the Netdata Agent to collect metrics from hardware
  using FreeIPMI.
@@ -81,8 +81,8 @@ Description: The FreeIPMI metrics collection plugin for the Netdata Agent
 Package: netdata-plugin-nfacct
 Architecture: any
 Depends: ${shlibs:Depends},
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The NFACCT metrics collection plugin for the Netdata Agent
  This plugin allows the Netdata Agent to collect metrics from the firewall
  using NFACCT objects.
@@ -90,8 +90,8 @@ Description: The NFACCT metrics collection plugin for the Netdata Agent
 Package: netdata-plugin-chartsd
 Architecture: all
 Depends: bash,
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Suggests: apcupsd, nut, iw, sudo
 Description: The charts.d metrics collection plugin for the Netdata Agent
  This plugin adds a selection of additional collectors written in shell
@@ -101,10 +101,10 @@ Description: The charts.d metrics collection plugin for the Netdata Agent
 Package: netdata-plugin-ebpf
 Architecture: amd64
 Depends: ${shlibs:Depends},
-         netdata (>= ${source:Version})
-Recommends: netdata-ebpf-code-legacy (>= ${source:Version}),
-            netdata-plugin-apps (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Recommends: netdata-ebpf-code-legacy (= ${source:Version}),
+            netdata-plugin-apps (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The eBPF metrics collection plugin for the Netdata Agent
  This plugin allows the Netdata Agent to use eBPF code to collect more
  detailed kernel-level metrics for the system.
@@ -112,7 +112,7 @@ Description: The eBPF metrics collection plugin for the Netdata Agent
 Package: netdata-ebpf-code-legacy
 Architecture: amd64
 Depends: netdata-plugin-ebpf (= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: Compiled eBPF legacy code for the Netdata eBPF plugin
  This package provides the pre-compiled eBPF legacy code for use by
  the Netdata eBPF plugin.  This code is only needed when using the eBPF
@@ -122,9 +122,9 @@ Description: Compiled eBPF legacy code for the Netdata eBPF plugin
 Package: netdata-plugin-pythond
 Architecture: all
 Depends: ${shlibs:Depends},
-         netdata (>= ${source:Version})
+         netdata (= ${source:Version})
 Suggests: sudo
-Conflicts: netdata (< ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The python.d metrics collection plugin for the Netdata Agent
  Many of the collectors provided by this package are also available
  in netdata-plugin-god. In msot cases, you probably want to use those
@@ -134,9 +134,9 @@ Package: netdata-plugin-go
 Architecture: any
 Depends: ${shlibs:Depends},
          libcap2-bin,
-         netdata (>= ${source:Version})
+         netdata (= ${source:Version})
 Suggests: nvme-cli, sudo
-Conflicts: netdata (< ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The go.d metrics collection plugin for the Netdata Agent
  This plugin adds a selection of additional collectors written in Go to
  the Netdata Agent. A significant percentage of the application specific
@@ -147,8 +147,8 @@ Package: netdata-plugin-apps
 Architecture: any
 Depends: ${shlibs:Depends},
          libcap2-bin,
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The per-application metrics collection plugin for the Netdata Agent
  This plugin allows the Netdata Agent to collect per-application and
  per-user metrics without using cgroups.
@@ -157,8 +157,8 @@ Package: netdata-plugin-slabinfo
 Architecture: any
 Depends: ${shlibs:Depends},
          libcap2-bin,
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The slabinfo metrics collector for the Netdata Agent
  This plugin allows the Netdata Agent to collect perfromance and
  utilization metrics for the Linux kernel’s SLAB allocator.
@@ -167,8 +167,8 @@ Package: netdata-plugin-perf
 Architecture: any
 Depends: ${shlibs:Depends},
          libcap2-bin,
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The perf metrics collector for the Netdata Agent
  This plugin allows the Netdata to collect metrics from the Linux perf
  subsystem.
@@ -177,8 +177,8 @@ Package: netdata-plugin-debugfs
 Architecture: any
 Depends: ${shlibs:Debends},
          libcap2-bin,
-         netdata (>= ${source:Version})
-Conflicts: netdata (< ${source:Version})
+         netdata (= ${source:Version})
+Conflicts: netdata (<< ${source:Version})
 Description: The debugfs metrics collector for the Netdata Agent
  This plugin allows the Netdata Agent to collect Linux kernel metrics
  exposed through debugfs.

+ 1 - 0
contrib/debian/netdata-plugin-apps.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/apps.plugin
     setcap "cap_dac_read_search=eip cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/apps.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-debugfs.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/debugfs.plugin
     setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/debugfs.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-ebpf.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/ebpf.plugin
     chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-freeipmi.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/freeipmi.plugin
     chmod -f 4750 /usr/libexec/netdata/plugins.d/freeipmi.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-go.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/go.d.plugin
     setcap "cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-nfacct.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/nfacct.plugin
     chmod -f 4750 /usr/libexec/netdata/plugins.d/nfacct.plugin
     ;;
 esac

+ 1 - 0
contrib/debian/netdata-plugin-perf.postinst

@@ -4,6 +4,7 @@ set -e
 
 case "$1" in
   configure|reconfigure)
+    chown root:netdata /usr/libexec/netdata/plugins.d/perf.plugin
     if capsh --supports=cap_perfmon 2>/dev/null; then
         setcap cap_perfmon+ep /usr/libexec/netdata/plugins.d/perf.plugin
     else

+ 2 - 1
contrib/debian/netdata-plugin-slabinfo.postinst

@@ -4,7 +4,8 @@ set -e
 
 case "$1" in
   configure|reconfigure)
-    setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/apps.plugin
+    chown root:netdata /usr/libexec/netdata/plugins.d/slabinfo.plugin
+    setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/slabinfo.plugin
     ;;
 esac
 

+ 0 - 1
contrib/debian/netdata.postinst

@@ -59,7 +59,6 @@ case "$1" in
     dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1
 
     chown -R root:netdata /usr/libexec/netdata/plugins.d
-    setcap cap_dac_read_search+ep /usr/libexec/netdata/plugins.d/debugfs.plugin
 
     chmod 4750 /usr/libexec/netdata/plugins.d/cgroup-network
 

Some files were not shown because too many files changed in this diff