diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2024-02-06 09:29:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 09:29:57 -0500 |
commit | 9dec08180ce639ec3f8ef1ddeefbfa03509002b3 (patch) | |
tree | 10adbe5a7af71b1bd4d8a5a641ccdf6d8f567b31 /contrib | |
parent | ae07ffe7b7db16649ea580ca48584bdd616207d1 (diff) |
Assorted cleanup of native packaging code. (#16640)
* Assorted cleanup of DEB packaging code.
* Assorted cleanup of the RPM spec file.
* DEB package fixes.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/debian/netdata-plugin-ebpf.postinst | 2 | ||||
-rw-r--r-- | contrib/debian/netdata-plugin-logs-management.postinst | 2 | ||||
-rw-r--r-- | contrib/debian/netdata.lintian-overrides | 16 | ||||
-rw-r--r-- | contrib/debian/netdata.postinst | 31 | ||||
-rw-r--r-- | contrib/debian/netdata.postrm | 17 | ||||
-rw-r--r-- | contrib/debian/netdata.preinst | 13 | ||||
-rwxr-xr-x | contrib/debian/rules | 10 |
7 files changed, 13 insertions, 78 deletions
diff --git a/contrib/debian/netdata-plugin-ebpf.postinst b/contrib/debian/netdata-plugin-ebpf.postinst index 2458d6d6cf..3076d40481 100644 --- a/contrib/debian/netdata-plugin-ebpf.postinst +++ b/contrib/debian/netdata-plugin-ebpf.postinst @@ -4,7 +4,7 @@ set -e case "$1" in configure|reconfigure) - chown root:netdata /usr/libexec/netdata/plugins.d/ebpf.plugin + grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-ebpf.list | xargs -n 30 chown root:netdata chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin ;; esac diff --git a/contrib/debian/netdata-plugin-logs-management.postinst b/contrib/debian/netdata-plugin-logs-management.postinst index 0565b54e86..d589310c64 100644 --- a/contrib/debian/netdata-plugin-logs-management.postinst +++ b/contrib/debian/netdata-plugin-logs-management.postinst @@ -4,7 +4,7 @@ set -e case "$1" in configure|reconfigure) - chown root:netdata /usr/libexec/netdata/plugins.d/logs-management.plugin + grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-logs-management.list | xargs -n 30 chown root:netdata chmod 0750 /usr/libexec/netdata/plugins.d/logs-management.plugin if ! setcap "cap_dac_read_search=eip cap_syslog=eip" /usr/libexec/netdata/plugins.d/logs-management.plugin; then chmod -f 4750 /usr/libexec/netdata/plugins.d/logs-management.plugin diff --git a/contrib/debian/netdata.lintian-overrides b/contrib/debian/netdata.lintian-overrides deleted file mode 100644 index 45b2d868f5..0000000000 --- a/contrib/debian/netdata.lintian-overrides +++ /dev/null @@ -1,16 +0,0 @@ - -# See Debian policy 10.9. apps.plugin has extra capabilities, so don't let -# normal users run it. -netdata: non-standard-executable-perm usr/lib/*/netdata/plugins.d/apps.plugin 0754 != 0755 - - -# FontAwesome is at least in the fonts-font-awesome package, but this is -# not available in wheezy. glyphicons-halflings-regular isn't currently in -# a Debian package. Therefore don't complain about shipping them with netdata -# for the time being. -netdata: duplicate-font-file usr/share/netdata/fonts/* -netdata: font-in-non-font-package usr/share/netdata/fonts/* - -# Files here are marked as conffiles so that local updates to the html files -# isn't clobbered on upgrade. -netdata: non-etc-file-marked-as-conffile var/lib/netdata/www/* diff --git a/contrib/debian/netdata.postinst b/contrib/debian/netdata.postinst index 2913c33543..1ef69917d5 100644 --- a/contrib/debian/netdata.postinst +++ b/contrib/debian/netdata.postinst @@ -2,29 +2,12 @@ set -e -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@" - case "$1" in configure|reconfigure) if ! dpkg-statoverride --list /var/lib/netdata > /dev/null 2>&1; then dpkg-statoverride --update --add netdata netdata 0755 /var/lib/netdata fi - if ! dpkg-statoverride --list /var/lib/netdata/www > /dev/null 2>&1; then - dpkg-statoverride --update --add root netdata 0755 /var/lib/netdata/www - fi - if ! dpkg-statoverride --list /var/cache/netdata > /dev/null 2>&1; then dpkg-statoverride --update --add netdata netdata 0755 /var/cache/netdata fi @@ -37,17 +20,17 @@ case "$1" in dpkg-statoverride --update --add netdata adm 02750 /var/log/netdata fi + if ! dpkg-statoverride --list /usr/share/netdata/www > /dev/null 2>&1; then + dpkg-statoverride --update --add root netdata 0755 /usr/share/netdata/www + fi + dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1 grep /usr/libexec/netdata /var/lib/dpkg/info/netdata.list | xargs -n 30 chown root:netdata - chmod 4750 /usr/libexec/netdata/plugins.d/ndsudo - chmod 4750 /usr/libexec/netdata/plugins.d/cgroup-network - chmod 4750 /usr/libexec/netdata/plugins.d/local-listeners - chmod 4750 /usr/libexec/netdata/plugins.d/network-viewer.plugin - - # Workaround for other plugins not installed directly by this package - chmod -f 4750 /usr/libexec/netdata/plugins.d/ioping || true + for f in ndsudo cgroup-network local-listeners ioping network-viewer.plugin; do + chmod 4750 "/usr/libexec/netdata/plugins.d/${f}" || true + done ;; esac diff --git a/contrib/debian/netdata.postrm b/contrib/debian/netdata.postrm index 5644e22a51..3a68dea75c 100644 --- a/contrib/debian/netdata.postrm +++ b/contrib/debian/netdata.postrm @@ -2,19 +2,6 @@ set -e -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@" - case "$1" in remove) ;; @@ -27,6 +14,10 @@ case "$1" in dpkg-statoverride --remove /var/lib/netdata/www fi + if dpkg-statoverride --list | grep -qw /usr/share/netdata/www; then + dpkg-statoverride --remove /usr/share/netdata/www + fi + if dpkg-statoverride --list | grep -qw /var/lib/netdata/registry; then dpkg-statoverride --remove /var/lib/netdata/registry fi diff --git a/contrib/debian/netdata.preinst b/contrib/debian/netdata.preinst index a5dc9107e6..7f55959967 100644 --- a/contrib/debian/netdata.preinst +++ b/contrib/debian/netdata.preinst @@ -2,19 +2,6 @@ set -e -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@" -dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@" - case "$1" in install) if ! getent group netdata > /dev/null; then diff --git a/contrib/debian/rules b/contrib/debian/rules index 41035e38ab..4d56ee371f 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -223,15 +223,6 @@ override_dh_install: # cp -v packaging/installer/netdata-updater.sh $(TOP)/usr/libexec/netdata/netdata-updater.sh - # Move files that local user shouldn't be editing to /usr/share/netdata - # - mkdir -p "$(TOP)/usr/share/netdata/www" - for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type d -printf '%f '); do \ - echo Relocating $$D; \ - mv "$(TOP)/var/lib/netdata/www/$$D" "$(TOP)/usr/share/netdata/www/$$D"; \ - ln -s "/usr/share/netdata/www/$$D" "$(TOP)/var/lib/netdata/www/$$D"; \ - done - # Handle eBPF code # if [ $(HAVE_EBPF) -eq 1 ]; then \ @@ -271,7 +262,6 @@ override_dh_fixperms: # apps.plugin should only be runnable by the netdata user. It will be # given extra capabilities in the postinst script. - # chmod 0750 $(TOP)-plugin-apps/usr/libexec/netdata/plugins.d/apps.plugin # slabinfo package |