fix(proxy): unit file carries DISPLAY + DBUS_SESSION_BUS_ADDRESS
Lockout notifications need a session path; systemd user services start with an empty Environment, which made notify-send silently unreachable. Installer now writes the current DISPLAY and the user-bus address (XDG runtime dir) into the unit; deploy + daemon-reload + restart applied live and verified (7 listeners, routed profiles answer 200).
This commit is contained in:
1 parent
be0e2d84cc
commit
25780cd6e8
1 file changed
+1
-1
@@ -450,7 +450,7 @@ function sectionUnit() {
|
|||||||
if (cand && !fs.realpathSync(cand).includes('/.hermes/')) nodeBin = cand;
|
if (cand && !fs.realpathSync(cand).includes('/.hermes/')) nodeBin = cand;
|
||||||
}
|
}
|
||||||
if (!nodeBin) nodeBin = process.execPath;
|
if (!nodeBin) nodeBin = process.execPath;
|
||||||
const want = `[Unit]\nDescription=Local Proxy Bridge (Keyring Auth)\nAfter=network.target\n\n[Service]\nType=simple\nExecStart=${nodeBin} ${BRIDGE_DIR}/bridge.js\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;
|
const want = `[Unit]\nDescription=Local Proxy Bridge (Keyring Auth)\nAfter=network.target\n\n[Service]\nType=simple\nEnvironment=DISPLAY=${process.env.DISPLAY || ':0'}\nEnvironment=DBUS_SESSION_BUS_ADDRESS=${process.env.DBUS_SESSION_BUS_ADDRESS || `unix:path=/run/user/${process.getuid()}/bus`}\nExecStart=${nodeBin} ${BRIDGE_DIR}/bridge.js\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;
|
||||||
let current = null;
|
let current = null;
|
||||||
try { current = fs.readFileSync(unitPath, 'utf8'); } catch {}
|
try { current = fs.readFileSync(unitPath, 'utf8'); } catch {}
|
||||||
if (current === want) {
|
if (current === want) {
|
||||||
|
|||||||
Reference in new issue
Block a user