Fixes enable/start of netdata service in debian package (#9005)
Also cleanup unused templating in postint Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
Arthur Outhenin-Chalandre committed
May 22, 2020 at 12:54 UTC
8366f6b0bbab1da7a0f3dcb0e9162ad01818b5d5
4 files changed
+7
-19
contrib/debian/netdata.postinst
renamed
+2
@@ -67,4 +67,6 @@ case "$1" in
67
;;
68
esac
69
70
+#DEBHELPER#
71
+
72
exit 0
contrib/debian/netdata.postrm
+2
@@ -48,4 +48,6 @@ case "$1" in
48
49
esac
50
51
+#DEBHELPER#
52
+
53
exit 0
contrib/debian/netdata.preinst
+2
@@ -14,3 +14,5 @@ dpkg-maintscript-helper dir_to_symlink \
14
/var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@"
15
dpkg-maintscript-helper dir_to_symlink \
16
/var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@"
17
+
18
+#DEBHELPER#
contrib/debian/rules
+1
-19
@@ -2,7 +2,6 @@
2
3
# Find the arch we are building for, as this determines
4
# the location of plugins in /usr/lib
5
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
5
TOP = $(CURDIR)/debian/netdata
6
TEMPTOP = $(CURDIR)/debian/tmp
7
@@ -41,10 +40,7 @@ override_dh_auto_configure:
40
dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \
41
--libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www
42
44
-debian/%.postinst: debian/%.postinst.in
45
- sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
46
-
47
-override_dh_install: debian/netdata.postinst
43
+override_dh_install:
44
cp -v $(BASE_CONFIG) debian/netdata.conf
45
46
dh_install
@@ -80,19 +76,6 @@ override_dh_install: debian/netdata.postinst
76
ln -s "/usr/share/netdata/www/$$D" "$(TOP)/var/lib/netdata/www/$$D"; \
77
done
78
83
- # Update postinst to set correct group for www files on installation.
84
- # Should probably be dpkg-statoverride really, but that gets *really*
85
- # messy. We also set all web files in /var as conffiles so an upgrade
86
- # doesn't splat them.
87
- #
88
- for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type f -printf '%f '); do \
89
- echo Updating postinst for $$D; \
90
- sed -i "s/^#PERMS#/chgrp netdata \/var\/lib\/netdata\/www\/$$D\n#PERMS#/g" \
91
- $(CURDIR)/debian/netdata.postinst; \
92
- echo "/var/lib/netdata/www/$$D" >> $(CURDIR)/debian/netdata.conffiles; \
93
- done
94
- sed -i "/^#PERMS#/d" $(CURDIR)/debian/netdata.postinst
95
-
79
# Install go
80
#
81
debian/install_go.sh $$(cat ${CURDIR}/packaging/go.d.version) $(TOP)/usr/lib/netdata $(TOP)/usr/libexec/netdata
@@ -137,5 +120,4 @@ override_dh_clean:
120
# Tidy up copied/generated files
121
#
122
-[ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate
140
- -[ -r $(CURDIR)/debian/netdata.postinst ] && rm $(CURDIR)/debian/netdata.postinst
123
-[ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles