fix(planka): run the service with node instead of nodemon

npm 12 rejects --prod, and --production still starts PLANKA through nodemon. Starting node app.js directly needs HOME: Sails 1.5.18 only looks for the project's .sailsrc when HOME is set, and systemd sets none without User=, so the app lifted with the wrong paths and returned 503. The unit now sets NODE_ENV and HOME, and an update repairs existing units even without a new release. Follow-up to #18477.
This commit is contained in:
MickLesk
2026-11-06 19:33:30 +01:00
parent 745043bd9a
commit 76ad5dbcaa
2 changed files with 12 additions and 3 deletions
+9 -2
View File
@@ -30,6 +30,15 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
if ! grep -q "^Environment=HOME=" /etc/systemd/system/planka.service; then
msg_info "Updating Service"
sed -i -e '/^Environment=NODE_ENV=/d' -e 's|^ExecStart=.*|Environment=NODE_ENV=production\nEnvironment=HOME=/root\nExecStart=/usr/bin/node app.js --prod|' /etc/systemd/system/planka.service
systemctl daemon-reload
systemctl restart planka
msg_ok "Updated Service"
fi
if check_for_gh_release "planka" "plankanban/planka"; then
msg_info "Stopping Service"
systemctl stop planka
@@ -80,8 +89,6 @@ function update_script() {
msg_ok "Migrated Database"
msg_info "Starting Service"
sed -i 's|ExecStart=/usr/bin/npm start --prod$|ExecStart=/usr/bin/npm start --production|' /etc/systemd/system/planka.service
systemctl daemon-reload
systemctl start planka
msg_ok "Started Service"
msg_ok "Updated successfully!"
+3 -1
View File
@@ -70,7 +70,9 @@ After=network.target
[Service]
WorkingDirectory=/opt/planka
ExecStart=/usr/bin/npm start --production
Environment=NODE_ENV=production
Environment=HOME=/root
ExecStart=/usr/bin/node app.js --prod
Restart=always
[Install]