]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
contrib/systemd: Added note on common issues with systemd and asterisk
authorJaco Kroon <jaco@uls.co.za>
Wed, 23 Dec 2020 17:41:10 +0000 (19:41 +0200)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 11 Jan 2021 16:25:06 +0000 (10:25 -0600)
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

contrib/systemd/asterisk.service

index c3d46483c731a7a17f12be5baf8d21cc3bc27311..e654f5023298c5666ad351dc12db573d3d01b6a6 100644 (file)
@@ -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