mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 00:55:31 +02:00
AlmaLinux 10: install libxcrypt-compat for lscpd; lscpd.0.4.0 for el9/10; lscpd start retry and fastapi guard
This commit is contained in:
@@ -1149,6 +1149,9 @@ if [[ $Server_OS = "CentOS" ]] ; then
|
|||||||
dnf config-manager --set-enabled crb
|
dnf config-manager --set-enabled crb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# el9/el10 need libxcrypt-compat for lscpd (libcrypt.so.1); install for all arches
|
||||||
|
dnf install -y libxcrypt-compat
|
||||||
|
|
||||||
if [[ "$Server_OS_Version" = "9" ]]; then
|
if [[ "$Server_OS_Version" = "9" ]]; then
|
||||||
yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
|
yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
|
||||||
else
|
else
|
||||||
@@ -2355,7 +2358,16 @@ else
|
|||||||
sed -i 's|Include /usr/local/lsws/conf/rules.conf||g' /usr/local/lsws/conf/modsec.conf
|
sed -i 's|Include /usr/local/lsws/conf/rules.conf||g' /usr/local/lsws/conf/modsec.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl daemon-reload >/dev/null 2>&1
|
||||||
systemctl restart lscpd >/dev/null 2>&1
|
systemctl restart lscpd >/dev/null 2>&1
|
||||||
|
if ! systemctl is-active --quiet lscpd 2>/dev/null; then
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart lscpd
|
||||||
|
fi
|
||||||
|
if ! systemctl is-active --quiet lscpd 2>/dev/null; then
|
||||||
|
log_warning "lscpd did not start. Run: systemctl status lscpd"
|
||||||
|
fi
|
||||||
|
systemctl restart fastapi_ssh_server 2>/dev/null || true
|
||||||
/usr/local/lsws/bin/lswsctrl stop >/dev/null 2>&1
|
/usr/local/lsws/bin/lswsctrl stop >/dev/null 2>&1
|
||||||
systemctl stop lsws >/dev/null 2>&1
|
systemctl stop lsws >/dev/null 2>&1
|
||||||
systemctl start lsws >/dev/null 2>&1
|
systemctl start lsws >/dev/null 2>&1
|
||||||
|
|||||||
@@ -1780,6 +1780,15 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
|||||||
result = open('/etc/lsb-release', 'r').read()
|
result = open('/etc/lsb-release', 'r').read()
|
||||||
if result.find('22.04') > -1 or result.find('24.04') > -1:
|
if result.find('22.04') > -1 or result.find('24.04') > -1:
|
||||||
lscpdSelection = 'lscpd.0.4.0'
|
lscpdSelection = 'lscpd.0.4.0'
|
||||||
|
# AlmaLinux/RHEL 9 and 10 need lscpd.0.4.0 (el9 binary works on el10)
|
||||||
|
cl_al_ver = FetchCloudLinuxAlmaVersionVersion()
|
||||||
|
if cl_al_ver in ('al-93', 'al-100'):
|
||||||
|
lscpdSelection = 'lscpd.0.4.0'
|
||||||
|
if os.path.exists('/etc/os-release'):
|
||||||
|
with open('/etc/os-release', 'r') as f:
|
||||||
|
osrel = f.read()
|
||||||
|
if ('VERSION_ID="9"' in osrel or 'VERSION_ID="10"' in osrel or 'VERSION_ID="9.' in osrel or 'VERSION_ID="10.' in osrel) and ('AlmaLinux' in osrel or 'Rocky' in osrel or 'Red Hat' in osrel or 'CentOS' in osrel):
|
||||||
|
lscpdSelection = 'lscpd.0.4.0'
|
||||||
else:
|
else:
|
||||||
lscpdSelection = 'lscpd.aarch64'
|
lscpdSelection = 'lscpd.aarch64'
|
||||||
|
|
||||||
@@ -1790,6 +1799,12 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
|||||||
result = open('/etc/lsb-release', 'r').read()
|
result = open('/etc/lsb-release', 'r').read()
|
||||||
if result.find('22.04') > -1 or result.find('24.04') > -1:
|
if result.find('22.04') > -1 or result.find('24.04') > -1:
|
||||||
lscpdSelection = 'lscpd.0.4.0'
|
lscpdSelection = 'lscpd.0.4.0'
|
||||||
|
try:
|
||||||
|
cl_al_ver = FetchCloudLinuxAlmaVersionVersion()
|
||||||
|
if cl_al_ver in ('al-93', 'al-100'):
|
||||||
|
lscpdSelection = 'lscpd.0.4.0'
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}'
|
command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}'
|
||||||
@@ -2021,8 +2036,18 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
|||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
|
command = 'systemctl daemon-reload'
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
command = 'systemctl start lscpd'
|
command = 'systemctl start lscpd'
|
||||||
# preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
ret = preFlightsChecks.call(command, self.distro, command, command, 0, 0, os.EX_OSERR)
|
||||||
|
if ret != 0:
|
||||||
|
preFlightsChecks.stdOut("LSCPD start failed, reloading systemd and retrying...")
|
||||||
|
logging.InstallLog.writeToFile("LSCPD first start failed, retrying after daemon-reload")
|
||||||
|
preFlightsChecks.call('systemctl daemon-reload', self.distro, 'daemon-reload', 'daemon-reload', 1, 0, os.EX_OSERR)
|
||||||
|
ret = preFlightsChecks.call('systemctl start lscpd', self.distro, 'systemctl start lscpd', 'systemctl start lscpd', 0, 0, os.EX_OSERR)
|
||||||
|
if ret != 0:
|
||||||
|
preFlightsChecks.stdOut("[WARNING] LSCPD may not have started. Run: systemctl status lscpd")
|
||||||
|
logging.InstallLog.writeToFile("[WARNING] LSCPD start failed after retry - run systemctl status lscpd")
|
||||||
|
|
||||||
preFlightsChecks.stdOut("LSCPD Daemon Set!")
|
preFlightsChecks.stdOut("LSCPD Daemon Set!")
|
||||||
|
|
||||||
|
|||||||
@@ -971,7 +971,13 @@ wget -O requirements.txt https://raw.githubusercontent.com/usmannasir/cyberpanel
|
|||||||
pip3.6 install --ignore-installed -r requirements.txt
|
pip3.6 install --ignore-installed -r requirements.txt
|
||||||
# Install python-dotenv for loading .env file (critical for AlmaLinux 8)
|
# Install python-dotenv for loading .env file (critical for AlmaLinux 8)
|
||||||
pip3.6 install python-dotenv
|
pip3.6 install python-dotenv
|
||||||
systemctl restart lscpd
|
systemctl daemon-reload 2>/dev/null || true
|
||||||
|
systemctl restart lscpd 2>/dev/null || true
|
||||||
|
if ! systemctl is-active --quiet lscpd 2>/dev/null; then
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart lscpd
|
||||||
|
fi
|
||||||
|
systemctl restart fastapi_ssh_server 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for version in $(ls /usr/local/lsws | grep lsphp);
|
for version in $(ls /usr/local/lsws | grep lsphp);
|
||||||
@@ -1027,7 +1033,13 @@ ELAPSED="$(($SECONDS / 3600)) hrs $((($SECONDS / 60) % 60)) min $(($SECONDS % 60
|
|||||||
MYSQLPASSWD=$(cat /etc/cyberpanel/mysqlPassword)
|
MYSQLPASSWD=$(cat /etc/cyberpanel/mysqlPassword)
|
||||||
echo "$ADMIN_PASS" > /etc/cyberpanel/adminPass
|
echo "$ADMIN_PASS" > /etc/cyberpanel/adminPass
|
||||||
/usr/local/CyberPanel/bin/python2 /usr/local/CyberCP/plogical/adminPass.py --password $ADMIN_PASS
|
/usr/local/CyberPanel/bin/python2 /usr/local/CyberCP/plogical/adminPass.py --password $ADMIN_PASS
|
||||||
systemctl restart lscpd
|
systemctl daemon-reload 2>/dev/null || true
|
||||||
|
systemctl restart lscpd 2>/dev/null || true
|
||||||
|
if ! systemctl is-active --quiet lscpd 2>/dev/null; then
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart lscpd
|
||||||
|
fi
|
||||||
|
systemctl restart fastapi_ssh_server 2>/dev/null || true
|
||||||
systemctl restart lsws
|
systemctl restart lsws
|
||||||
echo "/usr/local/CyberPanel/bin/python2 /usr/local/CyberCP/plogical/adminPass.py --password \"\$@\"" > /usr/bin/adminPass
|
echo "/usr/local/CyberPanel/bin/python2 /usr/local/CyberCP/plogical/adminPass.py --password \"\$@\"" > /usr/bin/adminPass
|
||||||
echo "systemctl restart lscpd" >> /usr/bin/adminPass
|
echo "systemctl restart lscpd" >> /usr/bin/adminPass
|
||||||
|
|||||||
Reference in New Issue
Block a user