FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
5 stars 1 forks source link

./install returns non-zero exit code on success #202

Open reraikes opened 1 month ago

reraikes commented 1 month ago

FreePBX Version

FreePBX 17

Issue Description

cd /usr/src git clone --branch release/17.0 --depth 1 https://github.com/FreePBX/framework.git mv framework freepbx cd /usr/src/freepbx ./start_asterisk start ./install --no-interaction

echo $? 1

All previous versions of FreePBX return 0 on success and only return non-zero on failure.

Operating Environment

Framework version: 17 Asterisk version: 20

Relevant log output

No response

kguptasangoma commented 1 month ago

Hi @reraikes I just built fresh debian, executed install script with "--nofreepbx" option to ensure all the basic setup done along with asterisk but without freepbx.

then followed below steps and got the error during "install" time, so are you also seeing the same ?

` root@kgupta-debian-testing:/usr/src# git clone --branch release/17.0 --depth 1 https://github.com/FreePBX/framework.git Cloning into 'framework'... remote: Enumerating objects: 9063, done. remote: Counting objects: 100% (9063/9063), done. remote: Compressing objects: 100% (6513/6513), done. remote: Total 9063 (delta 2837), reused 6617 (delta 2237), pack-reused 0 Receiving objects: 100% (9063/9063), 14.42 MiB | 6.61 MiB/s, done. Resolving deltas: 100% (2837/2837), done. root@kgupta-debian-testing:/usr/src# mv framework freepbx root@kgupta-debian-testing:/usr/src# cd /usr/src/freepbx root@kgupta-debian-testing:/usr/src/freepbx# ./start_asterisk start

STARTING ASTERISK Asterisk Started root@kgupta-debian-testing:/usr/src/freepbx# ./install --no-interaction

Assuming you are Database Root Checking if SELinux is enabled...Its not (good)! No /etc/asterisk/asterisk.conf file detected. Installing...Writing /etc/asterisk/asterisk.conf...Done Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Error! Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user Asterisk appears to be running as asterisk Try starting Asterisk with the './start_asterisk start' command in this directory root@kgupta-debian-testing:/usr/src/freepbx# echo $? 1

reraikes commented 1 month ago

This is the script I use:

touch /etc/asterisk/{modules,statsd,smdi}.conf cd /usr/src git clone --branch release/${VER_FREEPBX} --depth 1 https://github.com/FreePBX/framework.git mv framework freepbx cd /usr/src/freepbx ./start_asterisk start ./install --no-interaction if [ $? -ne 0 ]; then if [ "${VER_FREEPBX}" != "17.0" ]; then # !!! TEMPORARY WORKAROUND !!! echo "" echo "FreePBX installation failed!" echo "" exit 1 fi fi

This produces:

STARTING ASTERISK Asterisk Started Assuming you are Database Root Checking if SELinux is enabled...Its not (good)! No /etc/asterisk/asterisk.conf file detected. Installing...Writing /etc/asterisk/asterisk.conf...Done Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Yes. Determined Asterisk version to be: 20.8.1 Checking if NodeJS is installed and we can get a version from it...Yes. Determined NodeJS version to be: 18.19.0 Preliminary checks done. Starting FreePBX Installation Checking if this is a new install...Yes (No /etc/freepbx.conf file detected) Database Root installation checking credentials and permissions..Connected! Empty asterisk Database going to populate it Updating tables admin, ampusers, cronmanager, featurecodes, freepbx_log, freepbx_settings, globals, module_xml, modules, notifications, cron_jobs...Done Empty asteriskcdrdb Database going to populate it Initializing FreePBX Settings Changing AMPMGRUSER [admin] to match what was given at install time: 4e29918a2e733185fff7561bc2995904 Changing AMPMGRPASS [amp111] to match what was given at install time: 572686399b031ba55c17818085469389 Finished initalizing settings

If "${VER_FREEPBX}" is "17.0", $? is returned as '1". any version less than 17 returns '0' (unless there is an error).

reraikes commented 1 month ago

I should add that FreePBX 17 actually installs/runs OK if you ignore the exit code (the TEMPORARY WORKAROUND).