Ubuntu Install causes Asterisk to abort without error

I am trying to install on latest Ubuntu. I’m not sure where the bug is, so I thought I’d post here as well as at launchpad.

Asterisk daemon will work fine before installing FreePBX. After FreePBX is installed, Asterisk will continue to work fine. However after the first time Asterisk terminates it will never come back up again and it will not present any message to say why.

Steps to repeat.

  1. install Ubuntu server from http://releases.ubuntu.com/releases/9.10/
    i used http://releases.ubuntu.com/releases/9.10/ubuntu-9.10-server-i386.iso
    I also only installed ssh server from their install menues

  2. log in or ssh into the machine, become root, and execute the following commands

prerequisites and asterisk and freepbx

apt-get update
apt-get -y install mysql-server apache2 php5 php5-mysql asterisk php5-cli php-pear php-db

you can change this to your favorite flavour of freepbx. They all have the same issue

FREEPBX=freepbx-2.6.0RC2
cd /usr/src/
wget http://mirror.freepbx.org/${FREEPBX}.tar.gz
tar -zxvf ${FREEPBX}.tar.gz
cd ${FREEPBX}

password for database, change to whatever you picked when you installed mysql

RPASS=pass

create databases for asterisk

mysql_install_db
mysqladmin --password=$RPASS create asteriskcdrdb
mysqladmin --password=$RPASS create asterisk
mysql --password=$RPASS asterisk < ./SQL/newinstall.sql
mysql --password=$RPASS asteriskcdrdb < ./SQL/cdr_mysql_table.sql
echo “GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY ‘amp109’;” | mysql --password=$RPASS
echo “GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘amp109’;” | mysql --password=$RPASS

changes to apache to allow for bigger files

sed ‘s/upload_max_filesize./upload_max_filesize = 20M/g’ /etc/php5/cli/php.ini > temp ; mv -v temp /etc/php5/cli/php.ini
sed 's/upload_max_filesize.
/upload_max_filesize = 20M/g’ /etc/php5/apache2/php.ini > temp ; mv -v temp /etc/php5/apache2/php.ini

chown asterisk:asterisk /var/lib/php5 -R
chown asterisk:asterisk /var/www -R
sed ‘s/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=asterisk/g’ /etc/apache2/envvars > temp ; mv temp /etc/apache2/envvars
sed ‘s/export APACHE_RUN_GROUP=www-data/export APACHE_RUN_GROUP=asterisk/g’ /etc/apache2/envvars > temp ; mv temp /etc/apache2/envvars

check asterisk is still running

ps -A | grep asterisk

restart apache and asterisk and check again

/etc/init.d/apache2 restart
/etc/init.d/asterisk restart; sleep 1; ps -A | grep asterisk

#everything should still be running up to this point

#now install freepbx
./install_amp

check asterisk is still running

ps -A | grep asterisk

so far should be so good, and it will all work well too

restart apache and asterisk and check again

/etc/init.d/apache2 restart
/etc/init.d/asterisk restart; sleep 1; ps -A | grep asterisk

Bzzzz, asterisk did not stay up, and checking logs will show no errors.

#-----------------------------------------------------

As I said Asterisk and FreePBX will work fine after FreePBX is installed, but don’t ever let your machine reboot, or you will never get asterisk back.

I set this up in a VMware environment with a snap shot taken right after the OS install, so i’ve been able to try various tests. Each one only takes about 10 minutes this way. It is very repeatable, I just don’t have a clue what the problem is.

Anyone have any ideas.

Try to start Asterisk - when it fails, immediately enter the following at the Ubuntu command prompt:

tail /var/log/asterisk/full

This will show you the last few lines of the log file, and will (hopefully) reveal what Asterisk was attempting to load or to do when it failed. This might give you a clue as to what you need to do to resolve the problem. If it was trying to load a particular module, for example, try removing that module and see what happens.

By the way, I’m NOT a Linux geek, so you’ll probably be able to deduce more from what the log file tells you that I ever could. Just trying to get you pointed in the right direction.