@typhons/sandbox-tools 0.6.6 → 0.6.7

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/package.json +1 -1
  2. package/start-webchat.sh +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typhons/sandbox-tools",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "sandbox-relay-client": "./relay-client.js",
package/start-webchat.sh CHANGED
@@ -52,6 +52,12 @@ if [ -z "$WEBCHAT_USER" ]; then
52
52
  fi
53
53
  [ -z "$WEBCHAT_USER" ] && WEBCHAT_USER=$(ls /home 2>/dev/null | grep -vx node | head -1)
54
54
 
55
+ # Remove any stale log first. A prior run may have left it owned by a DIFFERENT
56
+ # box user (e.g. the old buggy 'node' detection); fs.protected_regular on /tmp
57
+ # then blocks the new user's `>> /tmp/webchat.log` even at 0666, so node never
58
+ # starts — silently. rm (we're root here) lets the launching user recreate it.
59
+ rm -f /tmp/webchat.log 2>/dev/null || true
60
+
55
61
  if [ -n "$WEBCHAT_USER" ] && id "$WEBCHAT_USER" > /dev/null 2>&1; then
56
62
  su -s /bin/bash "$WEBCHAT_USER" -c "WEBCHAT_PORT=$PORT nohup node '$BIN' >> /tmp/webchat.log 2>&1 &"
57
63
  echo "[start-webchat] started on :$PORT as $WEBCHAT_USER ($BIN)"