I am trying to run a Node.js API as a service, but am running into problems.

When running systemctl status servicename.service I get the following error:

servicename.service - [Service description]  
Loaded: leaded (/etc/systemd/system/servicename.service; enabled; vendor preset: enabled)  
Active: failed (Result: start-limit-hit) since [timestamp] ago  
Process: 1142 ExecStart=/usr/bin/node /home/pi/Documents/server.js (code=exited, status=0/SUCCESS)  
Main PID: 1142 (code=exited, status=0/SUCCESS)  
[timestamp] hostname systemd[1]: servicename.service: Service hold-off time over, scheduling restart.  
[timestamp] hostname systemd[1]: Stopped [Service description]
[timestamp] hostname systemd[1]: servicename.service: Start request repeated too quickly.  
[timestamp] hostname systemd[1]: Failed to start [Service description]
[timestamp] hostname systemd[1]: servicename.service: Unit entered failed state.  
[timestamp] hostname systemd[1]: servicename.service: Failed with result 'start-limit-hit'.

What is this error and how can I resolve this issue?

I would like to run the script with sudo since part of the script needs admin permissions.



mkdir /var/run/sshd


systemctl restart ssh




I was also struggling with this same error. It happened due to the restart of the application again and again. In my scenario, my app was not running as systemd service it was running like a demon mode. Check if your application is running as demon or systemd.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.