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

erase of Exports File

Scheduled Pinned Locked Moved Solved
General
5
21
6.9k
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.
  • S
    Sebastian Roth Moderator
    last edited by Oct 16, 2015, 1:18 PM

    Yes, the installer script creates a new empty (overwrites) exports-file. It’s not easy to write fail-proof script code that checks to see if other entries (or old FOG entries) are in that file. So we better create a clean new one. If you have a good idea how to better do this you are more than welcome to give us a hint.

    Please make a backup copy of your file before running the installer. @Tom-Elliott Well, maybe we should do that like we do with /tftpboot…

    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

    C 1 Reply Last reply Oct 16, 2015, 1:21 PM Reply Quote 0
    • C
      ch3i Moderator @Sebastian Roth
      last edited by ch3i Oct 16, 2015, 7:22 AM Oct 16, 2015, 1:21 PM

      @Uncle-Frank said:

      Yes, the installer script creates a new empty (overwrites) exports-file. It’s not easy to write fail-proof script code that checks to see if other entries (or old FOG entries) are in that file. So we better create a clean new one. If you have a good idea how to better do this you are more than welcome to give us a hint.

      Please make a backup copy of your file before running the installer. @Tom-Elliott Well, maybe we should do that like we do with /tftpboot…

      Maybe use comments before/after the fog exports, like that :

      /custom/config1
      
      #FOG settings
      /images *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)
      /images/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
      #END FOG settings
      
      /custom/config2
      

      On each update store all other lines not in these comments 😉

      1 Reply Last reply Reply Quote 1
      • W
        Wayne Workman
        last edited by Oct 16, 2015, 3:33 PM

        How about having the installer move any existing file to /etc/exports.old ?

        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!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        1 Reply Last reply Reply Quote 1
        • O
          olivierl
          last edited by olivierl Oct 19, 2015, 4:04 AM Oct 19, 2015, 10:03 AM

          Hi
          In your script before add share it can be this

          if [ -f $nfsconfig ]
              then
                        if  [ $(grep -c "##FOG-SHARE-START##" $nfsconfig) -ne 0 ]
                             then
                                      sed -in  '/##FOG-SHARE-START##/,/##FOG-END-SHARE##/{//d;D}' $nfsconfig
                        fi
          fi
          

          And add this configureNFS()

          echo -e "##FOG-SHARE-START##\n$storageLocation *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)\n$storageLocation/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)\n##FOG-END-SHARE##" >> "$nfsconfig";
          

          I am not tested for the moment

          Olivier

          1 Reply Last reply Reply Quote 2
          • O
            olivierl
            last edited by Oct 20, 2015, 7:38 AM

            Hi
            I have tested this norming and it’s worrking for my case.

            Olivier

            W 1 Reply Last reply Oct 21, 2015, 12:17 PM Reply Quote 2
            • T
              Tom Elliott
              last edited by Oct 20, 2015, 6:51 PM

              What’s the actual code?

              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

              C 1 Reply Last reply Oct 21, 2015, 7:28 AM Reply Quote 0
              • W
                Wayne Workman
                last edited by Oct 21, 2015, 1:23 AM

                @Tom-Elliott has added a new option in /opt/fog/.fogsettings

                blexports=

                1 means to rebuild /etc/exports
                0 means do not rebuild it.

                https://forums.fogproject.org/topic/5975/dhcpd-conf-file-gets-rebuilt-on-every-install

                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!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                C 1 Reply Last reply Oct 21, 2015, 7:30 AM Reply Quote 0
                • C
                  ch3i Moderator @Tom Elliott
                  last edited by Oct 21, 2015, 7:28 AM

                  @Tom-Elliott In lib/common/functions.sh

                  configureNFS() {
                      echo -e "$storageLocation *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)\n$storageLocation/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)" > "$nfsconfig";
                      dots "Setting up and starting RPCBind";
                      if [ "$systemctl" == "yes" ]; then
                          systemctl enable rpcbind.service >/dev/null 2>&1 && \
                          systemctl restart rpcbind.service >/dev/null 2>&1 && \
                          systemctl status rpcbind.service >/dev/null 2>&1
                      elif [ "$osid" -eq 2 ]; then
                          true
                      else
                          chkconfig rpcbind on >/dev/null 2>&1 && \
                          $initdpath/rpcbind restart >/dev/null 2>&1 && \
                          $initdpath/rpcbind status >/dev/null 2>&1
                      fi
                      errorStat $?
                      dots "Setting up and starting NFS Server..."
                      for nfsItem in $nfsservice; do
                          if [ "$systemctl" == "yes" ]; then
                              systemctl enable $nfsItem >/dev/null 2>&1 && \
                              systemctl restart $nfsItem >/dev/null 2>&1 && \
                              systemctl status $nfsItem >/dev/null 2>&1
                          else
                              if [ "$osid" == 2 ]; then
                                  sysv-rc-conf $nfsItem on >/dev/null 2>&1 && \
                                  $initdpath/nfs-kernel-server stop >/dev/null 2>&1 && \
                                  $initdpath/nfs-kernel-server start >/dev/null 2>&1
                              else
                                  chkconfig $nfsItem on >/dev/null 2>&1 && \
                                  $initdpath/$nfsItem restart >/dev/null 2>&1 && \
                                  $initdpath/$nfsItem status >/dev/null 2>&1
                              fi
                          fi
                          if [ "$?" -eq 0 ]; then
                              break
                          fi
                      done
                      errorStat $?
                  }
                  
                  T 1 Reply Last reply Oct 21, 2015, 9:20 AM Reply Quote 0
                  • C
                    ch3i Moderator @Wayne Workman
                    last edited by Oct 21, 2015, 7:30 AM

                    @Wayne-Workman said:

                    @Tom-Elliott has added a new option in /opt/fog/.fogsettings

                    blexports=

                    1 means to rebuild /etc/exports
                    0 means do not rebuild it.

                    https://forums.fogproject.org/topic/5975/dhcpd-conf-file-gets-rebuilt-on-every-install

                    It’ll be better to have it automatically in the installer like the @olivierl solution.

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott @ch3i
                      last edited by Oct 21, 2015, 9:20 AM

                      @ch3i much appreciated but I meant the code for the sed statement not the function code that needs to be altered.

                      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

                      C 1 Reply Last reply Oct 21, 2015, 10:35 AM Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by Oct 21, 2015, 9:56 AM

                        @Tom-Elliott Code snippet was provided by olivierl in this thread (post number 11).

                        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
                        • C
                          ch3i Moderator @Tom Elliott
                          last edited by Oct 21, 2015, 10:35 AM

                          @Tom-Elliott said:

                          @ch3i much appreciated but I meant the code for the sed statement not the function code that needs to be altered.

                          https://forums.fogproject.org/topic/5952/erase-of-exports-file/11

                          1 Reply Last reply Reply Quote 0
                          • O
                            olivierl
                            last edited by Oct 21, 2015, 11:25 AM

                            Hi,

                            It’'s work but before use it i think i need to verify before if the line "/image and image/dev"exist
                            To make the transition from a version that does not contain ##Fog–share-start##
                            to avoid having 2 times sharing appear in the file

                            1 Reply Last reply Reply Quote 0
                            • W
                              Wayne Workman @olivierl
                              last edited by Oct 21, 2015, 12:17 PM

                              Oh now I see what @olivierl did here… added those tags to the top and bottom.

                              ##FOG-SHARE-START##
                              ##FOG-END-SHARE##

                              That’s pretty smart.

                              But I don’t think the new blexports setting should be undone, but I think that this could be added…
                              In fact something similar is not a bad idea for all of the conf files that fog touches…

                              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!
                              Daily Clean Installation Results:
                              https://fogtesting.fogproject.us/
                              FOG Reporting:
                              https://fog-external-reporting-results.fogproject.us/

                              1 Reply Last reply Reply Quote 0
                              • 1
                              • 2
                              • 1 / 2
                              1 / 2
                              • First post
                                17/21
                                Last post

                              162

                              Online

                              12.0k

                              Users

                              17.3k

                              Topics

                              155.2k

                              Posts
                              Copyright © 2012-2024 FOG Project