<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to automatically start Mango in a systemd based Linux OS]]></title><description><![CDATA[<p dir="auto">Some Linux distributions as CentOS or RedHat are migrating from systemV init type to the newest systemd.</p>
<p dir="auto">If this is your case, you will need to do as follow to make Mango runs with every system startup:</p>
<p dir="auto"><strong>Create a mango.service file:</strong></p>
<p dir="auto">touch /etc/systemd/system/mango.service<br />
chmod 664 /etc/systemd/system/mango.service</p>
<p dir="auto"><strong>Edit the new file so it contains the following:</strong></p>
<p dir="auto">[Unit]<br />
Description=Mango Daemon Service<br />
After=network.target<br />
After=network-online.target</p>
<p dir="auto">[Service]<br />
Type=forking<br />
ExecStart=/opt/mango/bin/ma.sh start<br />
ExecStop=/opt/mango/bin/ma.sh stop<br />
ExecReload=/opt/mango/bin/ma.sh restart<br />
PIDFile=/opt/mango/bin/ma.pid</p>
<p dir="auto">[Install]<br />
WantedBy=multi-user.target</p>
<p dir="auto"><strong>NOTE:</strong> You will need to point the mango directory path to whatever your MA_HOME is.</p>
<p dir="auto"><strong>Reload systemd configuration files:</strong><br />
systemctl daemon-reload</p>
<p dir="auto"><strong>Add mango to systemd, so it runs on every system startup:</strong><br />
systemctl enable mango.service</p>
<p dir="auto">That's it. Now you can manage the Mango service with the following shell commands:</p>
<p dir="auto">systemctl [start|stop|reload|status] mango</p>
<p dir="auto">Good luck!</p>
<p dir="auto">Editted by Phil: original PIDFile entry --&gt; PIDFile=/opt/ambilogger/bin/ma.pid, edited from ambiguity in: <a href="https://forum.infiniteautomation.com/topic/3179/centos-7-systemd-startup-failing" rel="nofollow ugc">https://forum.infiniteautomation.com/topic/3179/centos-7-systemd-startup-failing</a></p>
]]></description><link>https://forum.mango-os.com/topic/2246/how-to-automatically-start-mango-in-a-systemd-based-linux-os</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 22:38:28 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2246.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 May 2016 20:23:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to automatically start Mango in a systemd based Linux OS on Tue, 17 Oct 2017 06:49:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/aoliver" aria-label="Profile: aoliver">@<bdi>aoliver</bdi></a> said in <a href="/post/11570">How to automatically start Mango in a systemd based Linux OS</a>:</p>
<blockquote>
<p dir="auto">PIDFile=/opt/ambilogger/bin/ma.pid</p>
</blockquote>
<p dir="auto">although, this PIDFile=/opt/ambilogger/bin/ma.pid should be /opt/mango/bin ;-)</p>
]]></description><link>https://forum.mango-os.com/post/15831</link><guid isPermaLink="true">https://forum.mango-os.com/post/15831</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 17 Oct 2017 06:49:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to automatically start Mango in a systemd based Linux OS on Tue, 17 Oct 2017 05:59:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/aoliver" aria-label="Profile: aoliver">@<bdi>aoliver</bdi></a> This worked for me on a RPi3 thanks!</p>
]]></description><link>https://forum.mango-os.com/post/15830</link><guid isPermaLink="true">https://forum.mango-os.com/post/15830</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 17 Oct 2017 05:59:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to automatically start Mango in a systemd based Linux OS on Mon, 29 May 2017 18:43:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: Jared-Wiltshire">@<bdi>Jared-Wiltshire</bdi></a><br />
Hi Jared I am wondering if you would generate a systemd script for our Ubuntu 16.04 LTS and show it here as the one provided above complains of an error when I tried this script in our system?<br />
I Appreciate any help on this.</p>
]]></description><link>https://forum.mango-os.com/post/14550</link><guid isPermaLink="true">https://forum.mango-os.com/post/14550</guid><dc:creator><![CDATA[Phillip Weeks]]></dc:creator><pubDate>Mon, 29 May 2017 18:43:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to automatically start Mango in a systemd based Linux OS on Wed, 11 May 2016 02:30:14 GMT]]></title><description><![CDATA[<p dir="auto">I'll add an Upstart script for Ubuntu, I have been using this with Ubuntu 14.04. This one lets you run mango as a non-root user. Restart doesn't work too well as <a href="http://ma-stop.sh" rel="nofollow ugc">ma-stop.sh</a> doesn't stop Mango immediately.</p>
<p dir="auto">From Ubuntu 15.04 onwards systemd is used instead of Upstart so dont use this script.</p>
<pre><code># mango - Mango Automation
#
# Mango Automation is a Java web app for monitoring and logging data sources

description     "Mango Automation"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!2345]

#respawn
#respawn limit 10 5

umask 002
setuid mango
setgid mango

env MA_HOME=/opt/mango
export MA_HOME

console log

script
        . "$MA_HOME"/bin/ma-init.sh
        export JPDA EXECJAVA JAVAOPTS SYSOUT SYSERR
        exec "$MA_HOME"/bin/ma-start.sh
end script

pre-stop script
        "$MA_HOME"/bin/ma-stop.sh
end script
</code></pre>
]]></description><link>https://forum.mango-os.com/post/11592</link><guid isPermaLink="true">https://forum.mango-os.com/post/11592</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Wed, 11 May 2016 02:30:14 GMT</pubDate></item></channel></rss>