[Asterisk-code-review] contrib/systemd: Added note on common issues with systemd and asterisk (asterisk[16])

Friendly Automation asteriskteam at digium.com
Mon Jan 11 10:25:07 CST 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15309 )

Change subject: contrib/systemd: Added note on common issues with systemd and asterisk
......................................................................

contrib/systemd: Added note on common issues with systemd and asterisk

With newer version of linux /var/run/ is a symlink to /run/ that has
been turned into tmpfs.

Added note that if asterisk has to bind to a specific IP that
systemd has to wait until the network is up.

Added note on how to make sure that the environment variable
HOSTNAME is included.

ASTERISK-29216
Reported by: Mark Petersen
Tested by: Mark Petersen

Change-Id: Ib3e560655befd3e99eec743687144f5569533379
---
M contrib/systemd/asterisk.service
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/contrib/systemd/asterisk.service b/contrib/systemd/asterisk.service
index c3d4648..e654f50 100644
--- a/contrib/systemd/asterisk.service
+++ b/contrib/systemd/asterisk.service
@@ -1,15 +1,22 @@
 [Unit]
 Description=Asterisk PBX and telephony daemon.
 After=network.target
+#include these if asterisk need to bind to a specific IP (other than 0.0.0.0)
+#Wants=network-online.target
+#After=network-online.target network.target
 
 [Service]
 Type=notify
 Environment=HOME=/var/lib/asterisk
+#if systemd do not provide hostname and you need to use ${ENV(HOSTNAME)}
+#Environment=HOSTNAME=%H
 WorkingDirectory=/var/lib/asterisk
 User=asterisk
 Group=asterisk
 ExecStart=/usr/sbin/asterisk -mqf -C /etc/asterisk/asterisk.conf
 ExecReload=/usr/sbin/asterisk -rx 'core reload'
+#if /var/run is a tmpfs, this will create /var/run/asterisk on start
+#RuntimeDirectory=asterisk
 
 #Nice=0
 #UMask=0002

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15309
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ib3e560655befd3e99eec743687144f5569533379
Gerrit-Change-Number: 15309
Gerrit-PatchSet: 3
Gerrit-Owner: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210111/80747d6f/attachment.html>


More information about the asterisk-code-review mailing list