FYI Install PIAF on CentOS Existing Installation

sircolin

Guru
Joined
Mar 6, 2009
Messages
172
Reaction score
0
Hopefully bluebox could also support openvz without pbxiaf not sure why you guys choose vbox ?
 

Nixi

New Member
Joined
Mar 17, 2009
Messages
21
Reaction score
0
Asterisk 1.8

Hello,

The script is great. I got my server up some time ago on Asterisk 1.6. I would now like to put the new Asterisk 1.8 on a new virtual machine. The option is not there though.

Any chance someone could update the script to include the latest?

Many thanks!

Jonathan
 

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
When I try running:
#Create directory and file to get meetme working
mkdir /usr/include/dahdi/
cp /usr/src/dahdi-linux-complete/linux/include/dahdi/user.h /usr/include/dahdi/user.h

It says can not find directory or file.

Same thing for the zaptel one

Zap/Dahi is unknow, iptables is offline, HIDD is also offline. How do I bring those online?

Asterisk = ONLINE | Zap/Dahdi = UNKNOWN | MySQL = ONLINE │
│ SSH = ONLINE | Apache = ONLINE | Iptables = OFFLINE │
│ Fail2ban = ONLINE | Internet = ONLINE | Ip6Tables = OFFLINE │
│ BlueTooth = OFFLINE | Hidd = OFFLINE | NTPD = ONLINE │
│ SendMail = ONLINE | Samba = OFFLINE | Webmin = ONLINE │
│ Ethernet0 = ONLINE | Ethernet1 = N/A | Wlan0 = N/A │
│ │
│ PBX in a Flash Version = 1.7.5.5 │
│ FreePBX Version = 2.6.0.2 │
│ Running Asterisk Version = Asterisk 1.6.2.13 │
│ Asterisk Source Version = 1.6.2.13 │
│ Zap/Dahdi Source Version = N/A │
│ Libpri Source Version = 1.4.11.4 │
│ Addons Source Version = 1.6.2.2 │
│ IP Address = 173.255.233.125 on eth0 │
│ Operating System = CentOS release 5.5 (Final) │
│ Kernel Version = 2.6.32.16-linode28 - 32 Bit
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Dear all

I was contacted by Sheldon Steele of the ITS Group - http://www.itsgroup.org/ who wanted to install PBX in a Flash on an existing hosted server, 64bit.

He offered to sponsor the development of this script, and he also assisted with debugging and generally sorting out any issues. So our thanks go to Sheldon for putting his hand in his pocket to add 64 bit support, and bringing it right up to date.

The instructions for using the script are broadly similar to those in the original post, but do read through the script to see how it works, and I have included instructions on how to update the script, should it be necessary.

It does not work out of the box for OpenVZ installations, as the ISO cannot be mounted, however, instructions are included on how to get round this.

The script is attached to this post. Current version, 1.02

Yours

Joe
 

Attachments

  • install-piaf-on-existing-centos-v1.02.tar.gz
    7.3 KB · Views: 36

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Improvements to this script.

I believe that there is a more elegant way to do this than using a large yum install line that needs to be kept up to date, however, it does rely on only having the correct packages on the PiaF ISO.

The original idea for the methodology came from a recent post (which I cannot now find) which suggested mounting the ISO to install the packages. If someone has the link, remind me, so I can give attribution.

I have detailed how the correct packages can be selected in this bug report - This thread has now been quite rightly closed as it was hijacked to pontificate on matters irrelevant to the original post.

See proposed code below, which should work once the correct RPM's are available on the ISO, and furthermore, should not need updating, other than updating the variables to reflect new download locations as newer ISO's are released.

Code:
#!/bin/bash
#   Install PBX in a Flash on existing CentOS server by Jonathan Roper.
#   Copyright (C) <2010> <Star2Billing SL>  

#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.

#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#	 [email protected]
#



