FreePBX / sng_freepbx_debian_install

FreePBX 17 Installation Script
109 stars 41 forks source link

[bug]: Option noioncube causes installation to abort #89

Closed JoseGoncalves closed 1 month ago

JoseGoncalves commented 1 month ago

FreePBX Version

FreePBX 17

Issue Description

I want to have a FreePBX installation without commercial modules (i.e. using only open-source modules) so I would assume that the ionCube package was not required and invoked the installation script in the following way:

sudo ./sng_freepbx_debian_install.sh --noasterisk --noioncube

With these options the installation does not succeed and aborts reporting this:

...
2024-08-21 17:17:51 - Skipping Asterisk installation due to noasterisk option
2024-08-21 17:17:51 - Installing FreePBX packages
2024-08-21 17:17:51 - Skipping ionCube installation due to noioncube option
2024-08-21 17:17:51 - Installing sysadmin17 ....
2024-08-21 17:17:57 - sysadmin17 installed successfully....
2024-08-21 17:17:57 - Installing sangoma-pbx17 ....
2024-08-21 17:18:04 - sangoma-pbx17 installed successfully....
2024-08-21 17:18:04 - Installing ffmpeg ....
2024-08-21 17:18:08 - ffmpeg installed successfully....
2024-08-21 17:18:08 - Enabling modules.
2024-08-21 17:18:08 - Restarting fail2ban
2024-08-21 17:18:09 - Installing FreePBX 17
2024-08-21 17:18:09 - Installing freepbx17 ....
2024-08-21 17:21:40 - freepbx17 installed successfully....
2024-08-21 17:21:40 - Installing Sysadmin module
2024-08-21 17:21:40 - Installation failed at step Installing Sysadmin module. Please check log /var/log/pbx/freepbx17-install-2024.08.21-17.10.49.log for details.
2024-08-21 17:21:40 - Error at line: 1085 exiting with code 127 (last command was: fwconsole ma install sysadmin >> $log 2>&1)
2024-08-21 17:21:40 - Exiting script

Operating Environment

Debian 12

Relevant log output

Setting up freepbx17 (17.1-1.sng12) ...
Installing new version of config file /etc/asterisk/amd.conf ...
Installing new version of config file /etc/asterisk/asterisk.conf ...
Installing new version of config file /etc/asterisk/cdr_adaptive_odbc.conf ...
Installing new version of config file /etc/asterisk/cel_odbc.conf ...
Installing new version of config file /etc/asterisk/dnsmgr.conf ...
Installing new version of config file /etc/asterisk/enum.conf ...
Installing new version of config file /etc/asterisk/extconfig.conf ...

Configuration file '/etc/asterisk/extensions_additional.conf'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
 ==> Keeping old config file as default.
Installing new version of config file /etc/asterisk/indications.conf ...
Installing new version of config file /etc/asterisk/manager.conf ...
Installing new version of config file /etc/asterisk/meetme.conf ...
Installing new version of config file /etc/asterisk/modules.conf ...
Installing new version of config file /etc/asterisk/musiconhold.conf ...
Installing new version of config file /etc/asterisk/pjsip.conf ...
Installing new version of config file /etc/asterisk/pjsip_notify.conf ...
Installing new version of config file /etc/asterisk/queues.conf ...
Installing new version of config file /etc/asterisk/res_parking.conf ...
Installing new version of config file /etc/asterisk/say.conf ...
Installing new version of config file /etc/asterisk/voicemail.conf ...
This account is currently not available.
2024-08-21 17:21:40 - freepbx17 installed successfully....
2024-08-21 17:21:40 - ############################### 
2024-08-21 17:21:40 - Installing Sysadmin module
./sng_freepbx_debian_install.sh: line 1085: fwconsole: command not found
2024-08-21 17:21:40 - ****** INSTALLATION FAILED *****
2024-08-21 17:21:40 - Installation failed at step Installing Sysadmin module. Please check log /var/log/pbx/freepbx17-install-2024.08.21-17.10.49.log for details.
2024-08-21 17:21:40 - Error at line: 1085 exiting with code 127 (last command was: fwconsole ma install sysadmin >> $log 2>&1)
2024-08-21 17:21:40 - Exiting script
kguptasangoma commented 1 month ago

Hi @JoseGoncalves actually noioncube is just skipping the ioncube loader but script install the all the commercial modules, so i think you need to execute the script and remove all the commercial modules afterwards.

Or may be we need to enhance script to add the commercial modules cleanup after installation to use only open source modules.

JoseGoncalves commented 1 month ago

If you need the ionCube loader for the installation to succeed, what is the purpose of having the noioncube option?

It would be nice to have an option in the script that installs only core modules to have an operational FreePBX. After that a user would install the modules that he/she requires.

kguptasangoma commented 1 month ago

hi @JoseGoncalves agreed, thinking to remove the ioncube option now , I think we added this initially.

you can use below command to remove the commercial modules.

fwconsole ma list | grep Commercial | awk '{print $2}' | xargs -I {} fwconsole ma -f uninstall {}

fwconsole ma list | grep Commercial | awk '{print $2}' | xargs -I {} fwconsole ma remove {}

kguptasangoma commented 1 month ago

just added "--opensourceonly" quickly to remove all the commercial modules after installation.

We can keep enhancing script to remove all the commercial components like ioncube or sysadmin-rpm going forward to keep it purely for open source. Feel free to contribute the patches to improve the script further.

thanks

JoseGoncalves commented 1 month ago

Thank you for the --opensourceonly option, this is very helpful for someone that only wants to use open-source software.

Nevertheless, if the --noioncube option causes the installation to abort, i.e., if the ionCube loader is required for the installation to succeed, I think it would better to remove this option from the script.