I need to run in the background a web app programmed in react and node which is hosted on a linux server. To do this I have created a service in
/etc/systemd/system
that does the following:
Description=Load React-Node Service.
[Service]
ExecStart=/usr/bin/yarn startLinux
WorkingDirectory=/home/developer/projectFolder/
[Install]
WantedBy=multi-user.target
But when I run it with systemctl start webapp.service
I get the following error:
On the other hand if I run it with yarn start
directly from ssh it works, but I need to run it through a service so I don't have to have the terminal open. The yarn start and yarn startLinux commands do the following:
"start": "cross-env NODE_ENV=development concurrently --kill-others-on-fail \"yarn server\" \"yarn client\"", "startLinux": "cross-env NODE_ENV=development concurrently --kill-others-on-fail \"yarn server\" \"yarn clientLinux\"", "client": "cd frontend && yarn start", "clientLinux": "cd frontend && yarn startLinux", "server": "nodemon --exec babel-node src/server.js"
Do you know what could be the problem?
Thanks!