#Variables
KERNELARCH=$(uname -p)
#Change the next three lines to suit download location of latest PBX in a Flash ISO's
PIAFLOC64=http://ignum2.dl.sourceforge.net/project/pbxinaflash/PIAF-1.7.5.5.3-CentOS-5.5-64bit/pbxinaflash-x86_64-17553.iso
PIAFLOC32=http://mesh.dl.sourceforge.net/project/pbxinaflash/PIAF-1.7.5.5.3-CentOS-5.5-32bit/pbxinaflash-17553.iso
PIAFVERS=1.7.5.5.3

#Identify the Architecture.
KERNELARCH=$(uname -p)
rm -rf pbxinaflash*.iso
#Download apporpriate ISO. 
cd /tmp

if [ $KERNELARCH = "x86_64" ]; then
	wget $PIAFLOC64
else
	wget $PIAFLOC32
fi

#Mount it
mkdir /mnt/piaf
mount -o loop /tmp/pbxinaflash*.iso /mnt/piaf/

#Install the contents of the CD
cd /mnt/piaf/pbx/
yum --nogpgcheck --skip-broken localinstall *.rpm

#Make the ISO look like a PiaF, but don't start the install on reboot
/usr/sbin/ntpdate -su pool.ntp.org

mkdir -p /etc/pbx
date --iso-8601=minutes > /etc/pbx/install-date
echo "ISO=$PIAFVERS" > /etc/pbx/ISO-Version
echo "method=pbx=$PIAFVERS ks - existing CentOS install" > /etc/pbx/install-method

#Don't install automatically, because you won't see or be able to interact with the screen!
#echo "/usr/local/sbin/piafdl" >> /etc/rc.d/rc3.d/S99local 

cp -f /usr/src/piafxtras/preinstallmenu/piafxtras-menu /usr/local/sbin/piafxtras-menu
chmod +x /usr/local/sbin/piafxtras-menu
cat /usr/src/piafxtras/preinstallmenu/motd.tmp >/etc/motd


#Clean Up

#Disable SELINUX
sed -i 's/=enforcing/=disabled/g'  /etc/sysconfig/selinux

cd ~
umount /mnt/piaf/
rm -rf /mnt/pbx/
rm -rf /tmp/pbxinaflash*.iso

#May as well start with an up-to-date system.
yum -y update


#Now reboot
clear

echo "Please reboot your system." 
echo "then type piafdl when you next logon..."
echo "to install PBX in a Flash."

Basically, the method is to mount the ISO, install all the RPM's using yum localinstall, then launch the PiaF install routine after a reboot. Using yum localinstall keeps all the dependencies straight.

I would welcome comments, only of a technical nature, discussing this MO.

Joe
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
Hi everyone,
I am trying to run this script on a CentOS 5.5 box on a VPS at BurstNet. I have followed the directions in the script where I could, including manually installing the listed packages from the PIAF 1775 ISO image. However The compile of Asterisk always seems to fail and of course after that other things tend to go off the track. My install log is too large to attach to this post as a file but I've uploaded it to my site here: http://download.peterbossley.net/public/install-purple.log and would appreciate any help anyone might be able to provide.

The first thing I notice here is that it complains about not having kernel source installed. So I installed kernel-devel and kernel-headers but this same error seems to still be present.

Ideas?

Thanks!
Pete
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

I trust you mean that you used the script attached to post 44, not 45. The script described in post 45 is unlikely to work correctly for reasons described in the bug report linked to from 45.

According to your log file, a large number of dependencies failed to install. Refer to the very very long yum install line. in post 44's attached script, which has been tested quite heavily. http://pbxinaflash.com/forum/attachment.php?attachmentid=389&d=1289888064

Joe
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
I actually did use that script on post 44. I uploaded the packages from the ISO image and used the yum localinstall line as you indicated in your script since I couldn't mount the ISO.

I noticed however that this VM has a wierd yum config. Are there any specific repos that need to be enabled for that long yum install line to work? Here is the yum repo config
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
exclude=kernel*
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

The exclude kernel* has been put in by the piadfdl installer to prevent the kernel being updated, as this breaks Dahdi.

Your yum config looks fine to me.

Run the long yum install line pertinent to your platform architecture, followed by a yum update and then solve any problems it may display.

I would also advise a fresh OS install.

