We still have the issue of the app.js process crashing. Do you think it may come from our configuration? (Centos 7, node 4.4.3)
So to restart it automatically I had set up a real systemd service. If someone is interested here is the .service file :
- Code: Select all
[Unit]
Description=Netonix manager service
[Service]
Type=simple
PIDFile=/var/run/netonix-manager.pid
ExecStart=/usr/bin/node /opt/netonix-manager/app.js
Restart=always
RestartSec=10 # Restart service after 10 seconds if node service crashes
StandardOutput=syslog # Output to syslog
StandardError=syslog # Output to syslog
SyslogIdentifier=netonix-manager
Environment=NODE_ENV=production
WorkingDirectory=/opt/netonix-manager
[Install]
WantedBy=multi-user.target
I have not managed to get the bootloader.js running with systemd.
When running the bootloader, if I set the service type to simple it does not monitor the app process, and if I set the service type to forking it awaits for the bootloader to exit on startup, which it does not.
One way to solve my problems would be to terminate the bootloader process if the app process closes. For now you only log the process exit code on a crash, but is there a reason to keep the bootloader process alive if the app process is dead?
Or did I miss a subtlety somewhere?
Thanks for your help.