Create a new boottask hook

  • Hi,
    This is a followup ticket

    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

  • @Tom-Elliott

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

    Thank you

  • 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

  • @Tom-Elliott
    Tom any updates?

    Thank you

  • 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

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

    Thank you

  • @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





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