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

    udhcpc: sending discover

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    pic
    5
    23
    12.4k
    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 @tech49
      last edited by george1421

      @tech49 What version of FOG are you using?

      I don’t have a step by step because this is a bit more advanced function than beginners should approach. But if you unpack the inits it will create a directory structure that mirrors the virtual hard drive. You can than traverse that directory. You can edit the file using the host OS gui editor if you are using a gui based OS like ubuntu. Or you can edit the file using a character based editor. vi is the most common but also the most cryptic to use.

      I’ll go through the steps with vi to show you at least how to edit.

      You will need to navigate to the etc/init.d directory where the inits were unpacked to.
      vi S40Network
      Use the down arrow to find the line with udhcp there will be more stuff after but you want the line with the text that starts out as udhcp. At the beginning of the line key in
      i to insert mode
      cr for a new line
      esc key to edit insert mode
      up arrow to go to the inserted blank line
      i to enter insert mode
      space over until cursor is just above the u in udhcp then key in
      sleep 27
      esc to exit insert mode
      :wq colon write quit

      That will drop you back to the linux command prompt. Go back up to the root of where you unpacked the inits and then repack them back into init.xz

      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!

      T 1 Reply Last reply Reply Quote 0
      • T
        tech49 @george1421
        last edited by tech49

        @george1421 Thanks, I’m using fog 1.5.7 on Ubuntu 18 LTS

        for notes reasons this is what I did. I was unable to open it in VI for some reason. The screen was blank, SO I did a sudo gedit and opened it up in the text editor software. This is what I did for the sleep 27 line.

         for retry in $(seq 3); do
               sleep 27
               /sbin/udhcpc -i $iface --now
        

        About to give this puppy a whirl. Will let you know if it worked.

        T 1 Reply Last reply Reply Quote 0
        • T
          tech49 @tech49
          last edited by

          @tech49 No go 😞

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @george1421 @tech49 Shouldn’t it be:

            for retry in $(seq 3); do
                   sleep 27
                   /sbin/udhcpc -i $iface --now
            done
            

            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

            T 2 Replies Last reply Reply Quote 1
            • T
              tech49 @Sebastian Roth
              last edited by

              @Sebastian-Roth Oh no, I was just typing in the little bit of it freehanded described in the instruction and guide. I’m not sure if there’s a done there or not. I will check asap.

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

                @tech49 The other thing I would recommend is that you add an echo statement just above the sleep 27 like echo "Sleeping for a bit"; to be sure that the code is executing like we think. Let me go and get the github page so we can be sure.

                The other thing is to (with the fog delivered inits) pxe boot into debug mode and then key in /sbin/udhcpc -i $iface --now replacing $iface with the name of your physical network adapter collected with the ip addr show command.

                This is the line in question https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network#L38, where the echo and sleep command needs to be inserted.

                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!

                T 2 Replies Last reply Reply Quote 0
                • T
                  tech49 @Sebastian Roth
                  last edited by

                  @Sebastian-Roth

                  Wait till the interface is fully up and ready (spanning tree)

                  timeout=0
                  linkstate=0
                  until [[ $linkstate -eq 1 || $timeout -ge 35 ]]; do
                      let timeout+=1
                      linkstate=$(/bin/cat /sys/class/net/$iface/carrier)
                      [[ $linkstate -eq 0 ]] && sleep 1 || break
                  done
                  [[ $linkstate -eq 0 ]] && echo "No link detected on $iface for $timeout seconds, skipping it." && continue
                  for retry in $(seq 3); do
                      sleep 27
                      /sbin/udhcpc -i $iface --now
                      ustat="$?"
                      curl -Ikfso /dev/null "${web}"/index.php --connect-timeout 5
                      cstat="$?"
                      # If the udhcp is okay AND we can curl our web
                      # we know we have link so no need to continue on.
                      # NOTE: the link to web is kind of important, just
                      # exiting on dhcp request is not sufficient.
                      [[ $ustat -eq 0 && $cstat -eq 0 ]] && exit 0
                      echo "Either DHCP failed or we were unable to access ${web}/index.php for connection testing."
                      sleep 1
                  done
                  echo "No DHCP response on interface $iface, skipping it."
                  

                  done

                  If we end up here something went wrong as we do exit the script as soon as we get an IP

                  1 Reply Last reply Reply Quote 0
                  • T
                    tech49 @george1421
                    last edited by

                    @george1421 How do I pxeboot into debug mode?

                    george1421G 1 Reply Last reply Reply Quote 0
                    • T
                      tech49 @george1421
                      last edited by

                      @george1421 Is it worth modifying anything in init_32.xz?

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

                        @tech49 said in udhcpc: sending discover:

                        @george1421 How do I pxeboot into debug mode?

                        When you schedule a task (capture or deploy) before you hit the schedule task button tick the debug checkbox. Then pxe boot the target computer.

                        The idea with this route is to manually wait the 27 seconds before manually issuing the udhcp command. Your issue may be totally different if time doesn’t fix the dhcp issue (i.e. your computer uses one of the new realtek nic chip sets) .

                        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!

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

                          @tech49 said in udhcpc: sending discover:

                          @george1421 Is it worth modifying anything in init_32.xz?

                          Not unless you are working with 32 bit hardware (not likely now days)

                          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
                          • T
                            tech49 @george1421
                            last edited by

                            @george1421
                            Ok, I entered in the Echo line and repackaged the file with the guide on the wiki.

                            The echo command did not work. I saw nothing saying “Sleeping for a bit”

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

                              @tech49 What version of FOG are you using? Oh I see it never mind. Let me do this to the inits.

                              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
                                last edited by

                                OK here is the modified init: https://drive.google.com/open?id=1ZDLcftq_yx3c0BiIAVhNwwpn2j-gDzCE

                                If this fails to print the sleep 27 we will need a screen shot of what you see when it fails because it should print the waiting a bit .

                                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!

                                T 2 Replies Last reply Reply Quote 0
                                • T
                                  tech49 @george1421
                                  last edited by tech49

                                  @george1421 No echos seen

                                  I saved the file to my desktop and did sudo cp -r /home/username/desktop /var/www/fog/…/ipxe… I browsed to it on the GUI and confirmed on properties it was modified the time id id so.

                                  The output I got after a quick host registration was
                                  populating .dev: done
                                  initializing random number done
                                  starting haveged: ok
                                  starting enp1so interface and waiting fof the link to come up
                                  udhcpc: started v1.29.3
                                  udhcpc: sending discover
                                  udhcpc: sending discover
                                  udhcpc: sending discover
                                  udhcpc: no lease, failing
                                  Either DHCP failed or we were unable to access http://fogserveripaddress/fog//index.php for connection testing.
                                  repeat 3 times
                                  No DHCP respawn on interface enp1s0 , skipping it.
                                  failed to get an ip via dhcp, tried on interfaces enp1s0

                                  Note: I’m using a laptop for the fog server , Dell latitude e5420 Bios: LegacyBoot Secure off
                                  I’m trying to do a Quick or Full host registration on a Dell Optiplex 3050. Bios: Uefi on SecureBoot on

                                  Both confirmed pxe on

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    tech49 @george1421
                                    last edited by tech49

                                    @george1421 I got it to work! I plugged a dumb switch inbetween the managed ciscos and the PC i was trying to pxe boot. I’m thinking there is a power saving issue setup that keeps it from powering on

                                    Now here’s another problem.

                                    When its at
                                    *Start host registration
                                    *Enter hostname for this computer:

                                    I’m going to reinstall fog from scratch i think

                                    I cannot type anything !!!

                                    Much love to you developers who have helped this linux noob out with this problem. It’s been super educational ❤

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

                                      @tech49 said in udhcpc: sending discover:

                                      I plugged a dumb switch inbetween the managed ciscos and the PC i was trying to pxe boot

                                      We have seen this condition as a spanning tree issue (not using one of the fast spanning tree protocols like portFast or RSTP. Also we see this condition with the green ethernet settings on the switch getting confused and powering off the port. Placing a dumb switch in between the building switch and the pxe booting computer keeps the building switch active while PXE hands off to iPXE and then iPXE hands off to FOS Linux. Every time this hand off happens it drops the ethernet link momentarily. The switch sees this as a disconnect/reconnect.

                                      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
                                      • Q
                                        Quazz Moderator @tech49
                                        last edited by

                                        @tech49 Please make a new thread for the new issue so we can help you there. (since it’s unrelated to the thread)

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

                                        218

                                        Online

                                        12.1k

                                        Users

                                        17.3k

                                        Topics

                                        155.3k

                                        Posts
                                        Copyright © 2012-2024 FOG Project