<?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[SElinux modification required for mango bin&#x2F; scripts]]></title><description><![CDATA[<p dir="auto">Just something I noticed while doing a new test install of v4.</p>
<p dir="auto">If SElinux is enabled, the bash scripts in the mango bin directory need a small modification to their type otherwise <code>mango.service</code> will fail with</p>
<pre><code class="language-bash">mango.service: Failed at step EXEC spawning /opt/mango/bin/start-mango.sh: Permission denied
</code></pre>
<p dir="auto">To check a file's SElinux type, pass the <code>-Z</code> flag to <code>ls</code>.</p>
<pre><code class="language-bash">ls -Z /opt/mango/bin/
unconfined_u:object_r:user_home_t:s0 certbot-deploy.sh*  
unconfined_u:object_r:user_home_t:s0 mango.cmd
unconfined_u:object_r:user_home_t:s0 start-options.sh*
unconfined_u:object_r:user_home_t:s0 genkey.sh*
unconfined_u:object_r:user_home_t:s0 mango.service
unconfined_u:object_r:user_home_t:s0 stop-mango.sh*
unconfined_u:object_r:user_home_t:s0 getenv.sh*
unconfined_u:object_r:user_home_t:s0 mango.xml
unconfined_u:object_r:user_home_t:s0 install-mango.sh*
unconfined_u:object_r:user_home_t:s0 start-mango.sh*
</code></pre>
<p dir="auto">In order to be run from a systemd service, the scripts need to be of type <code>bin_t</code>. Their type can be changed using <code>chcon</code>.</p>
<pre><code class="language-bash">sudo chcon -t bin_t /opt/mango/bin/*.sh
</code></pre>
<p dir="auto">Now the files are of the correct SElinux type and  <code>mango.service</code> will run as expected.</p>
<pre><code class="language-bash">ls -Z /opt/mango/bin/
unconfined_u:object_r:bin_t:s0 certbot-deploy.sh*
unconfined_u:object_r:user_home_t:s0 mango.cmd
unconfined_u:object_r:bin_t:s0 start-options.sh*
unconfined_u:object_r:bin_t:s0 genkey.sh*
unconfined_u:object_r:user_home_t:s0 mango.service
unconfined_u:object_r:bin_t:s0 stop-mango.sh*
unconfined_u:object_r:bin_t:s0 getenv.sh*
unconfined_u:object_r:user_home_t:s0 mango.xml
unconfined_u:object_r:bin_t:s0 install-mango.sh*
unconfined_u:object_r:bin_t:s0 start-mango.sh*
</code></pre>
<p dir="auto">Might be helpful info to add to the linux documentation.</p>
]]></description><link>https://forum.mango-os.com/topic/5323/selinux-modification-required-for-mango-bin-scripts</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 05:09:02 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/5323.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Oct 2021 23:17:54 GMT</pubDate><ttl>60</ttl></channel></rss>