Skip to content

Fix POSIX redirection in Asterisk stop command - #246

Open
fabianbur wants to merge 1 commit into
FreePBX:release/17.0from
fabianbur:fix-stop-posix-redirection
Open

Fix POSIX redirection in Asterisk stop command#246
fabianbur wants to merge 1 commit into
FreePBX:release/17.0from
fabianbur:fix-stop-posix-redirection

Conversation

@fabianbur

Copy link
Copy Markdown

Summary

Use POSIX-compatible output redirection for the background Asterisk stop command in Console/Stop.class.php.

Why

Stop.class.php launches the Asterisk CLI through shell_exec(). On Debian 12, /bin/sh is dash, while &> is Bash-specific syntax.

The current command uses:

asterisk -rx "core stop ..." &>/dev/null &

Change it to the POSIX-compatible form:

asterisk -rx "core stop ..." >/dev/null 2>&1 &

This avoids relying on Bash-specific redirection in a command executed through the system shell.

Validation

  • php -l amp_conf/htdocs/admin/libraries/Console/Stop.class.php — PASS
  • git diff --check — PASS
  • Exactly one file changed
  • Exactly one insertion / one deletion

Scope

This PR fixes only the shell-redirection defect in Stop.class.php.

It does not claim to fix the separate DPMA res_digium_phone.so unload hang described in the shutdown investigation.

Related context:
FreePBX/issue-tracker#439

@sangoma-oss-cla

sangoma-oss-cla Bot commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant