Files
clawd/lib/systemd-env.js
stswangzhiping 04dd1017bb fix(network): wired ping probe, AP/WS and systemd notify hardening
- Add hasWiredInternetProbe and export; AP mode uses it with hasInternet
- systemd-env: strip NOTIFY_SOCKET from env early; client uses unix_dgram
- Strip NOTIFY_SOCKET from frpc/ttyd spawn env in watchdog and frpc
- WS: pong miss debounce; AP net monitor consecutive-fail debounce

Made-with: Cursor
2026-03-28 14:37:56 +08:00

18 lines
529 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict';
/**
* 在任意子进程nmcli、pkill、frpc、依赖库启动前从 process.env 摘掉 NOTIFY_SOCKET。
* 否则子进程继承后可能向 systemd 发 sd_notify触发「仅主 PID 可收」的 journal 刷屏。
* 主进程通过 getNotifySocket() 取回路径,自行 unix_dgram 发送。
*/
const _notifySocket = process.env.NOTIFY_SOCKET;
if (_notifySocket) {
delete process.env.NOTIFY_SOCKET;
}
function getNotifySocket() {
return _notifySocket;
}
module.exports = { getNotifySocket };