Create a new boottask hook



  • Hi,
    This is a followup ticket
    https://forums.fogproject.org/topic/7448/adding-custom-task-to-fog-server

    Original ticket is resolved. Now I am trying to create the same boottask for multiple OS installations. As per the Tom’s instructions

    1. Created a new file “boottasktrusty.hook.php” copy of “boottask.hook.php”

    2. Updated the class name, $name and $Tastype to new name.

    root@fogsrv:/var/www/fog/lib/hooks# sdiff -s boottask.hook.php boottasktrusty.hook.php
    class BootTask extends Hook { | class BootTaskTrusty extends Hook {
    public $name = ‘BootTask’; | public $name = ‘BootTaskTrusty’;
    public $active = False; | public $active = True;

    When trying to pxe install. It complains on “Unknown reqeust type NULL” . Do I need to add the new file name anywhere else?

    Thank you
    Chakri



  • @Tom-Elliott

    That resolved the issue. Thank you so much for the time. Please resolve this ticket.

    Thank you
    Chakri


  • Senior Developer

    @csa The hooks work on a register. So if the register part isn’t aligned the hook won’t interact with anything.

    Normally, the last line or lines of the file contain the register examples. My guess is they’re referencing the old class names?



  • @Tom-Elliott

    Morning Tom,
    I Also noticed one more thing.

    1. Any changes made within the “boottask.hook.php” are working. I was able to install different flavor of OS by changing the caller name.

    2. Looks like the application is only looking for file name “boottask.hook.php”.

    Thank you
    Chakri



  • @Tom-Elliott
    Tom any updates?

    Thank you
    Chakri



  • Tom,
    The default boottask.hook.php works without any issues. The new one fails still. Any ideas?

    From the error logs 
    [06-03-16 3:36:04 pm]  * No tasks found!
    From the console 
    Fatal Error : Uknown request type : : Null
    

    root@fogsrv:/var/www/html/fog/lib/hooks# diff boottask.hook.php boottasktrusty.hook.php
    2,3c2,3

    <     public $name = 'BootTask';
    ---
    > class BootTasktrusty extends Hook {
    >     public $name = 'BootTasktrusty';
    9c9
    <         $TaskType = self::getClass('TaskType')->set('name','trusty-install')->load('name');
    ---
    >         $TaskType = self::getClass('TaskType')->set('name','trusty123-install')->load('name');
    

    Thank you
    Chakri



  • @Tom-Elliott
    Didn’t understand. What is the fix? Do you have few minutes to chat?


  • Senior Developer

    Your hook is not enacting properly.


Log in to reply
 

394
Online

39.3k
Users

11.0k
Topics

104.6k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.