Skip to main content

[CPANEL-29847] Pkgacct::Restore hook not working?

Comments

8 comments

  • cPanelTJ
    Hi, Sparek. Do you see that your hook successfully registered when running /usr/local/cpanel/bin/manage_hooks list
    or in the Manage Hooks interface in WHM?
    0
  • sparek-3
    Yes. [font='courier new'>Pkgacct: Restore: hook: /var/cpanel/hooks/monitor_restore.php stage: post escalateprivs: 0 id: fDarP6RT5mAeXQ8uN2AvEOQq weight: 200 exectype: script
    0
  • cPanelTJ
    I was able to reproduce the same problem on my 84 testing environment. We will be doing additional testing tomorrow and I'll get back with a solution or workaround.
    0
  • cPanelTJ
    Sparek, After further testing, I do have some GOOD news. The Hook needs to be registered under PkgAcct::Restore
    , not Pkgacct::Restore
    . See the below output from debug mode: [2019-10-09 12:32:51 -0500] info [transfer_session] ---debug_hooks--- [2019-10-09 12:32:51 -0500] info [transfer_session] msg: Beginning execution of script hook. [2019-10-09 12:32:51 -0500] info [transfer_session] context: PkgAcct::Restore [2019-10-09 12:32:51 -0500] info [transfer_session] stage: post [2019-10-09 12:32:51 -0500] info [transfer_session] result: 0 [2019-10-09 12:32:51 -0500] info [transfer_session] point: main [2019-10-09 12:32:51 -0500] info [transfer_session] id: c6866781-a409-48ea-8106-50393bd5fbeb [2019-10-09 12:32:51 -0500] info [transfer_session] hook: /usr/local/cpanel/3rdparty/bin/PkgacctRestoreTest.php [2019-10-09 12:32:51 -0500] info [transfer_session] escalateprivs: 0 [2019-10-09 12:32:51 -0500] info [transfer_session] weight: 200
    We've also filed an internal case to provide proper validation for hookable events when registering action code.
    0
  • cPanelLauren
    Also for reference, the internal case I opened is - CPANEL-29847 - As usual we'll update here when it's resolved but do let us know if the change proposed by @cPanelTJ resolves the issue for you. Also, @sparek-3 did this function in previous versions of cPanel the way you have it configured now?
    0
  • sparek-3
    Indeed [font='courier new'>/usr/local/cpanel/bin/manage_hooks add script /var/cpanel/hooks/monitor_restore.php --manual --category=PkgAcct --event=Restore --stage=post does work. I'm not sure where I got Pkgacct from. Everything's pretty clear as day that this should be PkgAcct. Brain fart I guess.
    0
  • cPanelLauren
    Actually, @cPanelTJ and I were discussing it earlier and I think we both came to the conclusion that at the very least this should give you an error and it might be something contributing to frustrations using the hooks system. I am curious still if you had this added this way on any other servers previously (though it's sounding like you may not have)
    0
  • sparek-3
    No, I did not have any previous implementation of anything like this. So I can't speak to whether this used to work or what.
    0

Please sign in to leave a comment.