<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15309">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">contrib/systemd: Added note on common issues with systemd and asterisk<br><br>With newer version of linux /var/run/ is a symlink to /run/ that has<br>been turned into tmpfs.<br><br>Added note that if asterisk has to bind to a specific IP that<br>systemd has to wait until the network is up.<br><br>Added note on how to make sure that the environment variable<br>HOSTNAME is included.<br><br>ASTERISK-29216<br>Reported by: Mark Petersen<br>Tested by: Mark Petersen<br><br>Change-Id: Ib3e560655befd3e99eec743687144f5569533379<br>---<br>M contrib/systemd/asterisk.service<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/contrib/systemd/asterisk.service b/contrib/systemd/asterisk.service</span><br><span>index c3d4648..e654f50 100644</span><br><span>--- a/contrib/systemd/asterisk.service</span><br><span>+++ b/contrib/systemd/asterisk.service</span><br><span>@@ -1,15 +1,22 @@</span><br><span> [Unit]</span><br><span> Description=Asterisk PBX and telephony daemon.</span><br><span> After=network.target</span><br><span style="color: hsl(120, 100%, 40%);">+#include these if asterisk need to bind to a specific IP (other than 0.0.0.0)</span><br><span style="color: hsl(120, 100%, 40%);">+#Wants=network-online.target</span><br><span style="color: hsl(120, 100%, 40%);">+#After=network-online.target network.target</span><br><span> </span><br><span> [Service]</span><br><span> Type=notify</span><br><span> Environment=HOME=/var/lib/asterisk</span><br><span style="color: hsl(120, 100%, 40%);">+#if systemd do not provide hostname and you need to use ${ENV(HOSTNAME)}</span><br><span style="color: hsl(120, 100%, 40%);">+#Environment=HOSTNAME=%H</span><br><span> WorkingDirectory=/var/lib/asterisk</span><br><span> User=asterisk</span><br><span> Group=asterisk</span><br><span> ExecStart=/usr/sbin/asterisk -mqf -C /etc/asterisk/asterisk.conf</span><br><span> ExecReload=/usr/sbin/asterisk -rx 'core reload'</span><br><span style="color: hsl(120, 100%, 40%);">+#if /var/run is a tmpfs, this will create /var/run/asterisk on start</span><br><span style="color: hsl(120, 100%, 40%);">+#RuntimeDirectory=asterisk</span><br><span> </span><br><span> #Nice=0</span><br><span> #UMask=0002</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15309">change 15309</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15309"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ib3e560655befd3e99eec743687144f5569533379 </div>
<div style="display:none"> Gerrit-Change-Number: 15309 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Mark Petersen <bugs.digium.com@zombie.dk> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>