Open Source Training Seminar FreePBX Paid Support

Ticket #2799 (closed Bugs: fixed)

Opened 5 months ago

Last modified 5 months ago

Missing include file prevent installation of FreePBX on Asterisk 1,6

Reported by: cognat Assigned to: p_lindheimer
Priority: minor Milestone: 2.5
Component: Installation Version: 2.4-branch
Keywords: Asterisk 1.6 installation manager_custum.conf Cc:
Confirmation: Need testing SVN Revision (if applicable):
Backend Engine: Asterisk 1.6 Backend Engine Version:

Description

Asterisk 1.6 enforce include files and will not start a component if an include file is missing, this cause a probleme with the installation, the manager.conf install by FreePBX include manager_custom.conf that is missing.

1. Asterisk runs ok to get started (or install_amp wouldn't run) 2. All the files are applied, meaning the new manager.conf 3. We issue a manager reload "asterisk -rx 'reload manager" which will be needed to let retrieve_conf run. at the 3rd step, the manager die because of the missing include. The other problem, the reload command itself may be failing because of the new syntax which is enforced in 1.6: "module reload manager."

Change History

(in reply to: ↑ description ) 04/22/08 17:58:30 changed by cognat

The patch you provide did the trick, it working now. I did the test in a fresh installation.

Replying to cognat:

Asterisk 1.6 enforce include files and will not start a component if an include file is missing, this cause a probleme with the installation, the manager.conf install by FreePBX include manager_custom.conf that is missing. 1. Asterisk runs ok to get started (or install_amp wouldn't run) 2. All the files are applied, meaning the new manager.conf 3. We issue a manager reload "asterisk -rx 'reload manager" which will be needed to let retrieve_conf run. at the 3rd step, the manager die because of the missing include. The other problem, the reload command itself may be failing because of the new syntax which is enforced in 1.6: "module reload manager."

04/23/08 09:04:30 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need testing.
  • version changed from 2.4.0 to 2.4-branch.
  • milestone changed from Cut Line to 3.0.

Here is the patch referred to - will be getting into the main release soon.

Index: install_amp
===================================================================
--- install_amp (revision 5736)
+++ install_amp (working copy)
@@ -1009,8 +1009,50 @@
        exec(dirname(__FILE__)."/apply_conf.sh");
        out("done");
 
+       /* As of Asterisk 1.4.16 or there abouts, a missing #include file will make the reload fail. So
+       we need to make sure that we have such for everything that is in our configs. We will simply
+               look for the #include statements and touch the files vs. trying to inventory everything we may
+               need and then forgetting something.
+       */
+
+       outn("creating missing #include files..");
+       $include_err = false;
+       exec("grep '#include' ".$amp_conf['ASTETCDIR']."/*.conf | sed 's/;.*//; s/#include//'",$output,$retcode);
+       if ($retcode != 0) {
+               out("Error code $retcode: trying to search for missing #include files");
+               $include_err = true;
+       }
+
+       foreach($output as $file) {
+               if (trim($file) == '') {
+                       continue;
+               }
+               $parse1 = explode(':',$file);
+               $parse2 = explode(';',$parse1[1]);
+               $rawfile = trim($parse2[0]);
+               if ($rawfile == '') {
+                       continue;
+               }
+
+               $target = ($rawfile[0] == '/') ? $rawfile : $amp_conf['ASTETCDIR']."/$rawfile";
+
+               if (!file_exists($target)) {
+                       exec("touch $target", $output, $retcode);
+                               if ($retcode != 0) {
+                               out("Error code $retcode: trying to create empty file $target");
+                               $include_err = true;
+                       }
+               }
+       }
+       if (! $include_err) {
+               out("OK");
+       }
        // reload manager in asterisk if it was running:
+       // Execute the 1.4+ syntax and the 1.2 syntax, it will reload twice on 1.4 and in the other cases
+       // it will simply ignore the command since it has been removed. (not worth trying to figure out what
+       // version they have...
        //
+       system("asterisk -rx 'module reload manager'");
        system("asterisk -rx 'reload manager'");
 }
 out("OK");

04/24/08 15:07:31 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads