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

    Screwed up fog.man.reg in init.xz

    Scheduled Pinned Locked Moved
    FOG Problems
    3
    15
    3.1k
    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.
    • fry_pF
      fry_p Moderator
      last edited by

      Hey everyone,
      I made a rash decision and ended up messing up the fog.man.reg file in my init.xz (no backup, I’m a moron) whilst trying to remove some superfluous options (like primary user). I know there is a way to do it using post init scripts, but I don’t even know what post init scripts are 😞

      I guess I’d like to know my options. Is there a way to regenerate this file? Like running the install again?

      Thanks!

      Like open source community computing? Why not do it for a good cause?
      Use your computer/server for humanitarian projects when it is idle!
      https://join.worldcommunitygrid.org?recruiterId=1026912

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

        You can rerun the installer or just download the inits again. Either way. I’ll grab the inits link in a second.

        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 george1421

          wget -P /var/www/html/fog/service/ipxe/ https://fogproject.org/inits/init.xz
          wget -P /var/www/html/fog/service/ipxe/ https://fogproject.org/inits/init_32.xz

          There is another post that is doing the same thing (minus the afu of the registration script).
          Ref: https://forums.fogproject.org/topic/9754/custom-full-host-registration-for-1-3-4 I still owe the OP of that thread a little time to understand why the post init scripts are not running as they should.

          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 1
          • JunkhackerJ
            Junkhacker Developer
            last edited by

            also, if you just need the original to compare against, to find your mistake, you can find it here:
            https://github.com/FOGProject/fogproject/tree/master/src/buildroot/package/fog/scripts/bin

            signature:
            Junkhacker
            We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

            1 Reply Last reply Reply Quote 0
            • fry_pF
              fry_p Moderator
              last edited by

              Thanks, you guys rule. I’ll try again later, but for now, it is back to the default

              Like open source community computing? Why not do it for a good cause?
              Use your computer/server for humanitarian projects when it is idle!
              https://join.worldcommunitygrid.org?recruiterId=1026912

              1 Reply Last reply Reply Quote 0
              • fry_pF
                fry_p Moderator
                last edited by

                Sorry for the double post, but I got the registration items I wanted to remove removed. My next task (if possible) is to change something so the “Would you like this host to join AD” and the “Would you like to deploy an image now” would be hidden as well but they should always be set to “yes”. If that makes any sense.

                Like open source community computing? Why not do it for a good cause?
                Use your computer/server for humanitarian projects when it is idle!
                https://join.worldcommunitygrid.org?recruiterId=1026912

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

                  @fry_p While I haven’t look at the script in a while, I assume the questions just set a variable with y or n. So hide the question and then set the default for the variable. That sounds doable.

                  Great job so far!

                  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!

                  fry_pF 1 Reply Last reply Reply Quote 0
                  • fry_pF
                    fry_p Moderator @george1421
                    last edited by

                    @george1421 I changed my mind on automatically saying yes to deploying an image. However, I still want an auto-yes for joining AD. I can’t seem to find where I would set the variable to force a yes. Would you guys take a peek at https://github.com/FOGProject/fogproject/blob/master/src/buildroot/package/fog/scripts/bin/fog.man.reg
                    and tell me where I can force this? Thanks, I’m lousy at coding.

                    Like open source community computing? Why not do it for a good cause?
                    Use your computer/server for humanitarian projects when it is idle!
                    https://join.worldcommunitygrid.org?recruiterId=1026912

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

                      @fry_p

                      This is the section in question starting at line 245

                      while [[ -z $askme ]]; do
                          echo -n "    Would you like this host to join a domain, (using default settings)? (y/N) "
                          read askme
                          case $askme in
                              [Nn]|[Nn][Oo]|"")
                                  askme="N"
                                  ;;
                              [Yy]|[Yy][Ee][Ss])
                                  blDoAD=$(echo -n 1 | base64)
                                  askme="Y"
                                  ;;
                              *)
                                  askme=""
                                  echo " * Invalid input, please try again"
                                  ;;
                          esac
                      done
                      

                      I might tweak it this way (to cause as little damage as possible)

                      while [[ -z $askme ]]; do
                          # echo -n "    Would you like this host to join a domain, (using default settings)? (y/N) "
                          # read askme
                      
                          # force the answer to be Yes, always
                          askme="Y"
                          case $askme in
                              [Nn]|[Nn][Oo]|"")
                                  askme="N"
                                  ;;
                              [Yy]|[Yy][Ee][Ss])
                                  blDoAD=$(echo -n 1 | base64)
                                  askme="Y"
                                  ;;
                              *)
                                  askme=""
                                  echo " * Invalid input, please try again"
                                  ;;
                          esac
                      done
                      

                      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!

                      fry_pF 1 Reply Last reply Reply Quote 2
                      • fry_pF
                        fry_p Moderator @george1421
                        last edited by

                        @george1421 That worked perfectly, thank you! So it is the way I want it. I don’t do RC’s for the time being because I need it to be stable, but when a new stable version comes out, I go for it. My question is will an upgrade replace my custom init?

                        Like open source community computing? Why not do it for a good cause?
                        Use your computer/server for humanitarian projects when it is idle!
                        https://join.worldcommunitygrid.org?recruiterId=1026912

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

                          @fry_p said in Screwed up fog.man.reg in init.xz:

                          My question is will an upgrade replace my custom init?

                          The short answer is yes. You can either take a diff (linux application) of the changes between original and your fixed version and then apply that to the new version or just manually edit the new version.

                          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!

                          fry_pF 1 Reply Last reply Reply Quote 0
                          • fry_pF
                            fry_p Moderator @george1421
                            last edited by

                            @george1421 I use a script for auto updating to stable versions once a week. I added an rsync -ccommand to copy my init.xz to the /var/www/html/fog/service/ipxe folder based on checksum. It appears to work. I’ll let you guys know if I run into any trouble.

                            Like open source community computing? Why not do it for a good cause?
                            Use your computer/server for humanitarian projects when it is idle!
                            https://join.worldcommunitygrid.org?recruiterId=1026912

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

                              @fry_p Ok that will work.

                              We are also (in the other thread) working out a way to dynamic replace the init’s fog.reg.man file with a patched one so you don’t need to keep messing with the inits. The down side is if the original one gets changed as new features are added then your off-line one will be out of sync with production.

                              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!

                              fry_pF 1 Reply Last reply Reply Quote 0
                              • fry_pF
                                fry_p Moderator @george1421
                                last edited by

                                @george1421 I will most likely try post init scripts eventually for that reason. I saw your post on the other thread and it honestly looks easier than what I did lol. I’m burned out today, plus I just got the thing working 🙂

                                Like open source community computing? Why not do it for a good cause?
                                Use your computer/server for humanitarian projects when it is idle!
                                https://join.worldcommunitygrid.org?recruiterId=1026912

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

                                  @fry_p Your current efforts has not gone to waste. When the other method is proven, you will just move your patched fog.mag.reg to the fog server postinits directory and add in the postinit scripts to copy it over each time. What you have created to day will work just fine moving forward, you just won’t have to unpack and repack the inits after each change.

                                  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 1
                                  • 1 / 1
                                  • First post
                                    Last post

                                  186

                                  Online

                                  12.1k

                                  Users

                                  17.3k

                                  Topics

                                  155.3k

                                  Posts
                                  Copyright © 2012-2024 FOG Project