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 committed
May 31, 2023 at 10:53 UTC
108b570e36ef62dd6c7aca20ac3e3af6a2df5810
12 files changed
+48
-36
contrib/debian/control
+23
-23
@@ -64,7 +64,7 @@ Package: netdata-plugin-cups
64
Architecture: any
65
Depends: cups,
66
${shlibs:Depends},
67
- netdata (>= ${source:Version})
67
+ netdata (= ${source:Version})
68
Description: The CUPS metrics collection plugin for the Netdata Agent
69
This plugin allows the Netdata Agent to collect metrics from the Common
70
UNIX Printing System.
@@ -73,7 +73,7 @@ Package: netdata-plugin-freeipmi
73
Architecture: any
74
Depends: freeipmi,
75
${shlibs:Depends},
76
- netdata (>= ${source:Version})
76
+ netdata (= ${source:Version})
77
Description: The FreeIPMI metrics collection plugin for the Netdata Agent
78
This plugin allows the Netdata Agent to collect metrics from hardware
79
using FreeIPMI.
@@ -81,8 +81,8 @@ Description: The FreeIPMI metrics collection plugin for the Netdata Agent
81
Package: netdata-plugin-nfacct
82
Architecture: any
83
Depends: ${shlibs:Depends},
84
- netdata (>= ${source:Version})
85
-Conflicts: netdata (< ${source:Version})
84
+ netdata (= ${source:Version})
85
+Conflicts: netdata (<< ${source:Version})
86
Description: The NFACCT metrics collection plugin for the Netdata Agent
87
This plugin allows the Netdata Agent to collect metrics from the firewall
88
using NFACCT objects.
@@ -90,8 +90,8 @@ Description: The NFACCT metrics collection plugin for the Netdata Agent
90
Package: netdata-plugin-chartsd
91
Architecture: all
92
Depends: bash,
93
- netdata (>= ${source:Version})
94
-Conflicts: netdata (< ${source:Version})
93
+ netdata (= ${source:Version})
94
+Conflicts: netdata (<< ${source:Version})
95
Suggests: apcupsd, nut, iw, sudo
96
Description: The charts.d metrics collection plugin for the Netdata Agent
97
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
101
Package: netdata-plugin-ebpf
102
Architecture: amd64
103
Depends: ${shlibs:Depends},
104
- netdata (>= ${source:Version})
105
-Recommends: netdata-ebpf-code-legacy (>= ${source:Version}),
106
- netdata-plugin-apps (>= ${source:Version})
107
-Conflicts: netdata (< ${source:Version})
104
+ netdata (= ${source:Version})
105
+Recommends: netdata-ebpf-code-legacy (= ${source:Version}),
106
+ netdata-plugin-apps (= ${source:Version})
107
+Conflicts: netdata (<< ${source:Version})
108
Description: The eBPF metrics collection plugin for the Netdata Agent
109
This plugin allows the Netdata Agent to use eBPF code to collect more
110
detailed kernel-level metrics for the system.
@@ -112,7 +112,7 @@ Description: The eBPF metrics collection plugin for the Netdata Agent
112
Package: netdata-ebpf-code-legacy
113
Architecture: amd64
114
Depends: netdata-plugin-ebpf (= ${source:Version})
115
-Conflicts: netdata (< ${source:Version})
115
+Conflicts: netdata (<< ${source:Version})
116
Description: Compiled eBPF legacy code for the Netdata eBPF plugin
117
This package provides the pre-compiled eBPF legacy code for use by
118
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
122
Package: netdata-plugin-pythond
123
Architecture: all
124
Depends: ${shlibs:Depends},
125
- netdata (>= ${source:Version})
125
+ netdata (= ${source:Version})
126
Suggests: sudo
127
-Conflicts: netdata (< ${source:Version})
127
+Conflicts: netdata (<< ${source:Version})
128
Description: The python.d metrics collection plugin for the Netdata Agent
129
Many of the collectors provided by this package are also available
130
in netdata-plugin-god. In msot cases, you probably want to use those
@@ -134,9 +134,9 @@ Package: netdata-plugin-go
134
Architecture: any
135
Depends: ${shlibs:Depends},
136
libcap2-bin,
137
- netdata (>= ${source:Version})
137
+ netdata (= ${source:Version})
138
Suggests: nvme-cli, sudo
139
-Conflicts: netdata (< ${source:Version})
139
+Conflicts: netdata (<< ${source:Version})
140
Description: The go.d metrics collection plugin for the Netdata Agent
141
This plugin adds a selection of additional collectors written in Go to
142
the Netdata Agent. A significant percentage of the application specific
@@ -147,8 +147,8 @@ Package: netdata-plugin-apps
147
Architecture: any
148
Depends: ${shlibs:Depends},
149
libcap2-bin,
150
- netdata (>= ${source:Version})
151
-Conflicts: netdata (< ${source:Version})
150
+ netdata (= ${source:Version})
151
+Conflicts: netdata (<< ${source:Version})
152
Description: The per-application metrics collection plugin for the Netdata Agent
153
This plugin allows the Netdata Agent to collect per-application and
154
per-user metrics without using cgroups.
@@ -157,8 +157,8 @@ Package: netdata-plugin-slabinfo
157
Architecture: any
158
Depends: ${shlibs:Depends},
159
libcap2-bin,
160
- netdata (>= ${source:Version})
161
-Conflicts: netdata (< ${source:Version})
160
+ netdata (= ${source:Version})
161
+Conflicts: netdata (<< ${source:Version})
162
Description: The slabinfo metrics collector for the Netdata Agent
163
This plugin allows the Netdata Agent to collect perfromance and
164
utilization metrics for the Linux kernel’s SLAB allocator.
@@ -167,8 +167,8 @@ Package: netdata-plugin-perf
167
Architecture: any
168
Depends: ${shlibs:Depends},
169
libcap2-bin,
170
- netdata (>= ${source:Version})
171
-Conflicts: netdata (< ${source:Version})
170
+ netdata (= ${source:Version})
171
+Conflicts: netdata (<< ${source:Version})
172
Description: The perf metrics collector for the Netdata Agent
173
This plugin allows the Netdata to collect metrics from the Linux perf
174
subsystem.
@@ -177,8 +177,8 @@ Package: netdata-plugin-debugfs
177
Architecture: any
178
Depends: ${shlibs:Debends},
179
libcap2-bin,
180
- netdata (>= ${source:Version})
181
-Conflicts: netdata (< ${source:Version})
180
+ netdata (= ${source:Version})
181
+Conflicts: netdata (<< ${source:Version})
182
Description: The debugfs metrics collector for the Netdata Agent
183
This plugin allows the Netdata Agent to collect Linux kernel metrics
184
exposed through debugfs.
contrib/debian/netdata-plugin-apps.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/apps.plugin
8
setcap "cap_dac_read_search=eip cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/apps.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-debugfs.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/debugfs.plugin
8
setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/debugfs.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-ebpf.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/ebpf.plugin
8
chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-freeipmi.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/freeipmi.plugin
8
chmod -f 4750 /usr/libexec/netdata/plugins.d/freeipmi.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-go.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/go.d.plugin
8
setcap "cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-nfacct.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/nfacct.plugin
8
chmod -f 4750 /usr/libexec/netdata/plugins.d/nfacct.plugin
9
;;
10
esac
contrib/debian/netdata-plugin-perf.postinst
+1
@@ -4,6 +4,7 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/perf.plugin
8
if capsh --supports=cap_perfmon 2>/dev/null; then
9
setcap cap_perfmon+ep /usr/libexec/netdata/plugins.d/perf.plugin
10
else
contrib/debian/netdata-plugin-slabinfo.postinst
+2
-1
@@ -4,7 +4,8 @@ set -e
4
5
case "$1" in
6
configure|reconfigure)
7
- setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/apps.plugin
7
+ chown root:netdata /usr/libexec/netdata/plugins.d/slabinfo.plugin
8
+ setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/slabinfo.plugin
9
;;
10
esac
11
contrib/debian/netdata.postinst
-1
@@ -59,7 +59,6 @@ case "$1" in
59
dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1
60
61
chown -R root:netdata /usr/libexec/netdata/plugins.d
62
- setcap cap_dac_read_search+ep /usr/libexec/netdata/plugins.d/debugfs.plugin
62
63
chmod 4750 /usr/libexec/netdata/plugins.d/cgroup-network
64
contrib/debian/rules
+6
-1
@@ -120,6 +120,11 @@ override_dh_install:
120
mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/perf.plugin \
121
$(TOP)-plugin-perf/usr/libexec/netdata/plugins.d/perf.plugin
122
123
+ # Add debugfs plugin install rules
124
+ mkdir -p $(TOP)-plugin-debugfs/usr/libexec/netdata/plugins.d/
125
+ mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/debugfs.plugin \
126
+ $(TOP)-plugin-debugfs/usr/libexec/netdata/plugins.d/debugfs.plugin
127
+
128
# Set the rest of the software in the main package
129
#
130
cp -rp $(TEMPTOP)/usr $(TOP)
@@ -177,7 +182,7 @@ override_dh_fixperms:
182
chmod 0755 $(TOP)/usr/libexec/netdata/netdata-updater.sh
183
184
# debugfs plugin
180
- chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/debugfs.plugin
185
+ chmod 0750 $(TOP)-plugin-debugfs/usr/libexec/netdata/plugins.d/debugfs.plugin
186
187
# apps.plugin should only be runnable by the netdata user. It will be
188
# given extra capabilities in the postinst script.
netdata.spec.in
+10
-10
@@ -617,7 +617,7 @@ Summary: The NFACCT metrics collection plugin for the Netdata Agent
617
Group: Applications/System
618
Requires: libmnl
619
Requires: netdata = %{version}
620
-Conflicts: netdata <= %{version}
620
+Conflicts: netdata < %{version}
621
%if 0%{?fedora} || 0%{?suse_version} >= 1140
622
Requires: libnetfilter_acct
623
%endif
@@ -634,7 +634,7 @@ Summary: The charts.d metrics collection plugin for the Netdata Agent
634
Group: Applications/System
635
Requires: bash
636
Requires: netdata = %{version}
637
-Conflicts: netdata <= %{version}
637
+Conflicts: netdata < %{version}
638
%if 0%{?centos_ver} != 7
639
Suggests: nut
640
Suggests: apcupsd
@@ -660,7 +660,7 @@ It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless acces
660
Summary: The eBPF metrics collection plugin for the Netdata Agent
661
Group: Applications/System
662
Requires: netdata = %{version}
663
-Conflicts: netdata <= %{version}
663
+Conflicts: netdata < %{version}
664
%if 0%{?centos_ver} != 7
665
Recommends: netdata-plugin-apps = %{version}
666
Recommends: netdata-ebpf-legacy-code >= %{version}
@@ -683,7 +683,7 @@ Requires: netdata-ebpf-legacy-code >= %{version}
683
Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
684
Group: Applications/System
685
Requires: netdata-plugin-ebpf = %{version}
686
-Conflicts: netdata <= %{version}
686
+Conflicts: netdata < %{version}
687
688
%description ebpf-legacy-code
689
This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
@@ -699,7 +699,7 @@ This code is only needed when using the eBPF plugin with kernel versions before
699
Summary: The python.d metrics collection plugin for the Netdata Agent
700
Group: Applications/System
701
Requires: netdata = %{version}
702
-Conflicts: netdata <= %{version}
702
+Conflicts: netdata < %{version}
703
%if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
704
Requires: python
705
%else
@@ -730,7 +730,7 @@ want to use those versions instead of the Python versions.
730
Summary: The go.d metrics collection plugin for the Netdata Agent
731
Group: Applications/System
732
Requires: netdata = %{version}
733
-Conflicts: netdata <= %{version}
733
+Conflicts: netdata < %{version}
734
%if 0%{?centos_ver} != 7
735
Suggests: nvme-cli
736
Suggests: sudo
@@ -754,7 +754,7 @@ so most users will want it installed.
754
Summary: The per-application metrics collection plugin for the Netdata Agent
755
Group: Applications/System
756
Requires: netdata = %{version}
757
-Conflicts: netdata <= %{version}
757
+Conflicts: netdata < %{version}
758
759
%description plugin-apps
760
This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
@@ -770,7 +770,7 @@ Conflicts: netdata <= %{version}
770
Summary: The slabinfo metrics collector for the Netdata Agent
771
Group: Applications/System
772
Requires: netdata = %{version}
773
-Conflicts: netdata <= %{version}
773
+Conflicts: netdata < %{version}
774
775
%description plugin-slabinfo
776
This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
@@ -784,7 +784,7 @@ Conflicts: netdata <= %{version}
784
Summary: The perf metrics collector for the Netdata Agent
785
Group: Applications/System
786
Requires: netdata = %{version}
787
-Conflicts: netdata <= %{version}
787
+Conflicts: netdata < %{version}
788
789
%description plugin-perf
790
This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
@@ -803,7 +803,7 @@ Conflicts: netdata <= %{version}
803
Summary: The debugfs metrics collector for the Netdata Agent
804
Group: Applications/System
805
Requires: netdata = %{version}
806
-Conflicts: netdata <= %{version}
806
+Conflicts: netdata < %{version}
807
808
%description plugin-debugfs
809
This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.