• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Custom Full Host Registration for 1.3.4

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    3
    53
    26.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • george1421G
      george1421 Moderator @JGallo
      last edited by

      @JGallo Well the next step is for me to unpack the inits and see why not/what conditions are the postinst script are called. It was my understanding that they were called on every startup of the master fog script. I wasn’t aware there might be a conditional on the call. Give me a bit and I will have some time to check into this.

      I agree about the wiki update. What typically happens is that we will write a tutorial and then open discussion on the tutorial. Once the tutorial has been proven then the info is gleaned and move into the wiki. That way once it hits the wiki we know for sure it will work for people.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      J 1 Reply Last reply Reply Quote 0
      • J
        JGallo @george1421
        last edited by

        @george1421 I will take a look in there as well. I’m very curious now myself diving this deep in the Rabbit hole.

        george1421G 2 Replies Last reply Reply Quote 0
        • george1421G
          george1421 Moderator @JGallo
          last edited by

          @JGallo it may be in the funcs.sh (or what ever the name is) script too, if its not in /bin/fog directly.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @JGallo
            last edited by george1421

            @JGallo I just had a chance to debug the postinit scripts and they do run as advertised.

            I setup a debug capture.
            In the /images/dev/postinitscripts/fog.postinit on the FOG server, I just added a single line.

            dots "Testing postinit scripts"
            

            Then from the debug capture console on FOS, I entered fog
            on FOS I got

            Running post init scripts......
            Testing postinit scripts...
            Done...
            

            So that is telling me the master postinit script is being called by the fog startup scripts.

            In your post init scripts don’t forget if you have to reference your script path using the fog defined variable ${postinitpath}
            Such as:

            . ${postinitpath}fog.postinit
            

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            J 1 Reply Last reply Reply Quote 0
            • J
              JGallo @george1421
              last edited by

              @george1421 So what I need to figure out is why my fog.postinit script is not working. There is literally nothing in the postinit script other than the comments of what to change and basically the following:

              . ${postinitpath}fog.postselect

              I went ahead and tested a dots “Testing postinit scripts” and still the post init scripts are being skipped.

              I get the following everytime:

              *Running post init scripts…Skipped
              *Press [Enter] key to continue

              I do have the debug flags. So something is causing my postinitscript to be skipped. LOL

              george1421G 1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @JGallo
                last edited by george1421

                @JGallo So yours is saying skipped. In my case It ran.

                If you are running this from a putty shell (I guess even the console for that matter) Press Ctrl-C to break out of the script. At this point we need to understand why it skipped. There is a check in the first few lines of the /bin/fog script that tests the existence of a file/path (stating from memory) and if that doesn’t exist it will print skipped and continue on. That I think is your case. We need to understand why that conditional is causing the postinit to skip.

                I need to unpack the inits a work here to look at the code agian.

                unpack not needed. Ref: https://github.com/FOGProject/fogproject/blob/master/src/buildroot/package/fog/scripts/bin/fog

                recommendation, when you exit out after the skipped part. key in
                df -h
                and
                echo ${storage}

                and post the results. It looks like your mount may be failing.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                J 1 Reply Last reply Reply Quote 0
                • Tom ElliottT
                  Tom Elliott
                  last edited by

                  Mind trying this patch out? @george1421 Your method worked because you were in an “init” “imaging” needed tasking, but I think the problem is storage information was never passed for registration type tasks.

                  I’ve fixed this in the working group.

                  @jgallo please try:
                  wget -O /var/www/fog/lib/fog/bootmenu.class.php https://raw.githubusercontent.com/FOGProject/fogproject/3adec9a54254a9d466e129417f16163f396c358a/packages/web/lib/fog/bootmenu.class.php

                  This should replace your bootmenu with one that will insert the storage information based on the “web” interface it’s passing through.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  george1421G J 2 Replies Last reply Reply Quote 0
                  • george1421G
                    george1421 Moderator @Tom Elliott
                    last edited by

                    @Tom-Elliott said in Custom Full Host Registration for 1.3.4:

                    Your method worked because you were in an “init” “imaging” needed tasking,

                    True when I was debugging last night I was doing an debug capture. So of course it would have that variable set. Thanks for catching that one!

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    1 Reply Last reply Reply Quote 0
                    • J
                      JGallo @george1421
                      last edited by

                      @george1421 After I type in:

                      df -h

                      I get:

                      Filesystem
                      /dev/root

                      along with size, space used, etc. I assume this part must be in debug mode correct? I see Tom recommended something so I will give that a try as well.

                      1 Reply Last reply Reply Quote 0
                      • J
                        JGallo @Tom Elliott
                        last edited by

                        @Tom-Elliott So I got a chance to try the bootmenu link you posted and I get a chainlink error and could not boot: input/output error followed by the ipxe.org link. This is fixed by re-running the fog installer and then the ipxe booted normally. Not sure if I did that correctly but all I did was run that wget and it seemed like it downloaded the bootmenu.class.php.

                        george1421G 1 Reply Last reply Reply Quote 0
                        • george1421G
                          george1421 Moderator @JGallo
                          last edited by

                          @JGallo said in Custom Full Host Registration for 1.3.4:

                          I get a chainlink error and could not boot: input/output error followed by the ipxe.org link

                          What we need there is to capture this chainlink error. With that patched file installed call the following url from a browser and post the results here. http://<fog_server_ip>/fog/service/ipxe/boot.php?mac=00:00:00:00:00:00` That will provide us with the text that is used to create the iPXE boot menu.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                          J 1 Reply Last reply Reply Quote 0
                          • J
                            JGallo @george1421
                            last edited by

                            @george1421
                            #!ipxe
                            set fog-ip 10.170.200.20
                            set fog-webroot fog
                            set boot-url http://${fog-ip}/${fog-webroot}
                            cpuid --ext 29 && set arch x86_64 || set arch i386
                            iseq ${platform} efi && set key 0x1b || set key 0x1b
                            iseq ${platform} efi && set keyName ESC || set keyName Escape
                            prompt --key ${key} --timeout 3000 Booting… (Press ${keyName} to access the menu) && goto menuAccess || sanboot --no-describe --drive 0x80
                            :menuAccess
                            login
                            params
                            param mac0 ${net0/mac}
                            param arch ${arch}
                            param platform ${platform}
                            param username ${username}
                            param password ${password}
                            param menuaccess 1
                            param debug 1
                            isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme
                            isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme
                            :bootme
                            chain -ar http://10.170.200.20/fog/service/ipxe/boot.php##params

                            george1421G 1 Reply Last reply Reply Quote 0
                            • george1421G
                              george1421 Moderator @JGallo
                              last edited by george1421

                              @JGallo And this what you get when you call the boot.php file with the mac address I gave you?

                              If so can you tail the apache error log and see if php is throwing an error. This IS an incomplete iPXE menu, which means that something is wrong with that patched file.

                              The head of a valid ipxe menu should look like this:

                              #!ipxe
                              set fog-ip 192.168.1.53
                              set fog-webroot fog
                              set boot-url http://${fog-ip}/${fog-webroot}
                              cpuid --ext 29 && set arch x86_64 || set arch i386
                              goto get_console
                              :console_set
                              colour --rgb 0x00567a 1 ||
                              colour --rgb 0x00567a 2 ||
                              colour --rgb 0x00567a 4 ||
                              cpair --foreground 7 --background 2 2 ||
                              goto MENU
                              :alt_console
                              cpair --background 0 1 ||
                              cpair --background 1 2 ||
                              goto MENU
                              :get_console
                              console --picture http://192.168.1.53/fog/service/ipxe/bg.png --left 100 --right 80 && goto console_set || goto alt_console
                              :MENU
                              menu
                              colour --rgb 0x00567a 0 ||
                              cpair --foreground 1 1 ||
                              cpair --foreground 0 3 ||
                              cpair --foreground 4 4 ||
                              item --gap Host is unregistered
                              item --gap -- -------------------------------------
                              item fog.local Boot from hard disk
                              item fog.memtest Run Memtest86+
                              item fog.keyreg Update Product Key
                              item fog.deployimage Deploy Image
                              item fog.multijoin Join Multicast Session
                              item fog.quickdel Quick Host Deletion
                              item fog.sysinfo Client System Information (Compatibility)
                              

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                              J 1 Reply Last reply Reply Quote 0
                              • J
                                JGallo @george1421
                                last edited by

                                @george1421 That is what I get. I will try to tail the apache logs and see if anything I can get there. If I restore the the original boot.php file, should expect different results when calling the boot.php file with the mac address: 00:00:00:00:00:00?

                                george1421G 1 Reply Last reply Reply Quote 0
                                • george1421G
                                  george1421 Moderator @JGallo
                                  last edited by

                                  @JGallo I would expect your results to be similar to my (unpatched) results. You could always try mac address 00:00:00:00:00:01 if for some reason you have mac address 00:00:00:00:00:00 registered. The key is to pick a mac address that should not exist in your FOG server.

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                  J 1 Reply Last reply Reply Quote 0
                                  • J
                                    JGallo @george1421
                                    last edited by george1421

                                    @george1421 Here is what I got from the Apache2 error logs:

                                    Mon Apr 03 07:35:02.274680 2017] [mpm_prefork:notice] [pid 29017] AH00163: Apache/2.4.25 (Ubuntu) OpenSSL/1.0.2k configured – resuming normal operations
                                    [Mon Apr 03 07:35:02.274758 2017] [core:notice] [pid 29017] AH00094: Command line: ‘/usr/sbin/apache2’
                                    [Mon Apr 03 07:53:37.005326 2017] [php7:error] [pid 32151] [client 10.170.75.39:54182] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:04:43.824595 2017] [php7:error] [pid 32177] [client 10.170.75.145:9807] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:05:16.450267 2017] [php7:error] [pid 32148] [client 10.170.75.145:49460] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:07:51.285042 2017] [php7:error] [pid 32147] [client 10.170.75.39:22602] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:08:12.152556 2017] [mpm_prefork:notice] [pid 29017] AH00169: caught SIGTERM, shutting down
                                    [Mon Apr 03 08:08:24.966309 2017] [mpm_prefork:notice] [pid 1000] AH00163: Apache/2.4.25 (Ubuntu) OpenSSL/1.0.2k configured – resuming normal operations
                                    [Mon Apr 03 08:08:24.966502 2017] [core:notice] [pid 1000] AH00094: Command line: ‘/usr/sbin/apache2’
                                    [Mon Apr 03 08:09:45.609312 2017] [php7:error] [pid 1021] [client 10.170.75.39:5052] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:25:26.514047 2017] [php7:error] [pid 2705] [client 10.170.75.159:18805] PHP Fatal error: Uncaught Error: Call to undefined method BootMenu::attemptLogin() in /var/www/fog/lib/fog/bootmenu.class.php:1168\nStack trace:\n#0 /var/www/fog/lib/fog/bootmenu.class.php(398): BootMenu->verifyCreds()\n#1 /var/www/fog/service/ipxe/boot.php(35): BootMenu->__construct(Object(Host))\n#2 {main}\n thrown in /var/www/fog/lib/fog/bootmenu.class.php on line 1168
                                    [Mon Apr 03 08:31:42.110324 2017] [mpm_prefork:notice] [pid 1000] AH00169: caught SIGTERM, shutting down
                                    [Mon Apr 03 08:31:54.914304 2017] [mpm_prefork:notice] [pid 1032] AH00163: Apache/2.4.25 (Ubuntu) OpenSSL/1.0.2k configured – resuming normal operations
                                    [Mon Apr 03 08:31:54.914503 2017] [core:notice] [pid 1032] AH00094: Command line: ‘/usr/sbin/apache2’
                                    
                                    george1421G 1 Reply Last reply Reply Quote 0
                                    • george1421G
                                      george1421 Moderator @JGallo
                                      last edited by george1421

                                      @JGallo It looks like line 1168 is causing the error in the patched boot menu file.

                                      From DM: The OP is also using the ldap plugin too. Only worth mentioning since the error being thrown is referencing attemptLogin().

                                      [editor note] I fixed the previous thread to include the error log in a code block for easier review[end note]

                                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                      1 Reply Last reply Reply Quote 0
                                      • Tom ElliottT
                                        Tom Elliott
                                        last edited by

                                        I’m sorry, you’ll need to install the working branch then. I’ve moved attemptLogin to fogbase now and it appears the changes I suggested, I overlooked that change sorry.

                                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                        1 Reply Last reply Reply Quote 0
                                        • Tom ElliottT
                                          Tom Elliott
                                          last edited by

                                          So I pushed up RC-2 for 1.4.0 in a semi-official manner rather than have you jump directly on working branch.

                                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                          J 1 Reply Last reply Reply Quote 0
                                          • J
                                            JGallo @Tom Elliott
                                            last edited by

                                            @Tom-Elliott Thank you. I went ahead and updated to 1.4.0-rc-2 and it seems like like post init scripts are running because I get a message that says Patching registration files and eventually states that it’s Done Patching Registration files. Unfortunately it’s not copying the file I have set up to copy. So we know that the post init scripts are running. Not sure if the copy script is working because when testing a host by trying to do a full register of a host I still get asked questions I removed from my custom fog.man.reg

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post

                                            179

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project