From 1be8e5625fd20797910009a8221ca706fd52ab11 Mon Sep 17 00:00:00 2001 From: Ondrej Kubik Date: Thu, 1 Mar 2018 11:53:40 +0000 Subject: Fixing problem when mongodb was not started at install/refresh Signed-off-by: Ondrej Kubik --- snap/hooks/configure | 6 +++--- snap/hooks/install | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'snap') diff --git a/snap/hooks/configure b/snap/hooks/configure index 5dcea5b9..f2f4cda1 100755 --- a/snap/hooks/configure +++ b/snap/hooks/configure @@ -1,6 +1,6 @@ #!/bin/bash -exec >> $SNAP_COMMON/hook.log 2>&1 +exec >> $SNAP_DATA/hook.log 2>&1 echo "$(date '+%Y-%m-%d %H:%M:%S') $0: Entering hook" set -x @@ -17,8 +17,8 @@ if [ "$value" = "true" ]; then port=$(snapctl get port) [ "x" != "x${bind_port}" ] && sed -i 's|proxy / localhost:.* {|proxy / localhost:'"${bind_port}"' {|g' $SNAP_COMMON/Caddyfile [ "x" != "x$port" ] && sed -i 's|http://:.*|http://:'"${port}"'|g' $SNAP_COMMON/Caddyfile - snapctl stop ${SNAP_NAME}.caddy 2>&1 || true snapctl start --enable ${SNAP_NAME}.caddy 2>&1 || true + snapctl restart ${SNAP_NAME}.caddy 2>&1 || true else snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true fi @@ -27,8 +27,8 @@ value=$(snapctl get disable-mongodb) if [ "$value" = "true" ]; then snapctl stop --disable ${SNAP_NAME}.mongodb 2>&1 || true else - snapctl stop ${SNAP_NAME}.mongodb 2>&1 || true snapctl start --enable ${SNAP_NAME}.mongodb 2>&1 || true + snapctl restart ${SNAP_NAME}.mongodb 2>&1 || true fi # restart all services diff --git a/snap/hooks/install b/snap/hooks/install index 14087eaa..7bc908eb 100755 --- a/snap/hooks/install +++ b/snap/hooks/install @@ -1,6 +1,6 @@ #!/bin/bash -exec >> $SNAP_COMMON/hook.log 2>&1 +exec >> $SNAP_DATA/hook.log 2>&1 echo "$(date '+%Y-%m-%d %H:%M:%S') $0: Entering hook" # coppy caddy file in place -- cgit v1.2.3-1-g7c22