Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Remove a Hook manually

Discussion in 'cPanel Developers' started by jimlongo, Oct 30, 2018.

Tags:
  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    234
    Likes Received:
    15
    Trophy Points:
    68
    given that I've been developing for a while this module, and there are hooks that are no longer relevant and weren't removed properly at the time, I'd like to clean up the hooks registry manually.

    Given that I have this
    Code:
    [root@whm1 ~]# /usr/local/cpanel/bin/manage_hooks list
    Whostmgr:
        Accounts::change_package:
            id: Gu0sr_inAsLJuErsvlZh8HFi
            exectype: script
            weight: 100
            hook: /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --changePackage
            stage: post
            escalateprivs: 0
            --
    
    How would I remove that? I keep getting this error
    Code:
    [root@whm1 ~]# /usr/local/cpanel/bin/manage_hooks delete --manual hook /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php  --category Whostmgr --event 'Accounts::change_package' --stage post
    No matching hooks found
    

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @jimlongo,

    Here's the command you'd use:

    Code:
    /usr/local/cpanel/bin/manage_hooks delete script /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --manual --category Whostmgr --event 'Accounts::change_package' --stage post
    Let me know if that helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    234
    Likes Received:
    15
    Trophy Points:
    68
    Thanks Michael, but I still get the same result.
    No matching hooks found
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @jimlongo,

    It looks like the command in the hook you are attempting to delete uses a flag, so you'd need to use a command like this to delete it:

    Code:
    /usr/local/cpanel/bin/manage_hooks delete script "/usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --changePackage" --manual --category Whostmgr --event 'Accounts::change_package' --stage post 
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    jimlongo likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice