How to prevent changes to existing /etc/exports file



  • 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 ?


  • Senior Developer

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


  • Moderator

    @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



  • 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
    

  • Senior Developer

    @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 ).


  • Moderator

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


  • Moderator

    @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



  • 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"
    

  • Senior Developer

    @sudburr I don’t know what the argument is I just know that there is one.



  • -E did not work. It modified it anyways.


  • Senior Developer

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



  • 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


Log in to reply
 

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.