I have a Linux Ubunut 22.04 Server at IONOS. I want to develop and deploy a thinmusic server.
I installed NodeJS, npm, react-script. The server is running when I call it manually. But when I want to start it as a service, it doesn't work.
Please support me.
I have a thinmusic.service:
[Unit]
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/npm start
Restart=on-failure
WorkingDirectory=/var/www/vhosts/playlist-manager.de/script.playlist-manager.de/vendor/thinmusic/
Environment=REACT_APP_MUSICKIT_TOKEN=...
Environment=REACT_APP_FIREBASE_TOKEN=...
[Install]
WantedBy=multi-user.target
Following error occurs:
× thinmusic.service
Loaded: loaded (/etc/systemd/system/thinmusic.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-06-05 05:18:48 UTC; 1s ago
Process: 460619 ExecStart=/usr/bin/npm start (code=exited, status=1/FAILURE)
Main PID: 460619 (code=exited, status=1/FAILURE)
CPU: 33ms
Jun 05 05:18:48 focused-khorana.217-160-89-20.plesk.page systemd[1]: thinmusic.service: Scheduled restart job, restart counter is at 5.
Jun 05 05:18:48 focused-khorana.217-160-89-20.plesk.page systemd[1]: Stopped thinmusic.service.
Jun 05 05:18:48 focused-khorana.217-160-89-20.plesk.page systemd[1]: thinmusic.service: Start request repeated too quickly.
Jun 05 05:18:48 focused-khorana.217-160-89-20.plesk.page systemd[1]: thinmusic.service: Failed with result 'exit-code'.
Jun 05 05:18:48 focused-khorana.217-160-89-20.plesk.page systemd[1]: Failed to start thinmusic.service.
I want to start it everytime with the server as a service.