Install.amp does not set permissions properly

When I run install.amp on a virgin system, I get a bunch of errors. The output has been truncated to show only the relevant parts:

Setting permissions on files..OK
Checking for upgrades..No upgrades found
Generating AMP configs..
Generating Configurations.conf, (if Asterisk is not running, you will get an error
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configuraions.conf files
/bin/bash: /var/lib/asterisk/bin/retrieve_conf: Permission denied
Generating AMP configs..OK
Restarting Flash Operator Panel../bin/bash: /var/lib/asterisk/bin/bounce_op.sh: Permission denied
OK
Checking music.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking infoservices.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking featurecodeadmin.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking core.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking voicemail.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking recordings.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Checking framework.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
enabled
Checking dashboard.. sh: /var/lib/asterisk/bin/module_admin: Permission denied
installed
Please update your modules and reload Asterisk by visiting http://10.10.18.50/admin

*************************************************************************
* Note: It's possible that if you click the red 'Update Now' bar BEFORE *
* updating your modules, your machine will start dropping calls. Ensure *
* that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
* as this is observed, your machine will be fully functional whilst the *
* upgrade is in progress.                                               *
*************************************************************************
asterisk1 freepbx-2.3.1 #

If I look at the permissions of the scripts in /var/lib/asterisk/bin afterwards, I see that the execute bit has not been set:

asterisk1 bin # ls -liah
total 120K
5128193 drwxr-x--- 2 root root 4.0K Jan  2 18:18 .
4817292 drwxr-xr-x 9 root root 4.0K Jan  2 18:18 ..
5128547 -rw-r--r-- 1 root root  14K Jan  3 11:05 archive_recordings
5128357 -rw-r--r-- 1 root root   34 Jan  3 11:05 bounce_op.sh
5128598 -rw-r--r-- 1 root root 6.9K Jan  3 11:05 freepbx-cron-scheduler.php
5128413 -rwxr--r-- 1 root root 6.9K Jan  3 11:05 freepbx_engine
5128573 -rw-r--r-- 1 root root 8.9K Jan  3 11:05 libfreepbx.confgen.php
5128552 -rw-r--r-- 1 root root  17K Jan  3 11:05 module_admin
5128471 -rw-r--r-- 1 root root  22K Jan  3 11:05 retrieve_conf
5128648 -rw-r--r-- 1 root root  14K Jan  3 11:05 retrieve_op_conf_from_mysql.pl
5128459 -rw-r--r-- 1 root root  621 Jan  3 11:05 retrieve_parse_amportal_conf.pl
asterisk1 bin #

If I correct the permissions manually:

asterisk1 bin # ls -liah
total 124K
5128193 drwxr-x--- 2 root root 4.0K Jan  3 11:37 .
4817292 drwxr-xr-x 9 root root 4.0K Jan  2 18:18 ..
5128547 -rwxr--r-- 1 root root  14K Jan  3 11:37 archive_recordings
5128357 -rwxr--r-- 1 root root   34 Jan  3 11:37 bounce_op.sh
5130234 lrwxrwxrwx 1 root root   63 Jan  3 11:37 fax-process.pl -> /var/www/asterisk1/htdocs/admin/modules/core/bin/fax-process.pl
5128598 -rwxr--r-- 1 root root 6.9K Jan  3 11:37 freepbx-cron-scheduler.php
5128413 -rwxr--r-- 1 root root 6.9K Jan  3 11:37 freepbx_engine
5128573 -rwxr--r-- 1 root root 8.9K Jan  3 11:37 libfreepbx.confgen.php
5128552 -rwxr--r-- 1 root root  17K Jan  3 11:37 module_admin
5128471 -rwxr--r-- 1 root root  22K Jan  3 11:37 retrieve_conf
5128648 -rwxr--r-- 1 root root  14K Jan  3 11:37 retrieve_op_conf_from_mysql.pl
5128459 -rwxr--r-- 1 root root  621 Jan  3 11:37 retrieve_parse_amportal_conf.pl

…then re-run install.amp, I still get permission denied errors for retrieve_conf and bounce_op.sh :

Setting permissions on files..OK
Checking for upgrades..No upgrades found
Generating AMP configs..
Generating Configurations.conf, (if Asterisk is not running, you will get an error
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configuraions.conf files
/bin/bash: /var/lib/asterisk/bin/retrieve_conf: Permission denied
Generating AMP configs..OK
Restarting Flash Operator Panel../bin/bash: /var/lib/asterisk/bin/bounce_op.sh: Permission denied
OK
Checking music..

Module successfully installed
installed
Checking infoservices..
Module successfully installed
installed
Checking featurecodeadmin..
Module successfully installed
installed
Checking core..
Module successfully installed
installed
Checking voicemail..
Module successfully installed
installed
Checking recordings..
Module successfully installed
installed
Checking framework..
The following error(s) occured:
 - Module is already enabled
enabled
Checking dashboard..
Module successfully installed
installed
Please update your modules and reload Asterisk by visiting http://10.10.18.50/admin

*************************************************************************
* Note: It's possible that if you click the red 'Update Now' bar BEFORE *
* updating your modules, your machine will start dropping calls. Ensure *
* that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
* as this is observed, your machine will be fully functional whilst the *
* upgrade is in progress.                                               *
*************************************************************************

Please provide more details. Version of freepbx you are attempting to install, OS, distro this was built from and/or process you used to build it yourself. From looking at the provided information I see several things wrong. The owner and group permissions should be asterisk which leads me to believe that you are building this by hand and that some of the pre-requirements are not met.

It’s FreePBX 2.3.1, Gentoo Linux 2.6.21-gentoo-r4, php-5.2.2, mysql-5.0.44, apache-2.0.58-r2 using the FreePBX source tarballs obtained from FreePBX.org. The version of Asterisk is 1.2.18, and is also built from sources.

The Gentoo documentation is basically non-existent so I’m following the Debian instructions as a guideline and documenting as I go.

Essentially I’m following the install documents as provided in the tarball and the Debian install instructions linked from freepbx.org. As far as I know, all the pre-requisites have been met, because it wouldn’t build when some of them were missing. Also, there’s no generic document describing the general prerequisites, only distribution-specific ones.

Perhaps I should post it in Trac.

double check your user rights and group ownership settings. the install should be setting (and does on every setup I’ve run) ownership should be asterisk:asterisk. I think it is in the user rights portion that you have something wrong.

The script generates the files and sets the ownership and permissions. It’s obviously not doing that. What am I supposed to check?

It seems that you do not have the permissions and owership set right to start with for /var/lib/asterisk. If you note the permissions for the directory /var/lib/asterisk/bin it is missing write permission for group. the install script does set permissions once the files are put in place assuming it does not incounter any errors along the way. your output of course shows a problem “/bin/bash: /var/lib/asterisk/bin/retrieve_conf: Permission denied”

Starting at /var/lib/asterisk it should be asterisk:asterisk and have permissions rwxrwx—.

I don’t mean to be a pain but you’ve not provided a direct url referance to exactly which set of debian directions you are attempting to follow. So I can’t be sure if you missed something, or if the directions missed something. If I go to here http://www.freepbx.org/support/documentation/installation/install-process-for-debian there are four possible different set’s of directions. I can’t tell you which is better then the other at this time.

Okay, the Debian instructions I am following are these: http://powerontech.com/freepbx-on-debian.htm

Keep in mind that I’m using these only because they’re the closest thing to generic instructions I was able to find. The existing Gentoo instructions might as well not be there (it’s really just a stub).

Now – the permissions. The permissions in are set by Asterisk when you run “make install”. I have never had to touch them, and the instructions I am following do not mention any ownership and permissions changes until after the install_amp script is run.

With all respect, if there’s an issue with the permissions, the script should either correct it, or, failing that, report the problem as clearly as possible, while offering instructions on what to do next to fix it.

In general:

I’ve brought up the weak documentation before, and going through this process is part of my personal effort to contribute better documentation, in the hopes that I might be allowed to contribute and really clean everything up. The site links to obsolete, incomplete and outright incorrect documentation.

(This makes it very hard to take Philippe’s offering of a (rather expensive) training seminar seriously. Everybody has the right to earn a living, but I get the feeling we’re getting ahead of ourselves here. We should fix the documentation before offering training; With respect, the absence of good docs does not recommend the training.)

The biggest issue with FreePBX in its current form is that it is too distribution specific. It should be possible to build and install it on any standard distribution, and there should be some solid documentation to support administrators who chose to do so.

Rhombus,
Your desire to provide the improved documentation is appreciated and if you had trouble finding me to get access to contribute and add stuff to the site, just ping or pm me. The documentation comes from the community. We (the collective we as developers) have a limited amount of generosity and time. Not everything in the world can be free for the taking with no giving back (and I’m not saying you aren’t trying to give back, but believe me, plenty others don’t).

As far as not taking the training seminar seriously, I’m sorry you feel that way but I assure you that the seminar will be top notch and as far as being expensive, it is completely in line with industry trainings of its kind. (And if you consider the price of the software that you get with it - well it’s about as cheap as you can find). We could take the same effort that we are putting into the training to develop free documentation but let’s be serious, haven’t we given enough for free. Isn’t it time for others to provide such - especially given the distribution of skill sets out there. I think most would rather see those who are in a position to do further development in addition to the constant and ongoing maintenance needs to be focusing on that task, rather then stopping that work to document the project. I can assure you that for every one of us developers who are investing immense amount of time into this project, there are hundreds of users more capably than us of developing top notch documentation. That is where it should be coming from.
Your are right that the documentation is lacking, and when someone who is skilled as a technical writer wants to step up to the plate, and help direct a documentation project for this effort, I will be very glad to have them on board and lead such.

the permissions for the folder are set when you run the line:
useradd -g asterisk -d /var/lib/asterisk -s /bin/bash asterisk

It will create the directory and set the owner and group permissions. From inside the directory (assuming they were not changed) the file . will show the folders owner and group settings.

If that line was missed initially but you executed the line 3 down from it, it would have then created it with the current users group and owner (root). That is what your listing shows as owner and group.

If this was a common mistake there would be a bunch of postings but your is the first one that I’ve seen and the only one I found when doing a quick search.

Could/should the install check this before installing possibly, but just setting up and using asterisk without freepbx needs the owership set right for it to gain access to the sounds folders that are located /var/lib/asterisk.

So that you understand I’m not trying to pick a fight, but help you understand where the issue is, and I’m guessing at where the error occured. If just not possible to have a install script had to check for every possible mistake a person could make, if id did it would be masive and then where do you draw the line? do they install the OS correctly and to whoms standards?

If others suddenly start posting it as a problem it would have to be looked at and addressed, otherwise it will not as there are other things needing more time and attendtion spent on it.

You have reset the permissions correctly and run the install to get things working at this point I’m assuming… If not please try it and if there is still a problem let us know.

Please understand that I’m not trying to pick a fight either :slight_smile: I’m pointing out obvious weaknesses that I think require attention and should be fixed. This would be in everyone’s interest – it would get more people using FreePBX and as a result would drive more people to hire consultants and attend Philippe’s seminar. More users = more installations = more interest = bigger market.

I have never added the asterisk user myself when installing asterisk. This is done by the “make install” when you build Asterisk from sources. It is also what creates the /var/lib/asterisk directory. This is the case on every single one of the Asterisk servers I have built.

The server I am installing on is already running Asterisk, already has the directory created, and already has an asterisk user – but the Asterisk ‘make install’ creates the asterisk directory with the ownership of the user that runs it.

As for the quoted directions, they are for Debian, and I am installing on Gentoo, so no – I have not and cannot follow the directions to the letter.

The point of a script is to simplify the installation process. Here’s a good guideline – if your script does something and throws an error that will cause the resulting installed software to fail, it should tell the user why, not make them guess. Testing the ownership and permissions of a directory or files is not difficult and does not depend on the distribution.

So – to summarize:

  • I am not using CentOS (or Redhat, or Fedora)
  • I am not installing packages, I am installing from sources – and that goes for everything, including Asterisk itself.

Philosophically, I have an issue with the idea that it’s the user’s problem when a script doesn’t do housekeeping. That’s an engineer’s attitude and it does not get more people using the software :slight_smile:

Just put yourself in the user’s shoes for a moment. First, someone comes to you with a software package and says, “It’s great, use it!” So you try to use it, and discover the docs are outdated and contain bad information, or a script fails to work as expected. You approach the developers, explain that you are having problems and point out the deficiencies. The developer responds with, “Well, we offer paid support!”

Are you more or less likely to hire that person for paid support?

In closing – I fixed the ownership and permissions myself. I happen to think the script should do that, or at least inform the user, since a failure means that FreePBX will not work at all. Failing that, the documentation should explain what needs to be done and why things will break if it is not done.

When my Gentoo install doc is done, I’ll submit it to Philippe and we’ll see what happens.

Rhombus - even when it comes to documentation, the focus will be in many other areas. Most users choose one of the many of the distributions available to install FreePBX and the ones that do it themselves are usually very knowledgeable and often can determine right away where issues are. But the entire environment is complex enough that the full distro install is the method of choice by most. It would be great to have comprehensive docs across the board, so any such improved installation docs will be welcome. But I think you will find that as documentation evolves it will be in other areas then the installation.

Hi, Philippe:

“Rhombus - even when it comes to documentation, the focus will be in many other areas.”

Whose focus? Yours?

How do you know how many people might be using FreePBX if it were easier to install? Have you done any testing or polling to see what the user base wants?

“Most users choose one of the many of the distributions available to install FreePBX and the ones that do it themselves are usually very knowledgeable and often can determine right away where issues are.”

Which came first? I’m very experienced with this stuff and yet I still struggle to get a basic installation running – things take me three times as long as they should (certainly when compared with a generic Asterisk install, which I can have up and running in literally minutes). With poor documentation, this should not surprise anyone: The ones that do it themselves had better be knowledgeable, since anyone else is going to be hopelessly lost before they even get started.

I must also ask again – are you speculating, or do you have hard numbers that tell you who’s using it, how, and why? In the absence of that basic science, we are guessing, and that’s not worth much. If I am expected to provide and support a system to commercial clients, the product has to be reliable and the documentation has to be sufficient so that I can do my job. The client is not interested in excuses.

“But the entire environment is complex enough that the full distro install is the method of choice by most.”

That begs the question. Is it complex because it’s naturally complex? Or is it complex because nobody has ever bothered to write down how it all works? Seriously – it’s not that complex, and you’ve admitted as much yourself: “the ones that do it themselves are usually very knowledgeable and often can determine right away where issues are.” It’s configuration files built around macros, a web interface, and a back-end database. It runs on LAMP. We’re not going to Mars here.

Let’s be honest: Developers don’t like documenting. Documentation is boring, and there’s enough boring work to do fixing bugs. But as the gatekeeper, Philippe, you also set the tone and project agenda, and it’s obvious that documentation is not a priority for you. Maybe you feel it will cut into your consulting revenue, I don’t know – but if that’s the case, you’re making a mistake. Good docs are part and parcel of quality software, and if you have good docs, you drive users to your product and to your expertise.

“It would be great to have comprehensive docs across the board, so any such improved installation docs will be welcome. But I think you will find that as documentation evolves it will be in other areas then the installation.”

I’m not even thinking about evolution right now. Just considering the installation documentation alone: it is awful. There is no other way to describe it. The only usable documentation assumes a specific distribution (which, as near as I can tell, was chosen by default). The pedigree of FreePBX (and AMP which preceded it) was that of an application built as a value-add to drive consulting work, and the evidence for that is still there today.

Discussing the rest of the documentation is moot if people can’t get past the install. Trust me, there are plenty of giant holes in the rest of the documentation, too.

On the Asterisk mailing lists, the posts from hopelessly lost FreePBX users are routine and regular, and there is some contempt for FreePBX from very skilled and very experienced Asterisk administrators for the same reasons I’ve outlined above. They just don’t get it, and that’s because there’s no place where they can learn about it. Truth be told, Asterisk suffers from the same kind of weak documentation – except that there is an open, third-party public wiki where people can do their own documentation, and the user base is large enough that it gets updated. Here, the wiki is locked. Why is that?

If one takes the “it’s good enough” attitude, FreePBX will never grow much beyond its current user base. If that happens, it will be too bad. You’d agree that more users is good for the project and for you, wouldn’t you?

Rhombus,
I’m sorry I just don’t have time to carry out this conversation. I have too much on my plate. I’ll make a few comments and then I won’t continue on this thread. The consulting business is not about installing. When I get such requests I point people at the ISO distributions that are available and let them know it will save them a lot of money vs. paying someone to do it. As far as the attitude on the forums about FreePBX it comes rorm several areas of which I won’t go into, documentation is rarely the one. When they are confused about the complexity of FreePBX it is usually the dialplan and AGI scripts, and that is not where most people are looking for documentation.
As far as the direction that FreePBX has come, it is very far from where I and other would like to see it, but it has come far from where it was. As far as open wiki-s, there are some things broken on this Drupal system and I need to get someone who is familiar with Drupal and who we can trust to dig in so we can enable more flexibility in people adding and contributing.
I will not be responding any longer, I’ve got too many other pressing things right now.