1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Add systemd support to Asterisk + #2908 debug experiments

This commit is contained in:
root 2021-08-05 16:50:24 -04:00
parent c3b43b93ff
commit 37805f7a4c
3 changed files with 27 additions and 11 deletions

View file

@ -1,7 +1,12 @@
# 2021-08-03: Asterisk's own install_prereq (below) handles these?
# 2021-08-05: Asterisk's own install_prereq (below) handles most all of these
#- name: Asterisk - Install dependencies
# include: asterisk_dependencies.yml
- name: Install package 'libsystemd-dev' so Asterisk compiles in systemd support -- after '/* #undef HAVE_SYSTEMD */' becomes '#undef HAVE_SYSTEMD' in /opt/iiab/asterisk/include/asterisk/autoconfig.h -- per https://community.asterisk.org/t/systemctl-start-asterisk-is-fail-with-timeout/81123/3 and https://github.com/asterisk/asterisk/blob/master/contrib/systemd/asterisk.service
package:
name: libsystemd-dev
state: present
- name: Asterisk - Download {{ asterisk_url }}/{{ asterisk_src_file }} to {{ downloads_dir }}
get_url:
url: "{{ asterisk_url }}/{{ asterisk_src_file }}"
@ -74,7 +79,7 @@
args:
chdir: "{{ asterisk_src_dir }}"
- name: Asterisk - Run 'make' - CAN TAKE 30 MIN OR LONGER!
- name: Asterisk - Run 'make' - CAN TAKE 8-30 MIN OR LONGER!
command: make
args:
chdir: "{{ asterisk_src_dir }}"
@ -97,10 +102,16 @@
chdir: "{{ asterisk_src_dir }}"
- name: Asterisk - Run 'ldconfig'
shell: ldconfig
command: ldconfig
args:
chdir: "{{ asterisk_src_dir }}"
# - name: 2021-08-05 EXPERIMENTALLY RUN 'update-rc.d -f asterisk remove' similar to 'systemctl disable asterisk' as recommended by https://wiki.freepbx.org/display/FOP/Installing+FreePBX+16+on+Debian+10.9
# command: update-rc.d -f asterisk remove
- pause:
- name: Asterisk - Ensure group 'asterisk' exists
group:

View file

@ -1,12 +1,12 @@
- name: Asterisk - Install dependencies
package:
name:
- git
- curl
- git # Not visible in install_prereq
- curl # Not visible in install_prereq
- wget
- libnewt-dev
- libssl-dev
- libncurses5-dev
- libncurses5-dev # Not visible in install_prereq
- subversion
- libsqlite3-dev
- build-essential

View file

@ -116,7 +116,7 @@
# dest: "{{ freepbx_install_dir }}/admin/libraries/view.functions.php"
- name: FreePBX - 4-step install (just run once) - CAN TAKE 12 MIN OR LONGER!
- name: FreePBX - 4-step install (just run once) - CAN TAKE 3-12 MIN OR LONGER!
command: "{{ item }}"
args:
chdir: "{{ freepbx_src_dir }}"
@ -124,9 +124,11 @@
with_items:
- ./start_asterisk start
- ./install -n --webroot {{ freepbx_install_dir }} --dbuser {{ asterisk_db_user }} --dbpass {{ asterisk_db_password }} --dbname {{ asterisk_db_dbname }} --cdrdbname {{ asterisk_db_cdrdbname }}
# - ./start_asterisk stop
- killall -9 safe_asterisk # 2021-08-05: Thanks to @jvonau's PR $2912, these 2 lines are a (brute force for now!) workaround to the intermittent #2908
- killall -9 asterisk # install issue of 'systemctl status freepbx' showing "Unable to run Pre-Asterisk hooks, because Asterisk is already running"
# - ./start_asterisk stop
#- killall -9 safe_asterisk # 2021-08-05: Thanks to @jvonau's PR $2912, these 2 lines attempt a (brute force for now, not enough?!) workaround to intermittent
#- killall -9 asterisk # #2908 install issue of 'systemctl status freepbx' showing "Unable to run Pre-Asterisk hooks, because Asterisk is already running"
- pause:
# - name: 'FreePBX - fix file permissions for NGINX: /etc/freepbx.conf (0644), /var/log/asterisk/freepbx.log (0666)'
# file:
@ -147,7 +149,7 @@
# # - /var/www/html/freepbx/admin/assets/less/cache
# - /var/spool/asterisk/cache
- name: FreePBX - Install /etc/odbc.ini from template (root:root, 0644 by default)
- name: FreePBX - Install /etc/odbc.ini from template (root:root, 0644 by default) - in future consider compiling ODBC driver for aarch64 per http://mghadam.blogspot.com/2021/03/install-asterisk-18-freepbx-15-on.html ?
template:
src: odbc.ini
dest: /etc/
@ -170,3 +172,6 @@
path: /etc/apache2/ports.conf
line: "Listen {{ pbx_http_port }}"
# insertafter: Listen 80
- pause: