summaryrefslogtreecommitdiff
path: root/config-parabola-base-collectd.PKGBUILD
blob: 344830d34d6f457c7db344a5ccc1539cd9aede4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
. ${BUILDFILE%/*}/common.sh
pkgver=20180918

package() {
preamble
pkgdesc="Parabola server configuration: Make collectd play nice with configuration management"

# #### collectd

depends=(collectd)

# In order for configuration sets to modularly adjust the collectd
# configuration, we patch `/etc/collectd.conf` to include
# `/etc/collectd.d/*.conf`.  Also, we uncomment the default value of
# the TypesDB command, to make it safe for *.conf files to augement
# the types DB with their own TypesDB commands.
add-file -m755 usr/share/holo/files/10-"$pkgname"/etc/collectd.conf.holoscript <<'EOF'
#!/bin/sh
{
	sed -r 's/^#+\s*TypesDB/TypesDB/'
	echo
	echo 'Include "/etc/collectd.d/*.conf"'
} | awk '/^$/{ s=1 } /./&&!x[$0]++{ if(s){print ""} print; s=0 }'
EOF

postamble
}