@misterhuydo/sentinel 1.4.94 → 1.4.95
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.
- package/lib/generate.js +8 -8
- package/package.json +1 -1
package/lib/generate.js
CHANGED
|
@@ -81,7 +81,7 @@ for _jdk in "$HOME"/jdk-* "$HOME"/.jdk /usr/lib/jvm/java-21-openjdk /usr/lib/jvm
|
|
|
81
81
|
done
|
|
82
82
|
# Ensure npm-global bin (cairn-mcp, claude), ~/.local/bin (auto-installed tools), and JAVA_HOME on PATH
|
|
83
83
|
export PATH="$HOME/.npm-global/bin:$HOME/.local/bin:$PATH"
|
|
84
|
-
[[ -n "
|
|
84
|
+
[[ -n "\${JAVA_HOME:-}" ]] && export PATH="\${JAVA_HOME:-}/bin:\$PATH"
|
|
85
85
|
PYTHONPATH="${codeDir}" "${codeDir}/.venv/bin/python3" -m sentinel.main --config ./config \\
|
|
86
86
|
>> "$DIR/logs/sentinel.log" 2>&1 &
|
|
87
87
|
echo $! > "$PID_FILE"
|
|
@@ -312,12 +312,12 @@ for project_dir in "$WORKSPACE"/*/; do
|
|
|
312
312
|
done
|
|
313
313
|
echo "[sentinel] $stopped project(s) stopped"
|
|
314
314
|
`, { mode: 0o755 });
|
|
315
|
-
// watchdog.sh - restarts any project that has stopped unexpectedly.
|
|
316
|
-
// Auto-installed as a cron job by `sentinel upgrade`.
|
|
317
|
-
fs.writeFileSync(path.join(workspace, 'watchdog.sh'),
|
|
318
|
-
"#!/usr/bin/env bash\n# Sentinel watchdog - auto-restart any project that has stopped unexpectedly.\n# Runs every minute via cron. Safe to run manually at any time.\nWORKSPACE=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nNON_PROJECT=\"code repos logs issues workspace\"\nfor project_dir in \"$WORKSPACE\"/*/; do\n [[ -d \"$project_dir\" ]] || continue\n name=$(basename \"$project_dir\")\n echo \" $NON_PROJECT \" | grep -qw \"$name\" && continue\n [[ -f \"$project_dir/start.sh\" ]] || continue\n [[ -f \"$project_dir/config/sentinel.properties\" ]] || continue\n PID_FILE=\"$project_dir/sentinel.pid\"\n if [[ -f \"$PID_FILE\" ]] && kill -0 \"$(cat \"$PID_FILE\")\" 2>/dev/null; then\n continue # running fine\n fi\n echo \"[watchdog] $(date -u +%Y-%m-%dT%H:%M:%SZ) $name is down - restarting\"\n bash \"$project_dir/start.sh\"\ndone\n",
|
|
319
|
-
{ mode: 0o755 });
|
|
315
|
+
// watchdog.sh - restarts any project that has stopped unexpectedly.
|
|
316
|
+
// Auto-installed as a cron job by `sentinel upgrade`.
|
|
317
|
+
fs.writeFileSync(path.join(workspace, 'watchdog.sh'),
|
|
318
|
+
"#!/usr/bin/env bash\n# Sentinel watchdog - auto-restart any project that has stopped unexpectedly.\n# Runs every minute via cron. Safe to run manually at any time.\nWORKSPACE=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nNON_PROJECT=\"code repos logs issues workspace\"\nfor project_dir in \"$WORKSPACE\"/*/; do\n [[ -d \"$project_dir\" ]] || continue\n name=$(basename \"$project_dir\")\n echo \" $NON_PROJECT \" | grep -qw \"$name\" && continue\n [[ -f \"$project_dir/start.sh\" ]] || continue\n [[ -f \"$project_dir/config/sentinel.properties\" ]] || continue\n PID_FILE=\"$project_dir/sentinel.pid\"\n if [[ -f \"$PID_FILE\" ]] && kill -0 \"$(cat \"$PID_FILE\")\" 2>/dev/null; then\n continue # running fine\n fi\n echo \"[watchdog] $(date -u +%Y-%m-%dT%H:%M:%SZ) $name is down - restarting\"\n bash \"$project_dir/start.sh\"\ndone\n",
|
|
319
|
+
{ mode: 0o755 });
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
|
|
322
|
+
|
|
323
323
|
module.exports = { writeExampleProject, generateProjectScripts, generateWorkspaceScripts };
|