Joe
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
I will do an OS reinstall from the VPS control pannel and then try this again tomorrow. I appreciate your help on this and all your hard work on the prep script.:smile5:
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

I was paid to update it by the ITS Group - http://www.itsgroup.org/, so it is they who they you should be thanking for taking such an open minded attitude to Open Source development coupled with a large degree of generosity.


Joe
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
Joe,
I carefully followed your install script, taking care that the long yum line installed everything. this worked except for, of course, the packages that were on the ISO and not on the repos. However the piafdl script still appears to fail. I uploaded this log here: http://dl.dropbox.com/u/118231/install-purple.log

Do you have any other suggestions on how I could resolve this?

Thanks again.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

The main issue is around lines 10609:-

menuselect/menuselect --check-deps menuselect.makeopts

Code:
***********************************************************
  The existing menuselect.makeopts file did not specify    
  that 'app_dahdibarge' should not be included.  However, either some  
  dependencies for this module were not found or a         
  conflict exists.                                         
                                                           
  Either run 'make menuselect' or remove the existing      
  menuselect.makeopts file to resolve this issue.          
***********************************************************

This fails because Dahdi did not install, as you have what looks like a custom kernel, and no sources for it as seen by lines 5918:-

Code:
make[2]: Leaving directory `/usr/src/dahdi/linux/drivers/dahdi/firmware'
You do not appear to have the sources for the 2.6.18-194.8.1.el5.028stab070.5 kernel installed.
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/usr/src/dahdi/linux'
make: *** [all] Error 2

You may get away with an earlier version of Asterisk, 1.4 or 1.6, as I believe that if there are missing dependencies in the asterisk make menu select, asterisk will throw an error, but install and run anyway. With 1.8, it will not install if you are asking for something to be installed, but the dependencies are not present.

I have a few ideas on how to fix this, but none tested, and only theories.

1. Run a stock kernel with kernel sources, and ignore points 2 and 3.

2. You could consider installing Dahdi separately, and solving any problems with installation, once Dahdi is running, then piafdl could run, and should go ahead and install asterisk, as all dependencies are present.

3. If this fails, you will have to install Asterisk yourself, but you will not have a timing source, with all the issues surrounding that.

Looking at the output of the piafdl script, it seems that the make menuselect of piafdl is done by copying from a pre-configured make menuselect see line 10575

Code:
/var/pbx_load/ast18xtras/menuselect.makeopts' -> `/usr/src/asterisk/menuselect.makeopts'

So should you successfully compile and start Asterisk running by installing asterisk manually before launching piafdl, and as you cannot get Dahdi running, you would have to deselect the modules that were causing a problem. e.g from line 10612, using the make menuselect utility.

  • app_dahdibarge
  • app_dahdiras
  • app_flash
  • app_meetme
  • app_page
  • chan_dahdi
  • codec_dahdi
  • res_timing_dahdi

Once you have got Asterisk running, you can then run the piafdl script, but right at the beginning, before it gets to installing asterisk, quickly open another SSH window, and delete /var/pbx_load/ast18xtras/menuselect.makeopts, this will mean that your menuselect.makeopts created earlier with the make menuselect utility will be used, and we hope that the piafdl script just logs an error, and carries on regardless.

If it does not, quickly replace menuselect.makeopts with your own version.

However, Having said all of this - my view would be that you will save yourself some time and effort by getting a server with a stock kernel, where the kernel sources are included for it, rather than having to fool the install script into working, because all of the above is a bodge, and there may be some other unexplained errors, which may cause those trying to help you solve them at a later date some headaches and frustration.

Joe
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,170
Reaction score
5,199
Just Sayin'

Joe is correct. If you have a custom kernel and no source for it, you're in for some tough slogging. PIAF is a source-based distribution and any OS base install that does not include source will have many, many problems... forever!

This thread reinforces how quickly one can get into the weeds with the DIY route. Nothing particularly wrong with the weeds except that the level and complexity of tech support would be a deal breaker for most users AND support folks.

So... please keep the discussion here and don't open threads in the regular forums where no one (except Joe) knows what you're talking about. :aureola:

