I followed this guide for the installation http://wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+Ubuntu+Server+14.04.2+LTS. This all works great except I don’t know the right way to start Asterisk automatically after a reboot. I have tried lots of suggestions from googling around but nothing works for me. Has anyone else done this successfully?
This looked good, rebooted and asterisk is running, my phones work, but I can’t make changes from FreePBX as I can do when starting asterisk manually. The error I now get when applying config is:-
Reload failed because retrieve_conf encountered an error: 1
exit: 1
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
Exception: Unable to connect to Asterisk through the CLI in file /var/lib/asterisk/bin/retrieve_conf on line 43
Stack trace:
Exception->() /var/lib/asterisk/bin/retrieve_conf:43
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.
Checking further “/var/run/asterisk/asterisk.ctl” does exist and is zero bytes long. Can you help?
Yes,asterisk is running as root, you should adjust /etc/default/asterisk to suit if you are starting asterisk as a service (/etc/init.d/asterisk ‘sources’ that file) .and not with amportal/fwconsole
It seems this method of starting asterisk has introduced a new problem, quite often I get the message “Illegal instruction (core dumped)” when connecting to asterisk, this never happened when starting asterisk manually. I understand that this may be something to do with FreePBX running on an Amazon ec2 instance, do I need to compile asterisk with different flags, like this?
root@ip-172-31-36-185:/usr/src/asterisk-13.10.0# menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
root@ip-172-31-36-185:/usr/src/asterisk-13.10.0# make
I then did:-
root@ip-172-31-36-185:/usr/src/asterisk-13.10.0# make install
root@ip-172-31-36-185:/usr/src/asterisk-13.10.0# ldconfig
Well, that shouldn’t be a problem with asterisk perhaps something else that can now connect is crashing asterisk (look in /var/log/messages and /var/log/asterisk/full at the same point in time for a clue) . . .
If you rebuild asterisk I suggest you start with ‘make clean’ and don’t forget the ‘./configure’ before ‘make menu select’
But I am not knowledgeable about ec2 so maybe someone else . . .
I did a ‘make clean’ then ‘./configure’, but this caused this:-
root@ip-172-31-36-185:/usr/src/asterisk-13.10.0# menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
-bash: menuselect/menuselect: No such file or directory
If I follow the procedure above instead, it compiles okay and it does appear to fix the ‘Illegal instruction’ issue. Perhaps it is not essential to ‘make clean’ and ./configure because asterisk was only very recently compiled from its source anyway? I don’t really know, just guessing. I have recovered the ec2 instance from a snapshot so it is working okay at the moment.
The BUILD_NATIVE is best chosen within make menuselect (your syntax is wrong) I would also suggest it would be a bad choice to disable it , but absolutely for a clean install over a possibly broken one, you need the ‘make clean’ and ‘./configure’ is necessary at any time you have changed/added/subtracted anything with dependencies/requisites for asterisk in your OS.
I thought it would be okay because the only thing that has changed is disabling the native architecture support.
I got the syntax from here:- https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+Asterisk
In the section ‘Building for non-native architectures’ which is appropriate because this is a virtual machine and it does appear to have done the trick.
That said I will take a copy of the machine and try what you suggest.