I installed the following unit file for an Nodejs Express Server:
[Unit]
Description=Server for SpeedBot
After=network.target
[Service]
ExecStart=/var/www/SpeedBot/server.js
Restart=always
User=nobody
Group=nobody
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/pi/SpeedBot/server.js
[Install]
WantedBy=multi-user.target
When I run it and do: service speedbotserver status i get:
● speedbotserver.service - Server for SpeedBot
Loaded: loaded (/etc/systemd/system/speedbotserver.service; disabled)
Active: failed (Result: start-limit) since Thu 2017-06-29 01:31:18 UTC; 18h ago
Process: 19189 ExecStart=/var/www/SpeedBot/server.js (code=exited, status=216/GROUP)
Main PID: 19189 (code=exited, status=216/GROUP)
.jsfile does not execute. Let me know how thisserver.jsnormally run in your system? I mean, is there any other program that runsserver.jsi. e.node server.jssomething like that – Sourav Jun 29 '17 at 20:28#!/usr/bin/env nodeline at the start and I made the file executable usingchmod +x. Will tryExecStart=/usr/local/bin/node /var/www/SpeedBot/server.js– medicengonzo Jun 30 '17 at 03:26ExecStart=/usr/bin/node /var/www/SpeedBot/server.jsand same result. – medicengonzo Jun 30 '17 at 03:39User=mynameline, since I am already running it assystemd --userthis turned out not to be necessary. I didn't have aGroup=line which made this error quite confusing. – Luc Apr 07 '22 at 10:29