Skip to content

Commit 1be8e56

Browse files
committed
Fixing problem when mongodb was not started at install/refresh
Signed-off-by: Ondrej Kubik <[email protected]>
1 parent 9084158 commit 1be8e56

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

snap/hooks/configure

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
exec >> $SNAP_COMMON/hook.log 2>&1
3+
exec >> $SNAP_DATA/hook.log 2>&1
44
echo "$(date '+%Y-%m-%d %H:%M:%S') $0: Entering hook"
55

66
set -x
@@ -17,8 +17,8 @@ if [ "$value" = "true" ]; then
1717
port=$(snapctl get port)
1818
[ "x" != "x${bind_port}" ] && sed -i 's|proxy / localhost:.* {|proxy / localhost:'"${bind_port}"' {|g' $SNAP_COMMON/Caddyfile
1919
[ "x" != "x$port" ] && sed -i 's|http://:.*|http://:'"${port}"'|g' $SNAP_COMMON/Caddyfile
20-
snapctl stop ${SNAP_NAME}.caddy 2>&1 || true
2120
snapctl start --enable ${SNAP_NAME}.caddy 2>&1 || true
21+
snapctl restart ${SNAP_NAME}.caddy 2>&1 || true
2222
else
2323
snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true
2424
fi
@@ -27,8 +27,8 @@ value=$(snapctl get disable-mongodb)
2727
if [ "$value" = "true" ]; then
2828
snapctl stop --disable ${SNAP_NAME}.mongodb 2>&1 || true
2929
else
30-
snapctl stop ${SNAP_NAME}.mongodb 2>&1 || true
3130
snapctl start --enable ${SNAP_NAME}.mongodb 2>&1 || true
31+
snapctl restart ${SNAP_NAME}.mongodb 2>&1 || true
3232
fi
3333

3434
# restart all services

snap/hooks/install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
exec >> $SNAP_COMMON/hook.log 2>&1
3+
exec >> $SNAP_DATA/hook.log 2>&1
44
echo "$(date '+%Y-%m-%d %H:%M:%S') $0: Entering hook"
55

66
# coppy caddy file in place

0 commit comments

Comments
 (0)