• BDIX
    • BDIX Shared Hosting
    • BDIX Reseller Hosting
    • Cheap BDIX VPS
    • BDIX NVME KVM VPS
    • BDIX NVMe Windows RDP
    • BDIX Windows VPS
  • Hosting
    • Singapore Web Hosting
    • WordPress Hosting
    • Cheap Shared Hosting
    • Turbo Hosting
  • Reseller Hosting
    • Singapore Reseller Hosting
    • USA Reseller Hosting
  • VPS Hosting
    • Cheap VPS
    • USA Survey RDP
    • USA VPS
    • Singapore VPS
    • Germany VPS
  • Domain
    • Register Domain
    • Transfer Domain
    • Domain Promos
Linkedin Twitter Youtube Facebook
  • support@prenhost.com
  • Hosting Flash Sale: Starting at $0.43/mo for a limited time
  • WhatsApp Support
  • Login
newph-transperent- newph-transperent-
  • BDIX
    • BDIX Shared Hosting
    • BDIX Reseller Hosting
    • Cheap BDIX VPS
    • BDIX NVME KVM VPS
    • BDIX NVMe Windows RDP
    • BDIX Windows VPS
  • Hosting
    • Singapore Web Hosting
    • WordPress Hosting
    • Cheap Shared Hosting
    • Turbo Hosting
  • Reseller Hosting
    • Singapore Reseller Hosting
    • USA Reseller Hosting
  • VPS Hosting
    • Cheap VPS
    • USA Survey RDP
    • USA VPS
    • Singapore VPS
    • Germany VPS
  • Domain
    • Register Domain
    • Transfer Domain
    • Domain Promos
Client Area
Client Area

Fixing CloudLinux Prekillacct Hook Error in WHM/cPanel

by sajibe
August 20, 2025
CloudLinux, WHM

At PrenHost, we often encounter unique system administration challenges when managing cPanel/WHM servers running on CloudLinux. Recently, we faced a common but frustrating issue: the removeacct command was failing due to a broken CloudLinux prekillacct hook.


The Problem

When attempting to remove a cPanel account, the process was denied by a CloudLinux hook:

/scripts/removeacct username

Failed to execute hook /usr/share/cloudlinux/hooks/cpanel/prekillacct
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/cloudlinux/hooks/listeners/wpos_user_dirs_hook.py'

The error indicated that a required listener (wpos_user_dirs_hook.py) was missing or misconfigured. This is part of AccelerateWP integration, which uses CloudLinux’s hook system.


The Root Cause

The symlink /usr/share/cloudlinux/hooks/listeners/wpos_user_dirs_hook.py pointed to a Python package inside CloudLinux’s virtual environment, but the file was either missing or the venv was out of sync. As a result, the hook script crashed, preventing account removal.


The Solution

After troubleshooting, we found the quickest and cleanest fix was to reinstall the required CloudLinux components:

yum reinstall accelerate-wp lve-utils
yum install accelerate-wp

These two commands:

  1. Reinstalled the AccelerateWP package, which restores missing hook listeners.
  2. Reinstalled lve-utils, ensuring CloudLinux utilities and dependencies were in sync.

After this, the missing file issue was resolved, and the prekillacct hook functioned correctly.


Final Steps

  1. Confirm the listener exists:
    ls -l /usr/share/cloudlinux/hooks/listeners/wpos_user_dirs_hook.py
    
  2. Verify that the hook imports cleanly:
    python3 -c "import importlib.util; p='/usr/share/cloudlinux/hooks/listeners/wpos_user_dirs_hook.py'; s=importlib.util.spec_from_file_location('wpos', p); m=importlib.util.module_from_spec(s); s.loader.exec_module(m); print('OK')"
    
  3. Re-run the account removal process.

Key Takeaway

If you run into CloudLinux prekillacct hook errors while removing accounts in WHM/cPanel, the fastest fix is to simply reinstall accelerate-wp and lve-utils. This restores missing hook files and gets your account management back on track.

At PrenHost, we document these fixes not only for our internal sysadmins but also to help the broader hosting community save valuable troubleshooting time.

Tags: CloudLinux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Fixing CloudLinux Prekillacct Hook Error in WHM/cPanel
  • Fixing “Cannot manage PHP versions when CageFS is disabled” on CloudLinux (cPanel/WHM)
  • Python Selector “IndexError: string index out of range” – Root Cause & Fix (CloudLinux Bug)
  • Fixing SSH Login Failure Due to Missing pam_imunify.so on CloudLinux Servers
  • Fixing Virtualizor Migration Issue: “Task Not Updated on Master from Last 30 Minutes”

Recent Comments

  1. MyBlog on Resolving Apache Startup Issue: ConditionPathExists=!/etc/apachedisable
Suite 10 Capital House, 61 Amhurst Road, London, E8 1LL, United Kingdom,

Company number 15697833

Payment Method
Company
  • About Us
  • News Feed
  • Affiliate Program
  • Knowledgebase
  • Client Area
  • Get in touch
Hosting
  • Singapore Hosting
  • BDIX Shared Hosting
  • WordPress Hosting
  • Cheap Hosting
  • USA Survey RDP
  • Cheap BDIX VPS
Software Hosting
  • OpenCart Hosting
  • Magento Hosting
  • LiteCart Hosting
  • PrestaShop Hosting
  • Moodle Hosting
  • POS Hosting
Join Our Newsletter

We’ll send you news and offers.

Social Media
Facebook-f Linkedin X-twitter Whatsapp

Copyright © 2018 - 2025 PrenHost. All Rights Reserved

Report Abuse/Spam | Terms of Services | Refund Policy | Privacy Policy | Server Status