- Joined
- Apr 9, 2024
- Messages
- 91
- Reaction score
- 19
Lab system - 3Cx v20u4, Ent, On Prem, Linux, 4sc with failover
We have failover mostly working in our 3CX Lab environment but have a couple of issues. One such issue is if we put any commands in the before.sh like to echo some log entries into a temp file, then the Secondary / Passive never completes the failover - it stays Secondary / Passive and phones can't register to it. If we don't have a before.sh, on failover the Secondary machine becomes Secondary / Active and phone registration happens just fine.
In addition to the Secondary never becoming Active if we have the commands shown below in the before.sh file, we never see any entries in the temp file the shell script should write to. If we run the shell script from the Linus command line, it does write to the temp file and shut down the Primary as expected.
Are we using a command that's not acceptable?
Here's an example of the before.sh script that seems to prevent the Secondary from becoming Active:
echo " " >> /tmp/3cxfailover.log
echo " " >> /tmp/3cxfailover.log
echo "+++++++++++++++++++++++++++" >> /tmp/3cxfailover.log
echo "before.sh ran at: " `date` >> /tmp/3cxfailover.log
echo `ps -ef | grep -i 3cx` >> /tmp/3cxfailover.log
#Shutdown master PBX, actual IP not shown here
ssh -t [email protected] sudo /usr/sbin/shutdown now
#write log on Primary
echo "************" >> /tmp/3cxfailover.log
echo `date` >> /tmp/3cxfailover.log
exit 0
echo "===========================" >> /tmp/3cxfailover.log
We have failover mostly working in our 3CX Lab environment but have a couple of issues. One such issue is if we put any commands in the before.sh like to echo some log entries into a temp file, then the Secondary / Passive never completes the failover - it stays Secondary / Passive and phones can't register to it. If we don't have a before.sh, on failover the Secondary machine becomes Secondary / Active and phone registration happens just fine.
In addition to the Secondary never becoming Active if we have the commands shown below in the before.sh file, we never see any entries in the temp file the shell script should write to. If we run the shell script from the Linus command line, it does write to the temp file and shut down the Primary as expected.
Are we using a command that's not acceptable?
Here's an example of the before.sh script that seems to prevent the Secondary from becoming Active:
echo " " >> /tmp/3cxfailover.log
echo " " >> /tmp/3cxfailover.log
echo "+++++++++++++++++++++++++++" >> /tmp/3cxfailover.log
echo "before.sh ran at: " `date` >> /tmp/3cxfailover.log
echo `ps -ef | grep -i 3cx` >> /tmp/3cxfailover.log
#Shutdown master PBX, actual IP not shown here
ssh -t [email protected] sudo /usr/sbin/shutdown now
#write log on Primary
echo "************" >> /tmp/3cxfailover.log
echo `date` >> /tmp/3cxfailover.log
exit 0
echo "===========================" >> /tmp/3cxfailover.log