From 1d2eb0f903df0c9225f5a5233fa822b1af8e425b Mon Sep 17 00:00:00 2001 From: Ben Oswald Date: Sun, 5 Jun 2016 16:19:53 +0200 Subject: [PATCH 1/2] restart grafana after upgrade The current script only tries to start the already running grafana process after an upgrade. This leads to errors due to changed js and css hashes while grafana is delivering the old ones. To load the new sources we need to restart grafana after an upgrade. --- packaging/deb/control/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index b93c8433490..37c0eb54138 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -10,9 +10,9 @@ startGrafana() { /bin/systemctl start grafana-server elif [ -x "/etc/init.d/grafana-server" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d grafana-server start || true + invoke-rc.d grafana-server restart || true else - /etc/init.d/grafana-server start || true + /etc/init.d/grafana-server restart || true fi fi } From 51878aeca880352608a5addd115e8ccbbd49d223 Mon Sep 17 00:00:00 2001 From: Ben Oswald Date: Sun, 5 Jun 2016 16:27:57 +0200 Subject: [PATCH 2/2] change start to restart also for systemctl I've forgotten to update the systemctl start to restart in my first commit --- packaging/deb/control/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index 37c0eb54138..425a7319e62 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -7,7 +7,7 @@ set -e startGrafana() { if [ -x /bin/systemctl ]; then /bin/systemctl daemon-reload - /bin/systemctl start grafana-server + /bin/systemctl restart grafana-server elif [ -x "/etc/init.d/grafana-server" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d grafana-server restart || true