From 76ad5dbcaa47ca9b2935a2a4e18af1bfa8d15f2c Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:33:30 +0100 Subject: [PATCH] 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. --- ct/planka.sh | 11 +++++++++-- install/planka-install.sh | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ct/planka.sh b/ct/planka.sh index 8caa56cb4..8c81ad6ed 100644 --- a/ct/planka.sh +++ b/ct/planka.sh @@ -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!" diff --git a/install/planka-install.sh b/install/planka-install.sh index f6fdb2fbb..a5a83b7f3 100644 --- a/install/planka-install.sh +++ b/install/planka-install.sh @@ -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]