I want node server to run in background. I've read that thread: How do I run a Node.js application as its own process?
I get errors:
systemd[10948]: myapp_test.service: Failed to determine group credentials: No such process
systemd[10948]: myapp_test.service: Failed at step GROUP spawning /some-directory/index.js: No such process
myapp_test.service file:
[Unit]
Description=Something
[Service]
ExecStart=/some-directory/index.js
Restart=always
User=nobody
# Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=development
WorkingDirectory=/some-directory/
[Install]
WantedBy=multi-user.target
I've tried "nobody" as group, I've tried to ommit both user and group but I get this error:
systemd[11543]: myapp_test.service: Failed to execute command: Permission denied
systemd[11543]: myapp_test.service: Failed at step EXEC spawning /some-directory/index.js: Permission denied
If I go to some-directory
and type node index.js
everything works fine (including NODE_ENV=development setting).