Przeglądaj źródła

20171107 (EXPORT_DIR und DASHBOARD_DIR anlegen, wenn noch nicht vorhanden)

Altlast 7 lat temu
rodzic
commit
1bc09618e6

+ 4 - 1
Makefile.in

@@ -55,11 +55,14 @@ dist/Makefile: dist/Makefile.in
 dist/nodes2grafana.txz:
 	cd dist && rm -f $@ && ${MAKE}
 
-install: install-bin install-crontab install-dashboard
+install: install-bin %%EXPORT_DIR%% install-crontab install-dashboard
 
 install-bin: src/nodes2prom src/json-pp etc/nodes2prometheus.sh %%HEAP_FILES%%
 	%%INSTALL_BIN_CMD%% $> %%BIN_DIR%%
 
+%%EXPORT_DIR%%:
+	%%EXPORT_DIR_CMD%% $@
+
 install-crontab:
 	[ ! -r %%ETC_DIR%%/crontab ] || { \
 	cp -p %%ETC_DIR%%/crontab /tmp/crontab.old && \

+ 2 - 0
conf/substitutions.conf.FreeBSD

@@ -1,5 +1,6 @@
 FETCH_CMD		fetch -q -T 30 --no-verify-peer -o
 EXPORT_DIR		/var/tmp/node_exporter
+EXPORT_DIR_CMD		install -d -o nobody -g nobody -m 1755
 RUN_SML			/usr/local/smlnj/bin/.run-sml
 HEAP_SUFFIX		x86-bsd
 HEAP_FILES
@@ -8,6 +9,7 @@ BIN_DIR			/usr/local/bin
 # keep this:
 ETC_DIR			/etc
 DASHBOARD_DIR		/var/db/grafana/dashboards
+DASHBOARD_DIR_CMD	install -d -o grafana -g grafana -m 755
 INSTALL_BIN_CMD		install -o 0 -g 0 -p -S -v
 INSTALL_DATA_CMD	install -o 0 -g 0 -p -S -v -m 644
 # keep this:

+ 6 - 2
conf/substitutions.conf.Linux

@@ -1,5 +1,7 @@
 FETCH_CMD		wget -q -O
 EXPORT_DIR		/var/tmp/node_exporter
+EXPORT_DIR_CMD		install -d -o nobody -g nogroup -m 1755
+#EXPORT_DIR_CMD		mkdir -p
 RUN_SML			/usr/lib/smlnj/bin/.run-sml
 HEAP_SUFFIX		x86-linux
 HEAP_FILES		src/nodes2prom.x86-linux src/json-pp.x86-linux
@@ -7,8 +9,10 @@ HEAP_TAR_EXCLUDE
 BIN_DIR			/usr/local/bin
 # keep this:
 ETC_DIR			/etc
-DASHBOARD_DIR		/var/db/grafana/dashboards
-INSTALL_BIN_CMD	install -o 0 -g 0 -p -v
+DASHBOARD_DIR		/var/lib/grafana/dashboards
+DASHBOARD_DIR_CMD	install -d -o grafana -g grafana -m 755
+#DASHBOARD_DIR_CMD	mkdir -p
+INSTALL_BIN_CMD		install -o 0 -g 0 -p -v
 #INSTALL_BIN_CMD	cp -a
 INSTALL_DATA_CMD	install -o 0 -g 0 -p -v -m 644
 #INSTALL_DATA_CMD	cp -a

+ 4 - 1
dashboard/Makefile.in

@@ -17,7 +17,10 @@ dashboard: %%DASHBOARD_PREFIX%%status.json %%DASHBOARD_PREFIX%%status-render.jso
 %%DASHBOARD_PREFIX%%status-group-render.json: status-group-render.json.in
 	../conf/substitute.sh $> $@
 
-install: %%EXPORT_DIR%%/%%PROM_GROUPS_PREFIX%%.prom %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-render.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group-render.json
+install: %%EXPORT_DIR%%/%%PROM_GROUPS_PREFIX%%.prom %%DASHBOARD_DIR%% %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-render.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group-render.json
+
+%%DASHBOARD_DIR%%:
+	%%DASHBOARD_DIR_CMD%% $@
 
 %%EXPORT_DIR%%/%%PROM_GROUPS_PREFIX%%.prom: %%PROM_GROUPS_PREFIX%%.prom
 	%%INSTALL_DATA_CMD%% $> $@