1

Topic: Update to iRedAdmin-Pro, 4.7 in RHEL 7.8 goes my server down

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? NO
- Linux/BSD distribution name and version: Red Hat Enterprise Linux Server release 7.8 (Maipo)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL (MariaDB)
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After ran the upgrade_iredadmin.sh script to update my server goes completely down, I figure out the problem, it on line 62 of the update script, by getting a wrong RHEL version in:

export DISTRO_VERSION=$(awk -F'"' '/^VERSION_ID=/ {print $2}' /etc/os-release) -> this line resolve to 7.8 instead of 7 as expected by the script

----- content of /etc/os-release ------
root@plaltcorreo01~$more /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.8 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.8:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.8"

---------------------------------



----- Logs from the update script -----
root@plaltcorreo01~/iRedAdmin-Pro-SQL-4.7/tools$bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: RHEL
* HTTP server root: /var/www
* Found iRedAdmin directory: /var/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.6
* Found iRedAdmin config file: /var/www/iredadmin/settings.py
* Copying new version to /var/www/iRedAdmin-Pro-SQL-4.7
* Copy /var/www/iredadmin/settings.py.
* Remove existing systemd service files.
* Copy systemd service file: /lib/systemd/system/iredadmin.service.
cp: cannot stat '/var/www/iRedAdmin-Pro-SQL-4.7/rc_scripts/systemd/rhel7.8.service': No such file or directory
Can't open /lib/systemd/system/iredadmin.service: No such file or directory.
chmod: cannot access '/lib/systemd/system/iredadmin.service': No such file or directory

* Removing old symbol link /var/www/iredadmin
* Creating symbol link /var/www/iredadmin to /var/www/iRedAdmin-Pro-SQL-4.7
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
* Check and install required packages.
* Check SQL tables, and add missed ones - if there's any
* Replace py2 by py3 in cron jobs.
* Clean up.
* Delete all existing sessions to force all admins to re-login.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
Redirecting to /bin/systemctl restart iredadmin.service
Failed to restart iredadmin.service: Unit not found.
Failed, please restart Apache web server or 'iredadmin' (if you're running Nginx as web server) manually.

* Enable service: iredadmin
Failed to execute operation: No such file or directory
Failed to restart iredadmin.service: Unit not found.
Failed, please restart service manually and check its log file.

* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/
---------------------------------------------

To solve the problem I manually ran this commands:


cp -f /root/iRedAdmin-Pro-SQL-4.7/rc_scripts/systemd/rhel7.service /lib/systemd/system/iredadmin.service
perl -pi -e 's#/opt/www#/var/www#g' /lib/systemd/system/iredadmin.service
systemctl daemon-reload
systemctl enable iredadmin.service
systemctl start iredadmin.service


systemctl status iredadmin.service
  iredadmin.service - iRedAdmin daemon service
   Loaded: loaded (/usr/lib/systemd/system/iredadmin.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-02-12 02:21:42 CST; 11s ago
  Process: 5882 ExecStartPre=/usr/bin/chmod 0755 /var/run/iredadmin (code=exited, status=0/SUCCESS)
  Process: 5879 ExecStartPre=/usr/bin/chown iredadmin:iredadmin /var/run/iredadmin (code=exited, status=0/SUCCESS)
  Process: 5877 ExecStartPre=/usr/bin/mkdir /var/run/iredadmin (code=exited, status=0/SUCCESS)
Main PID: 5885 (uwsgi)
   CGroup: /system.slice/iredadmin.service
           ├─5885 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid
           ├─5888 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid
           ├─5889 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid
           ├─5890 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid
           ├─5891 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid
           └─5892 /usr/sbin/uwsgi --ini /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini --pidfile /var/run/iredadmin/iredadmin.pid

Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: mapped 437520 bytes (427 KB) for 5 cores
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: *** Operational MODE: preforking ***
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1657a40 pid: 5885 (default app)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: *** uWSGI is running in multiple interpreter mode ***
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI master process (pid: 5885)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI worker 1 (pid: 5888, cores: 1)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI worker 2 (pid: 5889, cores: 1)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI worker 3 (pid: 5890, cores: 1)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI worker 4 (pid: 5891, cores: 1)
Feb 12 02:21:42 plaltcorreo01.*** iredadmin[5885]: spawned uWSGI worker 5 (pid: 5892, cores: 1)


Hopefully this information help to deal with this problem for future updates

Regards

2 (edited by dave.opc 2021-02-18 15:59:15)

Re: Update to iRedAdmin-Pro, 4.7 in RHEL 7.8 goes my server down

My /etc/os-release on CentOS 7.8 looks like this:

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

You can try to use VERSION_ID="7" in your file. Not sure if the rest will upgrade without errors.
The problem is probably because on iredmail download web page RHEL is not listed as supported OS, that's why this script is expecting something else.
https://www.iredmail.org/download.html

3

Re: Update to iRedAdmin-Pro, 4.7 in RHEL 7.8 goes my server down

Fixed moment ago. This fix will be available in next iRedAdmin(-Pro). and here's fix for iRedAdmin:
https://github.com/iredmail/iRedAdmin/c … ac15647R63

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee