1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #2908 from holta/asterisk-please-start

Does something like 'RestartSec=3' in /etc/systemd/system/freepbx.service help Asterisk start reliably? (WIP)
This commit is contained in:
A Holt 2021-08-04 13:36:41 -04:00 committed by GitHub
commit 09cecc881d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 14 deletions

View file

@ -1,18 +1,29 @@
- name: Enable & (Re)start 'asterisk' systemd service (if pbx_enabled)
systemd:
daemon_reload: yes
name: asterisk
enabled: yes
state: restarted
when: pbx_enabled
# 2021-08-04: Stanza below commonly causes systemd error "Asterisk is already
# running. /etc/init.d/asterisk will exit now" (initial installs especially?)
#
# But without this stanza, 'systemctl restart freepbx' all alone during initial
# install ALSO fails to start Asterisk reliably, on Ubuntu 20.04 & Debian 11 :/
#
# Yes /etc/systemd/system/freepbx.service is supposed to run 'fwconsole stop'
# then 'fwconsole start' reliably, as many web posts recommend, But No Dice!
#
# Do we need something like 'RestartSec=3' in freepbx.service ??
#
#- name: Enable & (Re)start 'asterisk' systemd service (if pbx_enabled)
# systemd:
# daemon_reload: yes
# name: asterisk
# enabled: yes
# state: restarted
# when: pbx_enabled
- name: Disable & Stop 'asterisk' systemd service (if not pbx_enabled)
systemd:
daemon_reload: yes
name: asterisk
enabled: no
state: stopped
when: not pbx_enabled
#- name: Disable & Stop 'asterisk' systemd service (if not pbx_enabled)
# systemd:
# daemon_reload: yes
# name: asterisk
# enabled: no
# state: stopped
# when: not pbx_enabled
- name: Enable & (Re)start 'freepbx' systemd service (if pbx_enabled)

View file

@ -7,6 +7,7 @@ Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start
ExecStop=/usr/sbin/fwconsole stop
RestartSec=3
[Install]
WantedBy=multi-user.target