Hi Community,
I have encountered two recurring compatibility issues when upgrading CyberPanel on servers running Imunify360. I've identified both issues, and workarounds have been successfully tested on production servers without requiring an operating system reboot.
I am sharing these findings to help other CyberPanel administrators and, hopefully, assist the development team in implementing a permanent upstream fix. I am also keeping notes for my team at Mena Web Agency.
Environment
- Ubuntu 22.04 LTS and Ubuntu 24.04 LTS
- CyberPanel 3.0.21
- LiteSpeed Enterprise
- Imunify360
- KernelCare
Bug #1 – CSF False Positive During CyberPanel Upgrade
Problem
The official CyberPanel upgrade command may fail on servers running Imunify360 because the upgrader incorrectly identifies an existing /etc/csf directory as a ConfigServer Firewall installation.
The current detection logic includes:
[[ -e /etc/csf || -L /etc/csf ]] || return 0
However, Imunify360's firewall package can own this directory even when CSF is not installed.
Verification
Run the following commands:
ls -lah /etc/csf
dpkg-query -S '/etc/csf*'
command -v csf lfd
systemctl is-active csf lfd
systemctl is-active imunify360 imunify360-webshield
In our case, package ownership returned:
imunify360-firewall: /etc/csf
imunify360-firewall: /etc/csf/imunify_allow.conf
Additional findings:
- The
/etc/csfdirectory was empty. - No CSF or LFD executables were present.
- CSF and LFD services were inactive.
- Imunify360 and WebShield were active.
The existence of /etc/csf alone is therefore insufficient to establish that CSF is installed.
Tested Workaround
We implemented a guarded local upgrade wrapper that recognizes the verified Imunify360-owned directory and adjusts the relevant CSF detection checks in the downloaded CyberPanel shell and Python upgrade scripts.
The wrapper verifies package ownership, directory contents, CSF/LFD executables, service status, and active Imunify360 protection before permitting the upgrade.
This workaround has successfully completed multiple CyberPanel upgrades without removing Imunify360 or permanently deleting /etc/csf.
Recommended Permanent Solution
Update both the shell and Python CSF detection logic to distinguish an actual CSF installation from an Imunify360-owned compatibility directory.
The detection should consider:
- Package ownership of
/etc/csf. - Presence of a valid
/etc/csf/csf.conf. - Presence of CSF and LFD executables.
- Presence of CSF installation libraries.
- CSF and LFD service status.
- Imunify360 service status.
The existing migration safeguards should remain in place for genuine CSF installations and ambiguous configurations.
Simply deleting /etc/csf is not recommended because it belongs to Imunify360 and may be recreated during package maintenance.
Bug #2 – Imunify360 Dashboard Permission Denied After Upgrade
Problem
Following a successful CyberPanel upgrade, the Imunify360 dashboard may display:
Can't connect to agent. Check php part of application.
The accompanying error is:
sh: 1: /usr/local/CyberCP/public/imunify/classes/panels/../../bin/execute.py: Permission denied
Imunify360 and WebShield may remain active despite the dashboard being inaccessible.
Root Cause
The Python helper has incorrect execution permissions.
Verify the permissions:
stat -c '%a %A %U:%G %n' \
/usr/local/CyberCP/public/imunify/bin/execute.py
In our case, the file had permission mode 744 instead of 755.
The upgrader reported that chmod +x completed successfully. However, when the user class is omitted, this command is affected by the process umask. A restrictive umask can prevent the necessary group and other execution permissions from being applied.
Solution
Explicitly set the correct permissions:
chmod 755 /usr/local/CyberCP/public/imunify/bin/execute.py
Verify:
stat -c '%a %A %U:%G %n' \
/usr/local/CyberCP/public/imunify/bin/execute.py
Expected result:
755 -rwxr-xr-x root:root /usr/local/CyberCP/public/imunify/bin/execute.py
Refresh the Imunify360 dashboard.
In our testing, this immediately restored dashboard functionality without restarting any services.
Recommended Permanent Solution
Replace the existing chmod +x operation for this helper with:
chmod 755 /usr/local/CyberCP/public/imunify/bin/execute.py
Additionally, verify the resulting numeric permission mode rather than relying solely on the command's exit status.
Conclusion
Both workarounds tested successfully on production CyberPanel servers.
- No operating system reboots.
- No unnecessary firewall changes.
- No Imunify360 uninstallation.
- No permanent removal of package-owned directories.
- No new failed systemd services.
Hopefully, these findings will help other CyberPanel administrators experiencing similar issues.
A permanent correction to these two issues would allow administrators running Imunify360 to continue using the standard CyberPanel upgrade command without additional compatibility workarounds.
Thank you to Usman and the CyberPanel development team for their continued work on the platform.
- Mena Web Agency aka MWA