mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Tuning services life cycle
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
parent
e3bd1c4d23
commit
fd47e10e52
3 changed files with 7 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ source $SNAP/bin/wekan-read-settings
|
||||||
if [ "$CADDY_ENABLED" = "true" ]; then
|
if [ "$CADDY_ENABLED" = "true" ]; then
|
||||||
env LC_ALL=C caddy -conf=$SNAP_COMMON/Caddyfile -host=localhost:${CADDY_PORT}
|
env LC_ALL=C caddy -conf=$SNAP_COMMON/Caddyfile -host=localhost:${CADDY_PORT}
|
||||||
else
|
else
|
||||||
snapctl stop caddy-service 2>&1 || true
|
echo "caddy is disabled. Stop service"
|
||||||
|
snapctl stop --disable ${SNAP_NAME}.caddy
|
||||||
# sleep here, in case snapctl fails to stop service so we do not restart too often
|
# sleep here, in case snapctl fails to stop service so we do not restart too often
|
||||||
sleep 60
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
source $SNAP/bin/wekan-read-settings
|
source $SNAP/bin/wekan-read-settings
|
||||||
|
|
||||||
if [ "true" == "${DISABLE_MONGODB}" ]; then
|
if [ "true" == "${DISABLE_MONGODB}" ]; then
|
||||||
echo "mongodb is disabled. Not starting it"
|
echo "mongodb is disabled. Stop service"
|
||||||
|
snapctl stop --disable ${SNAP_NAME}.mongodb
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
4
snap/hooks/configure
vendored
4
snap/hooks/configure
vendored
|
|
@ -17,6 +17,7 @@ if [ "$value" = "true" ]; then
|
||||||
port=$(snapctl get port)
|
port=$(snapctl get port)
|
||||||
[ "x" != "x${bind_port}" ] && sed -i 's|proxy / localhost:.* {|proxy / localhost:'"${bind_port}"' {|g' $SNAP_COMMON/Caddyfile
|
[ "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
|
[ "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 start --enable ${SNAP_NAME}.caddy 2>&1 || true
|
||||||
else
|
else
|
||||||
snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true
|
snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true
|
||||||
|
|
@ -26,8 +27,9 @@ value=$(snapctl get disable-mongodb)
|
||||||
if [ "$value" = "true" ]; then
|
if [ "$value" = "true" ]; then
|
||||||
snapctl stop --disable ${SNAP_NAME}.mongodb 2>&1 || true
|
snapctl stop --disable ${SNAP_NAME}.mongodb 2>&1 || true
|
||||||
else
|
else
|
||||||
|
snapctl stop ${SNAP_NAME}.mongodb 2>&1 || true
|
||||||
snapctl start --enable ${SNAP_NAME}.mongodb 2>&1 || true
|
snapctl start --enable ${SNAP_NAME}.mongodb 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# restart all services
|
# restart all services
|
||||||
snapctl restart ${SNAP_NAME} 2>&1 || true
|
snapctl restart ${SNAP_NAME}.wekan 2>&1 || true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue