fix(systemd): set Restart=always and PUBSCRIPT_WEB_DIST in user service and force-restart on .deb install
CI / build (push) Waiting to run
CI / build (push) Waiting to run
This commit is contained in:
@@ -148,9 +148,10 @@ fi
|
||||
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
|
||||
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true
|
||||
fi
|
||||
# Stop any stale background server from a previous package build so the next
|
||||
# launch or systemd restart serves the updated /opt/pubscript bundle cleanly.
|
||||
pkill -f "/opt/pubscript/server/dist/server.mjs" >/dev/null 2>&1 || true
|
||||
# Stop any stale background server from a previous package build so systemd
|
||||
# (Restart=on-failure / Restart=always) or the next desktop launch starts the
|
||||
# freshly installed /opt/pubscript server and asset bundle.
|
||||
pkill -9 -f "/opt/pubscript/server/dist/server.mjs" >/dev/null 2>&1 || true
|
||||
exit 0
|
||||
EOF
|
||||
chmod 0755 "$STAGE_DIR/DEBIAN/postinst"
|
||||
|
||||
+3
-2
@@ -307,9 +307,10 @@ export async function buildApp() {
|
||||
"Type=simple",
|
||||
`Environment=PORT=${cfg.port}`,
|
||||
`Environment=PUBSCRIPT_DB=${dbFile}`,
|
||||
"Environment=PUBSCRIPT_WEB_DIST=/opt/pubscript/apps/web/dist",
|
||||
`ExecStart=${existsSync(optServerEntry) ? `/usr/bin/node ${optServerEntry}` : `/usr/bin/node --import tsx ${localServerEntry}`}`,
|
||||
"Restart=on-failure",
|
||||
"RestartSec=3",
|
||||
"Restart=always",
|
||||
"RestartSec=2",
|
||||
"",
|
||||
"[Install]",
|
||||
"WantedBy=default.target",
|
||||
|
||||
Reference in New Issue
Block a user