diff --git a/agent/agent_method_script.sh b/agent/agent_method_script.sh deleted file mode 100755 index 880bf20ac..000000000 --- a/agent/agent_method_script.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o pipefail -set -o xtrace - -. /lib/svc/share/smf_include.sh - -DATALINK="$(svcprop -c -p config/datalink "${SMF_FMRI}")" -GATEWAY="$(svcprop -c -p config/gateway "${SMF_FMRI}")" -DATASET="$(svcprop -c -p config/dataset "${SMF_FMRI}")" -LISTEN_ADDR="$(svcprop -c -p config/listen_addr "${SMF_FMRI}")" -LISTEN_PORT="$(svcprop -c -p config/listen_port "${SMF_FMRI}")" -PORTBASE="$(svcprop -c -p config/portbase "${SMF_FMRI}")" -DOWNSTAIRS_PREFIX="$(svcprop -c -p config/downstairs_prefix "${SMF_FMRI}")" -SNAPSHOT_PREFIX="$(svcprop -c -p config/snapshot_prefix "${SMF_FMRI}")" - -if [[ $DATALINK == unknown ]] || [[ $GATEWAY == unknown ]]; then - printf 'ERROR: missing datalink or gateway' >&2 - exit "$SMF_EXIT_ERR_CONFIG" -fi - -# TODO remove when https://github.com/oxidecomputer/stlouis/issues/435 is addressed -ipadm delete-if "$DATALINK" || true -ipadm create-if -t "$DATALINK" - -ipadm set-ifprop -t -p mtu=9000 -m ipv4 "$DATALINK" -ipadm set-ifprop -t -p mtu=9000 -m ipv6 "$DATALINK" - -ipadm show-addr "$DATALINK/ll" || ipadm create-addr -t -T addrconf "$DATALINK/ll" -ipadm show-addr "$DATALINK/omicron6" || ipadm create-addr -t -T static -a "$LISTEN_ADDR" "$DATALINK/omicron6" -route get -inet6 default -inet6 "$GATEWAY" || route add -inet6 default -inet6 "$GATEWAY" - -args=( - '-D' '/opt/oxide/crucible/bin/crucible-downstairs' - '--dataset' "$DATASET" - '-l' "[$LISTEN_ADDR]:$LISTEN_PORT" - '-P' "$PORTBASE" - '-p' "$DOWNSTAIRS_PREFIX" - '-s' "$SNAPSHOT_PREFIX" -) - -exec /opt/oxide/crucible/bin/crucible-agent run "${args[@]}" diff --git a/agent/smf/agent.xml b/agent/smf/agent.xml index 53ae3bcb1..62c341ce9 100644 --- a/agent/smf/agent.xml +++ b/agent/smf/agent.xml @@ -13,8 +13,13 @@ + + + + @@ -25,11 +30,10 @@ - - + diff --git a/package-manifest.toml b/package-manifest.toml index 37cac4646..6ac171342 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -6,7 +6,6 @@ source.rust.release = true source.paths = [ { from = "agent/smf", to = "/var/svc/manifest/site/crucible" }, { from = "agent/downstairs_method_script.sh", to = "/opt/oxide/lib/svc/manifest/crucible/downstairs.sh" }, - { from = "agent/agent_method_script.sh", to = "/opt/oxide/lib/svc/manifest/crucible/agent.sh" } ] output.type = "zone" @@ -17,6 +16,5 @@ source.rust.binary_names = ["crucible-pantry"] source.rust.release = true source.paths = [ { from = "pantry/smf/pantry.xml", to = "/var/svc/manifest/site/crucible/pantry.xml" }, - { from = "pantry/pantry_method_script.sh", to = "/opt/oxide/lib/svc/manifest/crucible/pantry.sh" } ] output.type = "zone" diff --git a/pantry/pantry_method_script.sh b/pantry/pantry_method_script.sh deleted file mode 100755 index 36d679e82..000000000 --- a/pantry/pantry_method_script.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o pipefail -set -o xtrace - -. /lib/svc/share/smf_include.sh - -DATALINK="$(svcprop -c -p config/datalink "${SMF_FMRI}")" -GATEWAY="$(svcprop -c -p config/gateway "${SMF_FMRI}")" -LISTEN_ADDR="$(svcprop -c -p config/listen_addr "${SMF_FMRI}")" -LISTEN_PORT="$(svcprop -c -p config/listen_port "${SMF_FMRI}")" - -if [[ $DATALINK == unknown ]] || [[ $GATEWAY == unknown ]]; then - printf 'ERROR: missing datalink or gateway' >&2 - exit "$SMF_EXIT_ERR_CONFIG" -fi - -# TODO remove when https://github.com/oxidecomputer/stlouis/issues/435 is addressed -ipadm delete-if "$DATALINK" || true -ipadm create-if -t "$DATALINK" - -ipadm set-ifprop -t -p mtu=9000 -m ipv4 "$DATALINK" -ipadm set-ifprop -t -p mtu=9000 -m ipv6 "$DATALINK" - -ipadm show-addr "$DATALINK/ll" || ipadm create-addr -t -T addrconf "$DATALINK/ll" -ipadm show-addr "$DATALINK/omicron6" || ipadm create-addr -t -T static -a "$LISTEN_ADDR" "$DATALINK/omicron6" -route get -inet6 default -inet6 "$GATEWAY" || route add -inet6 default -inet6 "$GATEWAY" - -args=( - '-l' "[$LISTEN_ADDR]:$LISTEN_PORT" -) - -exec /opt/oxide/pantry/bin/crucible-pantry run "${args[@]}" diff --git a/pantry/smf/pantry.xml b/pantry/smf/pantry.xml index ef4a19df1..06a9fbffd 100644 --- a/pantry/smf/pantry.xml +++ b/pantry/smf/pantry.xml @@ -13,8 +13,13 @@ + + + + @@ -25,8 +30,6 @@ - -