@attraccess/plugin-wago 0.1.0-nightly.1112.1 → 0.1.0-nightly.1114.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +24 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7087,15 +7087,33 @@ wago_probe_privileges`;
7087
7087
  // backend/runtime/supervisor.ts
7088
7088
  function wagoRuntimeSupervisorLaunchShell() {
7089
7089
  return `${wagoShellStat()}
7090
+ # A live supervisor publishes ready into every supervisor-start.* that lacks it.
7091
+ # Removing a request in place races that: rm unlinks ready, the supervisor
7092
+ # writes it again, and rmdir fails with "Directory not empty". Move the request
7093
+ # out of that name first. Writers address it by its old path, so they now fail
7094
+ # instead of refilling the directory that is being removed. The destination is
7095
+ # reserved before the request exists: a same-directory rename and removal need
7096
+ # no new inode, so a full configuration filesystem cannot strand the request.
7097
+ retire_runtime_supervisor_request() {
7098
+ mv "$supervisor_launch" "$supervisor_retired/request" || return 1
7099
+ rm -rf "$supervisor_retired"
7100
+ }
7090
7101
  launch_runtime_supervisor() {
7091
7102
  supervisor_failure_stage=prerequisites
7092
7103
  command -v nohup >/dev/null && command -v sleep >/dev/null || return 1
7093
7104
  test -f "$hook" && test ! -L "$hook" &&
7094
7105
  test "$(stat -c '%u:%g:%a:%h' "$hook")" = 0:0:700:1 || return 1
7095
- supervisor_launch=$(mktemp -d "$config/supervisor-start.XXXXXX") || return 1
7106
+ supervisor_retired=$(mktemp -d "$config/supervisor-retired.XXXXXX") || return 1
7107
+ if ! supervisor_launch=$(mktemp -d "$config/supervisor-start.XXXXXX"); then
7108
+ rm -rf "$supervisor_retired"
7109
+ return 1
7110
+ fi
7096
7111
  # Caller rollback must never run without its transaction lock. Retain its
7097
7112
  # traps privately and restore them only after reacquiring that same lock.
7098
- trap > "$supervisor_launch/traps" || return 1
7113
+ if ! trap > "$supervisor_launch/traps"; then
7114
+ retire_runtime_supervisor_request
7115
+ return 1
7116
+ fi
7099
7117
  trap - EXIT
7100
7118
  supervisor_interrupted=0
7101
7119
  # Defer a catchable interruption until rollback can again own install.lock.
@@ -7132,7 +7150,7 @@ launch_runtime_supervisor() {
7132
7150
  supervisor_wait_remaining=300
7133
7151
  if ! { test -f "$config/install.lock" && test ! -L "$config/install.lock" &&
7134
7152
  test "$(stat -c '%u:%g:%a:%h' "$config/install.lock")" = 0:0:600:1; }; then
7135
- rm -rf "$supervisor_launch"
7153
+ retire_runtime_supervisor_request
7136
7154
  trap - EXIT HUP INT TERM
7137
7155
  echo 'Runtime supervisor handoff lock unverified; recovery required' >&2
7138
7156
  exit 75
@@ -7140,7 +7158,7 @@ launch_runtime_supervisor() {
7140
7158
  exec 9<>"$config/install.lock"
7141
7159
  until flock -n 9; do
7142
7160
  if test "$supervisor_wait_remaining" -le 0 || ! sleep 2; then
7143
- rm -rf "$supervisor_launch"
7161
+ retire_runtime_supervisor_request
7144
7162
  # Leave recovery ownership intact. Neither the caller nor its outer boot
7145
7163
  # wrapper may roll back a different transaction while this lock is held.
7146
7164
  trap - EXIT HUP INT TERM
@@ -7168,7 +7186,7 @@ launch_runtime_supervisor() {
7168
7186
  (exec 8<>"$config/supervisor.lock"; ! flock -n 8); then supervisor_live=1; fi ;;
7169
7187
  esac
7170
7188
  fi
7171
- rm -rf "$supervisor_launch" || return 1
7189
+ retire_runtime_supervisor_request || return 1
7172
7190
  test "$supervisor_live" = 1
7173
7191
  }
7174
7192
  launch_runtime_supervisor || fail "Runtime supervisor launch unverified: $supervisor_failure_stage"`;
@@ -10130,7 +10148,7 @@ async function processOutput(command, args, input, signal, environment = {}, fil
10130
10148
  if (errorBytes > 16384) stop();
10131
10149
  else errors.push(chunk);
10132
10150
  });
10133
- child.stdin.on("error", () => stop());
10151
+ child.stdin.on("error", () => void 0);
10134
10152
  let stream;
10135
10153
  child.stdin.write(input, () => {
10136
10154
  if (file && !failed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attraccess/plugin-wago",
3
- "version": "0.1.0-nightly.1112.1",
3
+ "version": "0.1.0-nightly.1114.1",
4
4
  "description": "Attraccess integration for WAGO CC100 controllers. Operational control only: not a safety function, and not yet qualified for physical use.",
5
5
  "keywords": [
6
6
  "attraccess-plugin",