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

How to prevent changes to existing /etc/exports file

Scheduled Pinned Locked Moved Solved
FOG Problems
4
12
2.5k
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
    sudburr
    last edited by Nov 28, 2016, 3:54 PM

    Server
    • FOG Version: RC26
    • OS: CentOS 7.2.1511
    Client
    • Service Version: n/a
    • OS: n/a
    Description

    Is there a way to prevent the FOG installer from overwriting an existing /etc/exports file ?

    [ Standing in between extinction in the cold and explosive radiating growth ]

    W 1 Reply Last reply Nov 29, 2016, 3:02 AM Reply Quote 0
    • T
      Tom Elliott @sudburr
      last edited by Dec 2, 2016, 2:32 AM

      @sudburr what you performed is correct, if you already had a prior config laid out. Sorry I didn’t recognize this sooner but a fix for this has been added to the next working branch.

      Essentially the variable was being set properly, but it was being overwritten when the fog settings file was imported.

      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 1
      • X
        x23piracy
        last edited by Nov 28, 2016, 5:30 PM

        if not may think about making it unaccessible by the installer before updating and making it writeable again when succeeded (chmod), another may could making a backup before installing and overwriting by yourself after updating (post install script).

        Regards X23

        ║▌║█║▌│║▌║▌█

        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott
          last edited by Nov 28, 2016, 5:36 PM

          If I recall correctly, add the -E argument to the installer.

          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

          W 1 Reply Last reply Nov 29, 2016, 3:06 AM Reply Quote 0
          • S
            sudburr
            last edited by Nov 28, 2016, 6:01 PM

            -E did not work. It modified it anyways.

            [ Standing in between extinction in the cold and explosive radiating growth ]

            T 1 Reply Last reply Nov 28, 2016, 7:17 PM Reply Quote 0
            • T
              Tom Elliott @sudburr
              last edited by Nov 28, 2016, 7:17 PM

              @sudburr I don’t know what the argument is I just know that there is 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! 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
              • X
                x23piracy
                last edited by x23piracy Nov 28, 2016, 1:32 PM Nov 28, 2016, 7:31 PM

                Maybe this?

                help() {
                    echo -e "Usage: $0 [-h?dEUuHSCKYXT] [-f <filename>]"
                    echo -e "\t\t[-D </directory/to/document/root/>] [-c <sslPath>]"
                    echo -e "\t\t[-W <webroot/to/fog/after/docroot/>] [-B </backup/path/>]"
                    echo -e "\t\t[-s <192.168.1.10>] [-e <192.168.1.254>] [-b <undionly.kpxe>]"
                    echo -e "\t-h -? --help\t\t\tDisplay this info"
                    echo -e "\t-o    --oldcopy\t\t\tCopy back old data"
                    echo -e "\t-d    --no-defaults\t\tDon't guess defaults"
                    echo -e "\t-U    --no-upgrade\t\tDon't attempt to upgrade"
                    echo -e "\t-H    --no-htmldoc\t\tNo htmldoc, means no PDFs"
                    echo -e "\t-S    --force-https\t\tForce HTTPS redirect"
                    echo -e "\t-C    --recreate-CA\t\tRecreate the CA Keys"
                    echo -e "\t-K    --recreate-keys\t\tRecreate the SSL Keys"
                    echo -e "\t-Y -y --autoaccept\t\tAuto accept defaults and install"
                    echo -e "\t-f    --file\t\t\tUse different update file"
                    echo -e "\t-c    --ssl-file\t\tSpecify the ssl path"
                    echo -e "\t               \t\t\t\tdefaults to /opt/fog/snapins/ssl"
                    echo -e "\t-D    --docroot\t\t\tSpecify the Apache Docroot for fog"
                    echo -e "\t               \t\t\t\tdefaults to OS DocumentRoot"
                    echo -e "\t-W    --webroot\t\t\tSpecify the web root url want fog to use"
                    echo -e "\t            \t\t\t\t(E.G. http://127.0.0.1/fog,"
                    echo -e "\t            \t\t\t\t      http://127.0.0.1/)"
                    echo -e "\t            \t\t\t\tDefaults to /fog/"
                    echo -e "\t-B    --backuppath\t\tSpecify the backup path"
                    echo -e "\t      --uninstall\t\tUninstall FOG"
                    echo -e "\t-s    --startrange\t\tDHCP Start range"
                    echo -e "\t-e    --endrange\t\tDHCP End range"
                    echo -e "\t-b    --bootfile\t\tDHCP Boot file"
                    echo -e "\t-E    --no-exportbuild\t\tSkip building nfs file"
                    echo -e "\t-X    --exitFail\t\tDo not exit if item fails"
                    echo -e "\t-T    --no-tftpbuild\t\tDo not rebuild the tftpd config file"
                    echo -e "\t-P    --no-pxedefault\t\tDo not overwrite pxe default file"
                

                ║▌║█║▌│║▌║▌█

                1 Reply Last reply Reply Quote 0
                • W
                  Wayne Workman @sudburr
                  last edited by Wayne Workman Nov 28, 2016, 9:03 PM Nov 29, 2016, 3:02 AM

                  @sudburr

                  Inside of /opt/fog/.fogsettings

                  Set:
                  blexports='0'

                  This should stop the installer from overwriting an existing installation’s exports file.
                  Reference: https://wiki.fogproject.org/wiki/index.php?title=.fogsettings

                  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
                  • W
                    Wayne Workman @Tom Elliott
                    last edited by Nov 29, 2016, 3:06 AM

                    @Tom-Elliott said in How to prevent changes to existing /etc/exports file:

                    If I recall correctly, add the -E argument to the installer.

                    In addition to my below post as a valid option, Tom is correct here too. In the help menu this is specified:

                    -E    --no-exportbuild		Skip building nfs file
                    

                    So if that’s not working, this should be moved to bug reports.

                    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/

                    T 1 Reply Last reply Nov 29, 2016, 11:13 AM Reply Quote 0
                    • T
                      Tom Elliott @Wayne Workman
                      last edited by Nov 29, 2016, 11:13 AM

                      @Wayne-Workman It’s working.

                      I just tested on Ubuntu and Fedora.

                      The base code this is working for seems to be working since before RC 20 (I didn’t really feel like testing earlier than that 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
                      • S
                        sudburr
                        last edited by Dec 1, 2016, 5:11 PM

                        Re-testing with RC27.

                        Using the installer with switch -E does not work. /etc/exports is still changed.

                        Changing to blexports=‘0’ correctly blocks the installer from changing /etc/exports .

                        sed -i.bak "s|blexports='1'|blexports='0'|g" /opt/fog/.fogsettings
                        

                        [ Standing in between extinction in the cold and explosive radiating growth ]

                        W T 2 Replies Last reply Dec 2, 2016, 12:30 AM Reply Quote 0
                        • W
                          Wayne Workman @sudburr
                          last edited by Wayne Workman Dec 1, 2016, 6:32 PM Dec 2, 2016, 12:30 AM

                          @sudburr said in How to prevent changes to existing /etc/exports file:

                          Using the installer with switch -E does not work. /etc/exports is still changed.

                          I just tired and confirmed this with RC-27, I’ll open a bug report.

                          https://forums.fogproject.org/topic/9050/fog-installer-e-argument-not-working

                          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
                          • T
                            Tom Elliott @sudburr
                            last edited by Dec 2, 2016, 2:32 AM

                            @sudburr what you performed is correct, if you already had a prior config laid out. Sorry I didn’t recognize this sooner but a fix for this has been added to the next working branch.

                            Essentially the variable was being set properly, but it was being overwritten when the fog settings file was imported.

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

                            181

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project