Are you sure it's the start that's not finishing and not your automation?
This may not work but could be worth looking into.cd /home/nestor/nodebb ./nodebb stop ./nodebb start exit 0
Every time I restart nodebb, the site will down for about 3 minutes. At first I doubted that the nodebb may have some thing to initialize.
Then I found that even if if restart nginx(not reload), this issue may also occur.
During this 3 minutes, the mongodb and 3 node process eat 100% CPU and most of the memory. The 3 minutes depends on the machine, 2core-4G machine will take 3 minutes and 4core-8G machine will take 1 minutes.
I wonder what was nodebb doing during that time?