I have a node application, running via a systemd service on Ubuntu 16.04
However, after some time the service is getting restarted automatically.
Here's what I get in the logs:
Mar 17 14:35:10 testmachine systemd[1]: myService.service: Main process exited, code=exited, status=7/NOTRUNNING
Mar 17 14:35:10 testmachine systemd[1]: myService.service: Unit entered failed state.
Mar 17 14:35:10 testmachine systemd[1]: myService.service: Failed with result 'exit-code'.
Mar 17 14:35:40 testmachine systemd[1]: myService.service: Service hold-off time over, scheduling restart.
From what I understand, the systemd detects that the service is not running and restarts is after 30 seconds, as I have specified in the service config file.
myService.service
[Unit]
Description=The will start node app
After=cleanMongo.service
[Service]
ExecStart=/media/path/to/execution/scriptFile
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
But my issue is, why does it think the service is not running? The application is doing its thing and in the middle it restarts.
PS: I have lots of CRON jobs running in the node application, is it the case that the process is too busy to reply to some kind of isAlive
from the systemd? And thats why systemd thinks its not running?