The last attempt to update cPanel & WHM was blocked - Workaround
]Would you please post the steps to the solution that Chris provided for you?
Please keep in mind that this should be considered a last resort to get things going. The long-term goal should be to provision a new server with an appropriate disk partitioning scheme and migrate. Here's the steps that I provided, slightly modified for further clarification: Moving /usr/local/cpanel to another location 1) Ensure that there are no "immutable" files under /usr/local/cpanel that will cause the directory move to fail. The cPanel software does not require or use immutable file attributes:
chattr -f -R -i -a /usr/local/cpanel2) Ensure that you don't have any SSH or console terminals open that have a current working directory under /usr/local/cpanel. If there are, simply change the shell to use another working directory, such as "cd /root". 3) Shut down all WHM/cPanel services and the cron service. We do not want any services to automatically start that may open a file under /usr/local/cpanel:
service cpanel stop
service crond stop
service exim stop
service httpd stop
killall leechprotect4) At this point, if your server isn't running any unusual services, no processes should have a file open under the /usr/local/cpanel path, which can be verified by running "lsof | grep /usr/local/cpanel" and it should return no output:
lsof | grep /usr/local/cpanelIf it does print anything then you'll want to stop the service or kill the process listed. Some third-party software may also keep files open under this path and those services would need to be stopped. 5) Create the new base path where you're going to move the cpanel directory:
mkdir -p /home/usr/local6) Run lsof one more time to make sure it doesn't print anything and then move the directory:
lsof | grep /usr/local/cpanel
mv /usr/local/cpanel /home/usr/local/cpanel7) Ensure that the move completed without errors and that the "/usr/local/cpanel" directory no longer exists. 8) Create an empty /usr/local/cpanel directory with correct permissions:
mkdir /usr/local/cpanel
chmod 711 /usr/local/cpanel9) Make a backup of /etc/fstab, and then add a bind-mount entry to mount /home/usr/local/cpanel on /usr/local/cpanel:
cp /etc/fstab /etc/fstab.bak
echo "/home/usr/local/cpanel /usr/local/cpanel none rw,bind 0 0" >> /etc/fstab10) Check /etc/fstab and compare it to the backup, you should see the original /etc/fstab contents with the following line added at the bottom:
/home/usr/local/cpanel /usr/local/cpanel none rw,bind 0 011) Mount the directory, then perform a directory listing to make sure you see the usual contents of /usr/local/cpanel there:
mount /usr/local/cpanel
ls /usr/local/cpanel12) Reboot the server. This will ensure that any stale CageFS or VirtFS filesystem mounts are cleared, restarts any services that were stopped, and most importantly will test the /etc/fstab entry during the boot process to make sure it will work, so that there will not be any surprises in the future. Be prepared to perform maintenance via the server console if a problem with /etc/fstab causes the boot process to fail. That's it. Continue to reference "/usr/local/cpanel" in any custom code you may write (pretend "/home/usr/local/cpanel" doesn't exist). The use of a bind-mount rather than a symlink should ensure that everything works as if the files were located under the original path.
-
That's a bit drastic IMO. cPanel is now suggesting if this isn't working on your server to open a ticket.. YMMV
I have same problems with DNS Only cPanel server. How can I open ticket?0 -
Hello, The issue reported here happens on servers where the "STAGING_DIR=" entry in /etc/cpupdate.conf is removed during the upcp process (e.g. cPanel versions 11.46.0.0 through 11.46.3.1 and 11.48.1.2). The removal of the entry prevents the definition of the staging directory and blocks updates. Internal case number 181689 is open to address this issue, but you can run the following command in the meantime as a temporary workaround: echo 'STAGING_DIR=/home' >> /etc/cpupdate.conf ; chattr +i /etc/cpupdate.conf ; /scripts/upcp ; chattr -i /etc/cpupdate.conf
Note this command assumes you want to use /home as the staging directory. Thank you.0
Please sign in to leave a comment.
Comments
32 comments