Ticket #2020 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

symlinked agis can fail

Reported by: dswartz Assigned to:
Priority: blocker Milestone: 2.3
Component: Core Version: 2.3-branch
Keywords: Cc:
Confirmation: Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

With movement of agis to /var/www/html/admin/modules etc... and their replacement in /var/lib/asterisk/agi-bin with symlinks, two agis use require or require_once to load phpagi.agi and phpagi-asmanager.agi, but the assumption is that '.' is where to look for them - no longer true, although i seem to be the only one this has bitten.

Change History

06/28/07 06:33:43 changed by p_lindheimer

  • owner deleted.
  • component changed from - choose - to Core.

06/28/07 19:51:40 changed by p_lindheimer

  • priority changed from major to blocker.

Another occurence - we need to address this but I would really like to get to root cause of the issue.

(follow-up: ↓ 7 ) 06/28/07 20:57:28 changed by p_lindheimer

OK - I reproduced the issue by setting an include path in the php.ini file that does NOT include a "." as part of it. I can then make it fail and according to the php manual it is behaving correctly and trying the location of the script.

I then make the following change in dialparties.agi:

require_once "./phpagi.php";
require_once "./phpagi-asmanager.php";

The inclusion of "./" and that results in it working again. So, right now that is the intended fix to this and all other scripts that are symlinked. Please, if you have been dealing with this problem, put the system back into a failure mode and then try this fix and see if it solve the problem. PLEASE report back on this bug with either success or failure so we can properly address this issue.

06/29/07 14:08:09 changed by p_lindheimer

NO GO on that fix.
having looked at one system that exhibits this behavior, the agi script is running with a current path of "/tmp" for some reason, instead of "/var/lib/asterisk/agi-bin" which is where it should be running from. This system is an Asterisk 1.4.5 version.

So it appears for some reason Asterisk is starting the script from /tmp in these cases although there is nothing immediately apparent as to why it would be doing that.

Another point, whether dialparties.agi is linked or copied to the agi-bin does not change the /tmp working directory.

06/29/07 15:26:39 changed by p_lindheimer

Fails on 1.4.5 and 1.2 on danswart's system, dan's system is: PHP 5.1.6 (cli)
hi is getting /tmp as his pwd path and ENV path

checked Robert's system, he is running 1.4.5 and PHP 4.3.11 (cgi) and his system runs fine. His pwd path is /var/lib/astesisk/agi-bin but his $_ENVPWD? is /tmp ???

06/29/07 15:28:50 changed by p_lindheimer

oops - I mean $_SERVERPWD? in the above cases

(in reply to: ↑ 3 ) 06/30/07 04:16:56 changed by Ako

Replying to p_lindheimer:

The inclusion of "./" and that results in it working again. So, right now that is the intended fix to this and all other scripts that are symlinked. Please, if you have been dealing with this problem, put the system back into a failure mode and then try this fix and see if it solve the problem. PLEASE report back on this bug with either success or failure so we can properly address this issue.

I have this issue with dialpartes.cgi (see ticket #2037). I fixed it temporarily by using "hard" instead of "soft" symlink. I have tried your suggestion to insert "./", but it doesn't work for me.

06/30/07 09:16:19 changed by p_lindheimer

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

r4273 (2.3)
r4274 (2.2)

Changed from symlink to copy for agi-bin dir. This will remain in place until a reliable way to symlink without the need to parse amportal.conf is determined. To keep from overwritting a modified file in agi-bin that normally gets symlinked, you must remove write permission on the file

07/01/07 06:48:23 changed by p_lindheimer

see #2042 for some thoughts on going back to symlinks