338947259nbMbcr_fs.jpg
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
Joe, Et al,
I decided to take an easier route and so used a base net install of CentOS 5.5 on a vmware /ESX system and the above mentioned script to install PIAF Purple. Everything seems to go fine all the way through the PIAF18.exe step - after which I ran passwd-master as listed in the instructions. Now Asterisk appears to not want to start.

any clue as to what this might be? I'm sure I did something wrong somewhere...

Asterisk says offline in status so when running:
/usr/sbin/amportal start
SETTING FILE PERMISSIONS
Permissions OK
STARTING ASTERISK
/usr/sbin/safe_asterisk: line 145: 10201 Segmentation fault (core dumped) n
ice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2
>&1 < /dev/${TTY}
Asterisk ended with exit status 139
Asterisk exited on signal 11.
Automatically restarting Asterisk.
mpg123: no process killed
-----------------------------------------------------
Asterisk could not start!
Use 'tail /var/log/asterisk/full' to find out why.
-----------------------------------------------------
root@pbx:~ $ tail /var/log/asterisk/full
[2010-11-22 13:49:21] VERBOSE[10201] loader.c: app_dial.so => (Dialing Application)
[2010-11-22 13:49:21] VERBOSE[10201] pbx.c: == Registered custom function 'DIALPLAN_EXISTS'
[2010-11-22 13:49:21] VERBOSE[10201] loader.c: func_dialplan.so => (Dialplan Co
ntext/Extension/Priority Checking Functions)
[2010-11-22 13:49:21] VERBOSE[10201] pbx.c: == Registered application 'TrySystem'
[2010-11-22 13:49:21] VERBOSE[10201] pbx.c: == Registered application 'System'
[2010-11-22 13:49:21] VERBOSE[10201] loader.c: app_system.so => (Generic System
() application)
[2010-11-22 13:49:21] VERBOSE[10201] config.c: == Parsing '/etc/asterisk/ooh323.conf': [2010-11-22 13:49:21] VERBOSE[10201] config.c: == Found
[2010-11-22 13:49:21] VERBOSE[10201] chan_ooh323.c: -- == Setting default
context to default
[2010-11-22 13:49:21] VERBOSE[10201] channel.c: == Registered channel type 'OO
H323' (Objective Systems H323 Channel Driver)
[2010-11-22 13:49:21] VERBOSE[10201] rtp_engine.c: == Registered RTP glue 'OOH
323'
root@pbx:~ $;)
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

No idea on this one, apart from to suggest that if it failed on H323, which is very much unsupported by Digium, then that may be the cause of the issue.

Given hardly anyone in the PBX world uses H323 at the moment, I would disable it.

Joe
 

pbossley

New Member
Joined
Nov 15, 2010
Messages
6
Reaction score
0
Any pointers on where to look to do this? I guess I will start looking at asterisk.conf?
 

lagreca

New Member
Joined
Feb 20, 2009
Messages
12
Reaction score
0
The script works fine for me on CentOS 5.5, UNTIL the reboot. I type in piafdl and the screen clears with a fresh command prompt. I type in piafdl 14 and I get:

piafdl: line 67: dialog: command not found

It seems as though the encrypted piafdl script is not working? Any suggestions?
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

piafdl no longer accepts the parameters, 14 or 16, it simply presents you with a menu of what to install.

Make sure piafdl is present, and is the latest version.

Joe
 

lagreca

New Member
Joined
Feb 20, 2009
Messages
12
Reaction score
0
jroper: I tried it JUST AS the directions said, with no parameters, just: piafdl which did NOT work. It simply clears the screen, and goes back to a command prompt.

Because that script is encrypted, there is no way for me to troubleshoot it.

It was installed from a freshly downloaded and mounted iso, as of last night. Please let me know if there is an updated version that I can get somewhere.


Here is some info about the CentOS box:
[root@domain ~]# uname -a
Linux domain 2.6.16-xenU #1 SMP Mon May 28 03:41:49 SAST 2007 i686 i686 i386 GNU/Linux


If I type this in, and press enter:
[root@domain ~]# piafdl

This is what I get:
[root@domain ~]#
 

Members online

Forum statistics

Threads
25,782
Messages
167,512
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top