Some Linux distributions as CentOS or RedHat are migrating from systemV init type to the newest systemd.
If this is your case, you will need to do as follow to make Mango runs with every system startup:
Create a mango.service file:
touch /etc/systemd/system/mango.service
chmod 664 /etc/systemd/system/mango.service
Edit the new file so it contains the following:
[Unit]
Description=Mango Daemon Service
After=network.target
After=network-online.target
[Service]
Type=forking
ExecStart=/opt/mango/bin/ma.sh start
ExecStop=/opt/mango/bin/ma.sh stop
ExecReload=/opt/mango/bin/ma.sh restart
PIDFile=/opt/mango/bin/ma.pid
[Install]
WantedBy=multi-user.target
NOTE: You will need to point the mango directory path to whatever your MA_HOME is.
Reload systemd configuration files:
systemctl daemon-reload
Add mango to systemd, so it runs on every system startup:
systemctl enable mango.service
That's it. Now you can manage the Mango service with the following shell commands:
systemctl [start|stop|reload|status] mango
Good luck!
Editted by Phil: original PIDFile entry --> PIDFile=/opt/ambilogger/bin/ma.pid, edited from ambiguity in: https://forum.infiniteautomation.com/topic/3179/centos-7-systemd-startup-failing