Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/collectd/
Date: Mon, 05 Jun 2017 21:54:44
Message-Id: 1496699671.1896babcf77bcb82dbd2ccc3922bc964fb560b04.whissi@gentoo
1 commit: 1896babcf77bcb82dbd2ccc3922bc964fb560b04
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 5 21:54:12 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 5 21:54:31 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1896babc
7
8 app-admin/collectd: Cleanup old
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 app-admin/collectd/collectd-5.6.2-r2.ebuild | 531 ----------------------------
13 1 file changed, 531 deletions(-)
14
15 diff --git a/app-admin/collectd/collectd-5.6.2-r2.ebuild b/app-admin/collectd/collectd-5.6.2-r2.ebuild
16 deleted file mode 100644
17 index 86d127d423f..00000000000
18 --- a/app-admin/collectd/collectd-5.6.2-r2.ebuild
19 +++ /dev/null
20 @@ -1,531 +0,0 @@
21 -# Copyright 1999-2017 Gentoo Foundation
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI="6"
25 -
26 -PYTHON_COMPAT=( python{2_7,3_4,3_5} )
27 -JAVA_PKG_OPT_USE="collectd_plugins_java"
28 -
29 -inherit autotools fcaps flag-o-matic java-pkg-opt-2 linux-info multilib perl-functions python-single-r1 systemd user
30 -
31 -DESCRIPTION="Collects system statistics and provides mechanisms to store the values"
32 -
33 -HOMEPAGE="https://collectd.org/"
34 -SRC_URI="${HOMEPAGE%/}/files/${P}.tar.bz2"
35 -
36 -LICENSE="GPL-2"
37 -SLOT="0"
38 -KEYWORDS="amd64 ~arm x86"
39 -IUSE="contrib debug java kernel_Darwin kernel_FreeBSD kernel_linux perl selinux static-libs udev xfs"
40 -
41 -# The plugin lists have to follow here since they extend IUSE
42 -
43 -# Plugins that don't build (e.g. dependencies not in Gentoo)
44 -# apple_sensors: Requires libIOKit
45 -# aquaero: Requires aerotools-ng/libaquaero5
46 -# barometer: Requires libi2c (i2c_smbus_read_i2c_block_data)
47 -# grpc: Requires libgrpc
48 -# lpar: Requires libperfstat (AIX only)
49 -# mic: Requires Intel Many Integrated Core Architecture API
50 -# (part of Intel's Xeon Phi software)
51 -# netapp: Requires libnetapp (http://communities.netapp.com/docs/DOC-1110)
52 -# pf: Requires BSD packet filter
53 -# pinba: Requires MySQL Pinba engine (http://pinba.org/)
54 -# tape: Requires libkstat (Solaris only)
55 -# write_mongodb: https://github.com/collectd/collectd/issues/492
56 -# write_riemann: Requires riemann-c-client
57 -# xmms: Requires libxmms (v1)
58 -# zone: Solaris only...
59 -COLLECTD_IMPOSSIBLE_PLUGINS="apple_sensors aquaero barometer grpc lpar mic
60 - netapp pf pinba tape write_kafka write_mongodb write_riemann xmms
61 - zone"
62 -
63 -# Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS
64 -COLLECTD_TESTED_PLUGINS="aggregation amqp apache apcups ascent battery bind
65 - ceph cgroups chrony conntrack contextswitch cpu cpufreq cpusleep
66 - csv curl curl_json curl_xml dbi df disk dns drbd email entropy
67 - ethstat exec fhcount filecount fscache gmond gps hddtemp interface
68 - ipc ipmi iptables ipvs irq java lua load logfile log_logstash lvm
69 - madwifi match_empty_counter match_hashed match_regex match_timediff
70 - match_value mbmon md memcachec memcached memory modbus mqtt
71 - multimeter mysql netlink network network nfs nginx notify_desktop
72 - notify_email notify_nagios ntpd numa nut olsrd onewire openldap
73 - openvpn oracle perl ping postgresql powerdns processes protocols
74 - python python redis routeros rrdcached rrdtool sensors serial
75 - sigrok smart snmp statsd swap syslog table tail tail_csv
76 - target_notification target_replace target_scale target_set tcpconns
77 - teamspeak2 ted thermal threshold tokyotyrant turbostat unixsock
78 - uptime users uuid varnish virt vmem vserver wireless write_graphite
79 - write_http write_kafka write_log write_redis write_sensu write_tsdb
80 - xencpu zfs_arc zookeeper"
81 -
82 -COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS}"
83 -
84 -COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS}
85 -
86 -for plugin in ${COLLECTD_ALL_PLUGINS}; do
87 - IUSE="${IUSE} collectd_plugins_${plugin}"
88 -done
89 -unset plugin
90 -
91 -# Now come the dependencies.
92 -
93 -COMMON_DEPEND="
94 - dev-libs/libgcrypt:=
95 - dev-libs/libltdl:0=
96 - perl? ( dev-lang/perl:=[ithreads] )
97 - udev? ( virtual/udev )
98 - xfs? ( sys-fs/xfsprogs )
99 - collectd_plugins_amqp? ( net-libs/rabbitmq-c )
100 - collectd_plugins_apache? ( net-misc/curl:0= )
101 - collectd_plugins_ascent? ( net-misc/curl:0= dev-libs/libxml2:2= )
102 - collectd_plugins_bind? ( net-misc/curl:0= dev-libs/libxml2:2= )
103 - collectd_plugins_ceph? ( dev-libs/yajl:= )
104 - collectd_plugins_curl? ( net-misc/curl:0= )
105 - collectd_plugins_curl_json? ( net-misc/curl:0= dev-libs/yajl:= )
106 - collectd_plugins_curl_xml? ( net-misc/curl:0= dev-libs/libxml2:2= )
107 - collectd_plugins_dbi? ( dev-db/libdbi )
108 - collectd_plugins_dns? ( net-libs/libpcap )
109 - collectd_plugins_gmond? ( sys-cluster/ganglia )
110 - collectd_plugins_gps? ( sci-geosciences/gpsd )
111 - collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 )
112 - collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13:0= )
113 - collectd_plugins_log_logstash? ( dev-libs/yajl:= )
114 - collectd_plugins_lua? ( dev-lang/lua:0= )
115 - collectd_plugins_lvm? ( sys-fs/lvm2 )
116 - collectd_plugins_memcachec? ( dev-libs/libmemcached )
117 - collectd_plugins_modbus? ( dev-libs/libmodbus )
118 - collectd_plugins_mqtt? ( app-misc/mosquitto )
119 - collectd_plugins_mysql? ( >=virtual/mysql-5.0 )
120 - collectd_plugins_netlink? ( net-libs/libmnl )
121 - collectd_plugins_nginx? ( net-misc/curl:0= )
122 - collectd_plugins_notify_desktop? ( x11-libs/libnotify )
123 - collectd_plugins_notify_email? ( net-libs/libesmtp )
124 - collectd_plugins_nut? ( >=sys-power/nut-2.7.2-r2 )
125 - collectd_plugins_openldap? ( net-nds/openldap )
126 - collectd_plugins_onewire? ( >=sys-fs/owfs-3.1:= )
127 - collectd_plugins_oracle? ( dev-db/oracle-instantclient-basic )
128 - collectd_plugins_perl? ( dev-lang/perl:=[ithreads] )
129 - collectd_plugins_ping? ( net-libs/liboping )
130 - collectd_plugins_postgresql? ( dev-db/postgresql:= )
131 - collectd_plugins_python? ( ${PYTHON_DEPS} )
132 - collectd_plugins_redis? ( dev-libs/hiredis:= )
133 - collectd_plugins_routeros? ( net-libs/librouteros )
134 - collectd_plugins_rrdcached? ( net-analyzer/rrdtool:= )
135 - collectd_plugins_rrdtool? ( net-analyzer/rrdtool:= )
136 - collectd_plugins_sensors? ( sys-apps/lm_sensors )
137 - collectd_plugins_sigrok? ( <sci-libs/libsigrok-0.4 dev-libs/glib:2 )
138 - collectd_plugins_smart? ( dev-libs/libatasmart )
139 - collectd_plugins_snmp? ( net-analyzer/net-snmp )
140 - collectd_plugins_tokyotyrant? ( net-misc/tokyotyrant )
141 - collectd_plugins_varnish? ( www-servers/varnish )
142 - collectd_plugins_virt? ( app-emulation/libvirt:= dev-libs/libxml2:2= )
143 - collectd_plugins_write_http? ( net-misc/curl:0= dev-libs/yajl:= )
144 - collectd_plugins_write_kafka? ( >=dev-libs/librdkafka-0.9.0.99:= dev-libs/yajl:= )
145 - collectd_plugins_write_redis? ( dev-libs/hiredis:= )
146 - collectd_plugins_xencpu? ( app-emulation/xen-tools:= )
147 -
148 - kernel_FreeBSD? (
149 - collectd_plugins_disk? ( sys-libs/libstatgrab:= )
150 - collectd_plugins_interface? ( sys-libs/libstatgrab:= )
151 - collectd_plugins_load? ( sys-libs/libstatgrab:= )
152 - collectd_plugins_memory? ( sys-libs/libstatgrab:= )
153 - collectd_plugins_swap? ( sys-libs/libstatgrab:= )
154 - collectd_plugins_users? ( sys-libs/libstatgrab:= )
155 - )"
156 -
157 -# Enforcing <=sys-kernel/linux-headers-4.4 due to #577846
158 -DEPEND="${COMMON_DEPEND}
159 - collectd_plugins_iptables? ( <=sys-kernel/linux-headers-4.4 )
160 - collectd_plugins_java? ( >=virtual/jdk-1.6 )
161 - virtual/pkgconfig"
162 -
163 -RDEPEND="${COMMON_DEPEND}
164 - collectd_plugins_java? ( >=virtual/jre-1.6 )
165 - collectd_plugins_syslog? ( virtual/logger )
166 - selinux? ( sec-policy/selinux-collectd )
167 - !<sys-apps/openrc-0.18.2"
168 -
169 -REQUIRED_USE="
170 - collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} )
171 - collectd_plugins_smart? ( udev )"
172 -
173 -PATCHES=(
174 - "${FILESDIR}"/${PN}-5.6.0-gentoo.patch
175 - "${FILESDIR}"/${PN}-5.6.2-CVE-2017-7401.patch
176 -)
177 -
178 -# @FUNCTION: collectd_plugin_kernel_linux
179 -# @DESCRIPTION:
180 -# USAGE: <plugin name> <kernel_options> <severity>
181 -# kernel_options is a list of kernel configurations options; the check tests whether at least
182 -# one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message
183 -# is emitted.
184 -collectd_plugin_kernel_linux() {
185 - local multi_opt opt
186 - if has ${1} ${COLLECTD_ALL_PLUGINS}; then
187 - if use collectd_plugins_${1}; then
188 - for opt in ${2}; do
189 - if linux_chkconfig_present ${opt}; then
190 - return 0;
191 - fi
192 - done
193 - multi_opt=${2//\ /\ or\ }
194 - case ${3} in
195 - (info)
196 - elog "The ${1} plugin can use kernel features that are disabled now; enable ${multi_opt} in your kernel"
197 - ;;
198 - (warn)
199 - ewarn "The ${1} plugin uses kernel features that are disabled now; enable ${multi_opt} in your kernel"
200 - ;;
201 - (error)
202 - eerror "The ${1} plugin needs kernel features that are disabled now; enable ${multi_opt} in your kernel"
203 - ;;
204 - (*)
205 - die "function collectd_plugin_kernel_linux called with invalid third argument"
206 - ;;
207 - esac
208 - fi
209 - fi
210 -}
211 -
212 -collectd_linux_kernel_checks() {
213 - if ! linux_chkconfig_present PROC_FS; then
214 - ewarn "/proc file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable PROC_FS in your kernel"
215 - fi
216 -
217 - if ! linux_chkconfig_present SYSFS; then
218 - ewarn "/sys file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable SYSFS in your kernel"
219 - fi
220 -
221 - # battery.c: /proc/pmu/battery_%i
222 - # battery.c: /proc/acpi/battery
223 - collectd_plugin_kernel_linux battery ACPI_BATTERY warn
224 -
225 - # cgroups.c: /sys/fs/cgroup/
226 - collectd_plugin_kernel_linux cgroups CGROUPS warn
227 -
228 - # cpufreq.c: /sys/devices/system/cpu/cpu%d/cpufreq/
229 - collectd_plugin_kernel_linux cpufreq SYSFS warn
230 - collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn
231 -
232 - # drbd.c: /proc/drbd
233 - collectd_plugin_kernel_linux drbd BLK_DEV_DRBD warn
234 -
235 - # conntrack.c: /proc/sys/net/netfilter/*
236 - collectd_plugin_kernel_linux conntrack NETFILTER warn
237 -
238 - # fscache.c: /proc/fs/fscache/stats
239 - collectd_plugin_kernel_linux fscache FSCACHE warn
240 -
241 - # nfs.c: /proc/net/rpc/nfs
242 - # nfs.c: /proc/net/rpc/nfsd
243 - collectd_plugin_kernel_linux nfs NFS_COMMON warn
244 -
245 - # serial.c: /proc/tty/driver/serial
246 - # serial.c: /proc/tty/driver/ttyS
247 - collectd_plugin_kernel_linux serial SERIAL_CORE warn
248 -
249 - # swap.c: /proc/meminfo
250 - collectd_plugin_kernel_linux swap SWAP warn
251 -
252 - # thermal.c: /proc/acpi/thermal_zone
253 - # thermal.c: /sys/class/thermal
254 - collectd_plugin_kernel_linux thermal ACPI_THERMAL warn
255 -
256 - # turbostat.c: /dev/cpu/%d/msr
257 - collectd_plugin_kernel_linux turbostat X86_MSR warn
258 -
259 - # vmem.c: /proc/vmstat
260 - collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn
261 -
262 - # vserver.c: /proc/virtual
263 - collectd_plugin_kernel_linux vserver VSERVER warn
264 -
265 - # uuid.c: /sys/hypervisor/uuid
266 - collectd_plugin_kernel_linux uuid SYSFS info
267 -
268 - # wireless.c: /proc/net/wireless
269 - collectd_plugin_kernel_linux wireless "WIRELESS MAC80211 IEEE80211" warn
270 -
271 - # zfs_arc.c: /proc/spl/kstat/zfs/arcstats
272 - collectd_plugin_kernel_linux zfs_arc "SPL ZFS" warn
273 -}
274 -
275 -pkg_setup() {
276 - if use kernel_linux; then
277 - linux-info_pkg_setup
278 -
279 - if linux_config_exists; then
280 - einfo "Checking your linux kernel configuration:"
281 - collectd_linux_kernel_checks
282 - else
283 - elog "Cannot find a linux kernel configuration. Continuing anyway."
284 - fi
285 - fi
286 -
287 - if use collectd_plugins_java; then
288 - java-pkg-opt-2_pkg_setup
289 - fi
290 -
291 - use collectd_plugins_python && python-single-r1_pkg_setup
292 -
293 - enewgroup collectd
294 - enewuser collectd -1 -1 /var/lib/collectd collectd
295 -}
296 -
297 -src_prepare() {
298 - default
299 -
300 - # There's some strange prefix handling in the default config file, resulting in
301 - # paths like "/usr/var/..."
302 - sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die
303 -
304 - # fix installdirs for perl, bug 444360
305 - sed -i -e 's/INSTALL_BASE=$(DESTDIR)$(prefix) //' bindings/Makefile.am || die
306 -
307 - # Adjust upstream's systemd unit
308 - # - Get rid of EnvironmentFile directive; These files don't exist on Gentoo!
309 - # - Add User=collectd to run collectd as user "collectd" per default
310 - sed -i \
311 - -e '/^EnvironmentFile=.*/d' \
312 - -e '/^\[Service\]/aUser=collectd' \
313 - contrib/systemd.${PN}.service || die
314 -
315 - if use collectd_plugins_java; then
316 - # Set javac -source and -target flags according to (R)DEPEND.
317 - sed -i -e "s/\$(JAVAC)/\0 $(java-pkg_javac-args)/g" bindings/java/Makefile.am || die
318 - fi
319 -
320 - ebegin "Removing bundled libltdl"
321 - rm -rf libltdl || die
322 - eend 0
323 -
324 - eautoreconf
325 -}
326 -
327 -src_configure() {
328 - # Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here
329 - # should work independent of the operating system.
330 -
331 - local linux_plugins="barometer battery cpu cpufreq disk drbd entropy
332 - ethstat interface iptables ipvs irq ipc load memory md netlink nfs
333 - numa processes serial swap tcpconns thermal turbostat users vmem
334 - wireless zfc_arc"
335 -
336 - local need_libstatgrab=0
337 - local libstatgrab_plugins="cpu disk interface load memory swap users"
338 - local bsd_plugins="cpu tcpconns ${libstatgrab_plugins} zfc_arc"
339 -
340 - local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns"
341 -
342 - local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}"
343 - local myos_plugins=""
344 - if use kernel_linux; then
345 - einfo "Enabling Linux plugins."
346 - myos_plugins=${linux_plugins}
347 - elif use kernel_FreeBSD; then
348 - einfo "Enabling FreeBSD plugins."
349 - myos_plugins=${bsd_plugins}
350 - elif use kernel_Darwin; then
351 - einfo "Enabling Darwin plugins."
352 - myos_plugins=${darwin_plugins}
353 - fi
354 -
355 - local myconf="--disable-werror"
356 -
357 - # Do we debug?
358 - myconf+=" $(use_enable debug)"
359 -
360 - # udev support?
361 - # Required for smart plugin via REQUIRED_USE; Optional for disk plugin
362 - if use udev; then
363 - myconf+=" --with-libudev"
364 - else
365 - myconf+=" --without-libudev"
366 - fi
367 -
368 - local plugin
369 -
370 - # Disable what needs to be disabled.
371 - for plugin in ${COLLECTD_DISABLED_PLUGINS}; do
372 - myconf+=" --disable-${plugin}"
373 - done
374 -
375 - # Set enable/disable for each single plugin.
376 - for plugin in ${COLLECTD_ALL_PLUGINS}; do
377 - if has ${plugin} ${osdependent_plugins}; then
378 - # plugin is os-dependent ...
379 - if has ${plugin} ${myos_plugins}; then
380 - # ... and available in this os
381 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
382 - # ... must we link against libstatgrab? Bug #541518
383 - if use kernel_FreeBSD && has ${plugin} ${libstatgrab_plugins}; then
384 - einfo "We must link against libstatgrab due to plugin \"${plugin}\" ..."
385 - need_libstatgrab=1
386 - fi
387 - else
388 - # ... and NOT available in this os
389 - if use collectd_plugins_${plugin}; then
390 - ewarn "You try to enable the ${plugin} plugin, but it is not available for this"
391 - ewarn "kernel. Disabling it automatically."
392 - fi
393 - myconf+=" --disable-${plugin}"
394 - fi
395 - elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
396 - if use collectd_plugins_perl && ! use perl; then
397 - ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
398 - myconf+= --disable-perl
399 - else
400 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
401 - fi
402 - else
403 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
404 - fi
405 - done
406 -
407 - if [ "${need_libstatgrab}" -eq 1 ]; then
408 - myconf+=" --with-libstatgrab"
409 - else
410 - myconf+=" --without-libstatgrab"
411 - fi
412 -
413 - # JAVA_HOME is set by eclasses.
414 - if use collectd_plugins_java; then
415 - myconf+=" --with-java"
416 - fi
417 -
418 - # Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens.
419 - # lots of libs are only needed for plugins, if they are disabled, also disable the lib
420 - use collectd_plugins_iptables || myconf+=" --with-libiptc=no"
421 - use collectd_plugins_openldap || myconf+=" --with-libldap=no"
422 - use collectd_plugins_redis || use collectd_plugins_write_redis || myconf+=" --with-libhiredis=no"
423 - use collectd_plugins_smart || myconf+=" --with-libatasmart=no"
424 - use collectd_plugins_gps || myconf+=" --with-libgps=no"
425 -
426 - if use perl; then
427 - myconf+=" --with-perl-bindings=INSTALLDIRS=vendor"
428 - else
429 - myconf+=" --without-perl-bindings"
430 - fi
431 -
432 - # No need for v5upgrade
433 - myconf+=" --disable-target_v5upgrade"
434 -
435 - # Python
436 - if use collectd_plugins_python; then
437 - myconf+=" --with-libpython=yes"
438 - export PYTHON_CONFIG=$(python_get_PYTHON_CONFIG)
439 - else
440 - myconf+=" --with-libpython=no"
441 - fi
442 -
443 - # XFS support
444 - myconf+=" $(use_enable xfs)"
445 -
446 - # Finally, run econf.
447 - KERNEL_DIR="${KERNEL_DIR}" econf --config-cache \
448 - $(use_enable static-libs static) \
449 - --localstatedir=/var ${myconf}
450 -}
451 -
452 -src_install() {
453 - emake DESTDIR="${D%/}" install
454 -
455 - perl_delete_localpod
456 -
457 - find "${ED}"usr/ -name "*.la" -delete || die
458 -
459 - if use collectd_plugins_java; then
460 - java-pkg_regjar "${ED}"usr/share/${PN}/java/*.jar
461 - fi
462 -
463 - fowners root:collectd /etc/collectd.conf
464 - fperms u=rw,g=r,o= /etc/collectd.conf
465 -
466 - dodoc AUTHORS ChangeLog NEWS README TODO
467 -
468 - if use contrib ; then
469 - insinto /usr/share/doc/${PF}
470 - doins -r contrib
471 - fi
472 -
473 - keepdir /var/lib/${PN}
474 - fowners collectd:collectd /var/lib/${PN}
475 -
476 - newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
477 - newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
478 - systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service
479 -
480 - insinto /etc/logrotate.d
481 - newins "${FILESDIR}/${PN}.logrotate" ${PN}
482 -
483 - sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":PIDFile "/run/collectd/collectd.pid":' "${ED}"etc/collectd.conf || die
484 - sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/run/collectd/collectd.socket":' "${ED}"etc/collectd.conf || die
485 - sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die
486 - sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die
487 -}
488 -
489 -pkg_postinst() {
490 - if use filecaps; then
491 - local caps=()
492 - use collectd_plugins_ceph && caps+=('CAP_DAC_OVERRIDE')
493 - use collectd_plugins_exec && caps+=('CAP_SETUID' 'CAP_SETGID')
494 - use collectd_plugins_iptables && caps+=('CAP_NET_ADMIN')
495 - use collectd_plugins_filecount && caps+=('CAP_DAC_READ_SEARCH')
496 -
497 - if use collectd_plugins_dns || use collectd_plugins_ping; then
498 - caps+=('CAP_NET_RAW')
499 - fi
500 -
501 - if use collectd_plugins_turbostat || use collectd_plugins_smart; then
502 - caps+=('CAP_SYS_RAWIO')
503 - fi
504 -
505 - if [ ${#caps[@]} -gt 0 ]; then
506 - local caps_str=$(IFS=","; echo "${caps[*]}")
507 - fcaps ${caps_str} usr/sbin/collectd
508 - elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
509 - elog " ${caps_str}+EP"
510 - elog
511 -
512 - local systemd_unit="${EROOT}usr/lib/systemd/system/collectd.service"
513 - if [[ -e "${systemd_unit}" ]]; then
514 - caps_str="${caps[*]}"
515 - sed -i -e "s:^CapabilityBoundingSet=.*:CapabilityBoundingSet=${caps_str}:" "${systemd_unit}" || \
516 - die "Failed to set CapabilityBoundingSet in '${systemd_unit}'"
517 -
518 - elog "CapabilityBoundingSet in '${systemd_unit}'"
519 - elog "updated to match capabilities set above."
520 - elog
521 - fi
522 - fi
523 - fi
524 -
525 - elog "Note: Collectd is only the collector."
526 - elog " You need to install 'data' sources (applications) locally or"
527 - elog " remotely on your own."
528 -
529 - elog
530 - elog "Collectd is configured to run as unprivileged user by default."
531 - elog "You may want to revisit the configuration."
532 - elog
533 -
534 - if use collectd_plugins_email; then
535 - ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin."
536 - fi
537 -
538 - if use collectd_plugins_smart; then
539 - elog ""
540 - elog "If you are using smart plugin and don't run collectd as root make sure"
541 - elog "that the collectd user is allowed to access the disk you want to monitor"
542 - elog "(can be done via udev rule for example) and that collectd has the required"
543 - elog "capabilities set (which is the default when package was emerged with"
544 - elog "'filecaps' USE flag set)."
545 - fi
546 -
547 - if use contrib; then
548 - elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser,"
549 - elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed."
550 - fi
551 -}