Amportal restart issues

Hi I have created a whole new install of freepbx and asterisk on Ubuntu 12.04LTS server and now I have problems when I restart freepbx. When I run amportal restart it just hangs on STARTING ASTERISK and doesn’t time out or nothing. I have to stop the process and start asterisk manually. I also get this before the hang…
chmod: cannot access /var/lib/asterisk/agi-bin/*': No such file or directory chown: cannot access/var/lib/asterisk/agi-bin’: No such file or directory
Permissions OK
Any ideas?

A Random guess… you don’t have: /var/lib/asterisk/agi-bin

What all did you install/compile before freepbx

Well I know I don’t have it but why is that? I followed this script…

Looks like they put the files in:


mkdir /var/lib/asterisk
ln -s /usr/share/asterisk/agi-bin /var/lib/asterisk/agi-bin
see if that fixes you…

It occurs to me the more correct way to do this is to edit amportal.conf with proper paths…

Ok that fixed the missing directory error now it still hangs on STARTING ASTERISK and just sits there and doesn’t time out.

can you start asterisk by hand?

sudo -u asterisk asterisk

Yes, funny thing is if I type in service asterisk restart it stops it but when it starts back up it says asterisk is already running. It’s like there are two installs of asterisk.

Ok got it to work. Did some diggings and had to edit the safe_asterisk file. Edit /usr/sbin/safe_asterisk and change line 17 from SAFE_AST_BACKGROUND=0 to SAFE_AST_BACKGROUND=1

Is Asterisk running as user Asterisk?

Yes it is.

Is apache2 running as asterisk?