Create a new boottask hook
-
Hi,
This is a followup ticket
https://forums.fogproject.org/topic/7448/adding-custom-task-to-fog-serverOriginal ticket is resolved. Now I am trying to create the same boottask for multiple OS installations. As per the Tom’s instructions
-
Created a new file “boottasktrusty.hook.php” copy of “boottask.hook.php”
-
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 -
-
Your hook is not enacting properly.
-
@Tom-Elliott
Didn’t understand. What is the fix? Do you have few minutes to chat? -
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
Tom any updates?Thank you
Chakri -
Morning Tom,
I Also noticed one more thing.-
Any changes made within the “boottask.hook.php” are working. I was able to install different flavor of OS by changing the caller name.
-
Looks like the application is only looking for file name “boottask.hook.php”.
Thank you
Chakri -
-
@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?
-
That resolved the issue. Thank you so much for the time. Please resolve this ticket.
Thank you
Chakri