Ticket #1903 (closed Bugs: fixed)

Opened 2 years ago

Last modified 1 year ago

safe_opserver is a sh script but uses "source" command

Reported by: eil Assigned to:
Priority: trivial Milestone: 2.3
Component: Flash Operator Panel Version: 2.3-branch
Keywords: safe_opserver bash bourne source op_server.pl Cc:
Confirmation: SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

In FreePBX 2.2.1, safe_opserver begins with the following two lines:

#!/usr/bin/env sh
source /etc/amportal.conf

This is incorrect, because the "source" keyword is a bash construct, not a sh one. On many operating systems sh is not merely an alias to bash. For example, on FreeBSD, bash is not installed by default and sh is a real Bourne-compatible shell. On Ubuntu, sh is a symlink to dash, another lightweight shell compatible with the Bourne shell, but without a lot of the bash enhancements.

On these systems, this makes the install_amp script fail. It also makes "amportal start" fail to start the flash operator panel server. (Generating an error to the console every 4 seconds, even. There should definitely be at least basic error condition checks in this script, but that's a separate bug.)

Line 2 should instead read:

. /etc/amportal.conf

Reading the bash manpage, 'source' and '.' appear to be completely equivalent. Except of course that '.' is valid in all Bourne variants.

Change History

04/14/07 14:44:14 changed by p_lindheimer

  • priority changed from major to trivial.

FOP is not 'officially' maintained by freepbx, just included in the distro. However, if you have concern about error checking and other comments, feel free to take the next step and make the fixes and then attach a patch file so that your additions can be reviewed and applied if ok.

06/09/07 02:52:47 changed by p_lindheimer

  • version changed from 2.2.1 to 2.3-branch.

06/30/07 10:53:14 changed by p_lindheimer

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

r4289 (2.3)
r4290 (2.2)

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads