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