From 9c18aa8684d3c3f1149a234617a7f1abcceed9cb Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Thu, 7 Feb 2019 16:10:39 +0100 Subject: [PATCH] make sure to create provisioning/notifiers directory for deb and rpm packages --- packaging/deb/control/postinst | 8 ++++++-- packaging/rpm/control/postinst | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index 351c966a8e6..049061ac2dd 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -32,10 +32,14 @@ case "$1" in fi if [ ! -f $PROVISIONING_CFG_DIR ]; then - mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources + mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources $PROVISIONING_CFG_DIR/notifiers cp /usr/share/grafana/conf/provisioning/dashboards/sample.yaml $PROVISIONING_CFG_DIR/dashboards/sample.yaml cp /usr/share/grafana/conf/provisioning/datasources/sample.yaml $PROVISIONING_CFG_DIR/datasources/sample.yaml - fi + cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml + elif [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + mkdir -p $PROVISIONING_CFG_DIR/notifiers + cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml + fi # configuration files should not be modifiable by grafana user, as this can be a security issue chown -Rh root:$GRAFANA_GROUP /etc/grafana/* diff --git a/packaging/rpm/control/postinst b/packaging/rpm/control/postinst index e75850f258e..0187fc82cc5 100755 --- a/packaging/rpm/control/postinst +++ b/packaging/rpm/control/postinst @@ -46,10 +46,14 @@ if [ $1 -eq 1 ] ; then fi if [ ! -f $PROVISIONING_CFG_DIR ]; then - mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources + mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources $PROVISIONING_CFG_DIR/notifiers cp /usr/share/grafana/conf/provisioning/dashboards/sample.yaml $PROVISIONING_CFG_DIR/dashboards/sample.yaml cp /usr/share/grafana/conf/provisioning/datasources/sample.yaml $PROVISIONING_CFG_DIR/datasources/sample.yaml - fi + cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml + elif [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + mkdir -p $PROVISIONING_CFG_DIR/notifiers + cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml + fi # Set user permissions on /var/log/grafana, /var/lib/grafana mkdir -p /var/log/grafana /var/lib/grafana