• 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.
    • Tom ElliottT
      Tom Elliott
      last edited by

      I don’t understand the problem.

      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

      ch3iC 1 Reply Last reply Reply Quote 0
      • ch3iC
        ch3i Moderator @Tom Elliott
        last edited by

        @Tom-Elliott said:

        I don’t understand the problem.

        He have custom sharings in his “exports” file which are overwrite after each FOG update, I think lol

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

          Still don’t understand.

          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
          • O
            olivierl
            last edited by

            When i do an install or udapte fog it’s make a new exports file and i 've some share on my dev server and i have to edit the exports file after each update (it’s not really a probleme just a question).

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

              Can you be more specific? I’m not understanding.

              What export file is being erased?

              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
              • O
                olivierl
                last edited by

                When i run the installer the file etc/exports is replaced by the following entries:

                /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)

                all other entries was deleted.

                I’m sorry, I’m struggling to make me understand.I don’t speak english very well

                Oliver

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

                  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

                  ch3iC 1 Reply Last reply Reply Quote 0
                  • ch3iC
                    ch3i Moderator @Sebastian Roth
                    last edited by ch3i

                    @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
                    • Wayne WorkmanW
                      Wayne Workman
                      last edited by

                      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

                        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

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

                          Olivier

                          Wayne WorkmanW 1 Reply Last reply Reply Quote 2
                          • Tom ElliottT
                            Tom Elliott
                            last edited by

                            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

                            ch3iC 1 Reply Last reply Reply Quote 0
                            • Wayne WorkmanW
                              Wayne Workman
                              last edited by

                              @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/

                              ch3iC 1 Reply Last reply Reply Quote 0
                              • ch3iC
                                ch3i Moderator @Tom Elliott
                                last edited by

                                @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 $?
                                }
                                
                                Tom ElliottT 1 Reply Last reply Reply Quote 0
                                • ch3iC
                                  ch3i Moderator @Wayne Workman
                                  last edited by

                                  @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
                                  • Tom ElliottT
                                    Tom Elliott @ch3i
                                    last edited by

                                    @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

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

                                      @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
                                      • ch3iC
                                        ch3i Moderator @Tom Elliott
                                        last edited by

                                        @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

                                          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
                                          • Wayne WorkmanW
                                            Wayne Workman @olivierl
                                            last edited by

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

                                            192

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project