Ignore:
Timestamp:
Sep 9, 2009, 8:30:47 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Change NFS support into a NetFS support to allow for multiple protocol in addition to NFS (NEEDS TESTING)
  • Better logging to detect a potential nuke issue
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c

    r2242 r2380  
    614614    }
    615615
    616     if (bkpinfo->backup_media_type == nfs) {
    617         log_msg(2, "Mounting for NFS thingy");
     616    if (bkpinfo->backup_media_type == netfs) {
     617        log_msg(2, "Mounting for Network thingy");
    618618        log_msg(2, "isodir = %s", bkpinfo->isodir);
    619619        if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
     
    624624#ifdef __FreeBSD__
    625625        sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
    626             bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     626            bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    627627        mddev = make_vn(mount_cmd);
    628628        sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    629629#else
    630630        sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s",
    631             bkpinfo->isodir, bkpinfo->nfs_remote_dir,
     631            bkpinfo->isodir, bkpinfo->netfs_remote_dir,
    632632            bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    633633#endif
     
    805805            strcpy(bkpinfo->prefix,STD_PREFIX);
    806806    }
    807 } else if (!strcmp(value, "nfs")) {
    808     bkpinfo->backup_media_type = nfs;
     807} else if (!strcmp(value, "netfs")) {
     808    bkpinfo->backup_media_type = netfs;
    809809    bkpinfo->please_dont_eject = TRUE;
    810810    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
     
    816816       ("cat /proc/cmdline"), "pxe")) {
    817817        /* We need to override prefix value in PXE mode as it's
    818         * already done in start-nfs */
     818        * already done in start-netfs */
    819819        envtmp1 = getenv("imgname");
    820820        if (envtmp1 == NULL) {
     
    961961}
    962962
    963 if (bkpinfo->backup_media_type == nfs) {
     963if (bkpinfo->backup_media_type == netfs) {
    964964    if (!cfgf) {
    965         log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    966         log_msg(2, "nfs_remote_dir remains %s",
    967                 bkpinfo->nfs_remote_dir);
     965        log_msg(2, "netfs_mount remains %s", bkpinfo->netfs_mount);
     966        log_msg(2, "netfs_remote_dir remains %s",
     967                bkpinfo->netfs_remote_dir);
    968968        log_msg(2,
    969969                "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    970970    } else {
    971         read_cfg_var(g_mondo_cfg_file, "nfs-server-mount",
    972                     bkpinfo->nfs_mount);
    973         read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
    974                     bkpinfo->nfs_remote_dir);
    975         log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
    976         log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
     971        read_cfg_var(g_mondo_cfg_file, "netfs-server-mount",
     972                    bkpinfo->netfs_mount);
     973        read_cfg_var(g_mondo_cfg_file, "netfs-server-path",
     974                    bkpinfo->netfs_remote_dir);
     975        log_msg(2, "netfs_mount is %s", bkpinfo->netfs_mount);
     976        log_msg(2, "netfs_proto is %s", bkpinfo->netfs_proto);
     977        log_msg(2, "netfs_remote_dir is %s", bkpinfo->netfs_remote_dir);
    977978    }
    978979    if (strstr(call_program_and_get_last_line_of_output
    979980        ("cat /proc/cmdline"), "pxe")) {
    980981        /* We need to override values in PXE mode as it's
    981         * already done in start-nfs */
    982         envtmp1 = getenv("nfsmount");
     982        * already done in start-netfs */
     983        envtmp1 = getenv("netfsmount");
    983984        if (envtmp1 == NULL) {
    984             fatal_error("no nfsmount variable in environment");
     985            fatal_error("no netfsmount variable in environment");
    985986        }
    986987        envtmp2 = getenv("dirimg");
     
    988989            fatal_error("no dirimg variable in environment");
    989990        }
    990         strcpy(bkpinfo->nfs_mount,envtmp1);
    991         strcpy(bkpinfo->nfs_remote_dir,envtmp2);
     991        strcpy(bkpinfo->netfs_mount,envtmp1);
     992        strcpy(bkpinfo->netfs_remote_dir,envtmp2);
    992993    }
    993994} else if (bkpinfo->backup_media_type == iso) {
Note: See TracChangeset for help on using the changeset viewer.