Update systemd service in jotty update script

- Recreate systemd service file with correct ExecStart command
- Change from 'yarn start' to '/usr/bin/node server.js'
- Ensures old installations get updated service configuration
- Run daemon-reload after service file update
This commit is contained in:
MickLesk
2025-12-21 22:59:32 +01:00
parent 9fe00ae3c6
commit 7bc97edce6

View File

@ -66,6 +66,24 @@ function update_script() {
$STD tar -xf /opt/data_config.tar
msg_ok "Restored configuration & data"
msg_info "Updating Service"
cat <<EOF >/etc/systemd/system/jotty.service
[Unit]
Description=jotty server
After=network.target
[Service]
WorkingDirectory=/opt/jotty
EnvironmentFile=/opt/jotty/.env
ExecStart=/usr/bin/node server.js
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
msg_ok "Updated Service"
msg_info "Starting Service"
systemctl start jotty
msg_ok "Started Service"