Refactor how we restart FS when neccesary
Sometimes RCCN updates require FS to restart, we don't do this because we don't want to drop calls, instead we were waiting till the nighttime when it's likely there are no calls, (we still didn't drop them) Let's issue a shutdown elegant right away, so FS will restart as soon as 'possible'
This commit is contained in:
parent
161a0bb032
commit
29832190cf
3 changed files with 19 additions and 1 deletions
17
modules/rhizo_base/files/bin/notify-freeswitch.sh
Normal file
17
modules/rhizo_base/files/bin/notify-freeswitch.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Puppet has made some change that requires a Freeswitch restart.
|
||||
# Place flag file anyway as fallback. Service will delete it
|
||||
if [ ! -f /tmp/FS-dirty ] ; then
|
||||
echo 1 > /tmp/FS-dirty
|
||||
fi
|
||||
|
||||
if [ `/usr/bin/fs_cli -x 'fsctl shutdown_check'` == "true" ] ; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# Trigger an "elegant" shutdown -
|
||||
# (Shutdown when there are no active calls, but don't disable service in the meantime)
|
||||
# This won't return until FS actually shuts down.
|
||||
exec /usr/bin/fs_cli -x 'fsctl shutdown elegant' &
|
||||
|
|
@ -8,6 +8,7 @@ PIDFile=/run/freeswitch/freeswitch.pid
|
|||
Environment="DAEMON_OPTS=-nonat"
|
||||
EnvironmentFile=-/etc/default/freeswitch
|
||||
ExecStart=/usr/bin/freeswitch -u root -g freeswitch -ncwait $DAEMON_OPTS
|
||||
ExecStopPost=/bin/sh -c "if [ -f /tmp/FS-dirty ]; then rm /tmp/FS-dirty; fi"
|
||||
TimeoutSec=45s
|
||||
Restart=always
|
||||
User=root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue