Przeglądaj źródła

Fixing snapctl start/stop to control service lifecycle
Adding disable and enable options for snapctl start/stop

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

Ondrej Kubik 7 lat temu
rodzic
commit
9c9694bcd1
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      snap/hooks/configure

+ 4 - 5
snap/hooks/configure

@@ -15,11 +15,10 @@ 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 start caddy-service 2>&1 || true
+    snapctl start --enable ${SNAP_NAME}.caddy 2>&1 || true
 else
-    snapctl stop caddy-service 2>&1 || true
+    snapctl stop --disable ${SNAP_NAME}.caddy 2>&1 || true
 fi
 
-# restart mongo and wekan service
-snapctl restart mongodb 2>&1 || true
-snapctl restart wekan 2>&1 || true
+# restart all services
+snapctl restart ${SNAP_NAME} 2>&1 || true