Changeset 1108 in MondoRescue


Ignore:
Timestamp:
Feb 8, 2007, 12:10:16 AM (17 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg for main files

Location:
branches/stable/mondo/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondoarchive/main.c

    r1102 r1108  
    6161void welcome_to_mondoarchive()
    6262{
    63     log_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",
     63    mr_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",
    6464            PACKAGE_VERSION);
    65     log_msg(0, "running on %s architecture", get_architecture());
    66     log_msg(0,
     65    mr_msg(0, "running on %s architecture", get_architecture());
     66    mr_msg(0,
    6767            "-----------------------------------------------------------");
    68     log_msg(0,
     68    mr_msg(0,
    6969            "NB: Mondo logs almost everything, so don't panic if you see");
    70     log_msg(0,
     70    mr_msg(0,
    7171            "some error messages.  Please read them carefully before you");
    72     log_msg(0,
     72    mr_msg(0,
    7373            "decide to break out in a cold sweat.    Despite (or perhaps");
    74     log_msg(0,
     74    mr_msg(0,
    7575            "because of) the wealth of messages. some users are inclined");
    76     log_msg(0,
     76    mr_msg(0,
    7777            "to stop reading this log. If Mondo stopped for some reason,");
    78     log_msg(0,
     78    mr_msg(0,
    7979            "chances are it's detailed here.  More than likely there's a");
    80     log_msg(0,
     80    mr_msg(0,
    8181            "message at the very end of this log that will tell you what");
    82     log_msg(0,
     82    mr_msg(0,
    8383            "is wrong. Please read it!                          -Devteam");
    84     log_msg(0,
     84    mr_msg(0,
    8585            "-----------------------------------------------------------");
    8686
    87     log_msg(0, "Zero...");
    88     log_msg(1, "One...");
    89     log_msg(2, "Two...");
    90     log_msg(3, "Three...");
    91     log_msg(4, "Four...");
    92     log_msg(5, "Five...");
    93     log_msg(6, "Six...");
    94     log_msg(7, "Seven...");
    95     log_msg(8, "Eight...");
     87    mr_msg(0, "Zero...");
     88    mr_msg(1, "One...");
     89    mr_msg(2, "Two...");
     90    mr_msg(3, "Three...");
     91    mr_msg(4, "Four...");
     92    mr_msg(5, "Five...");
     93    mr_msg(6, "Six...");
     94    mr_msg(7, "Seven...");
     95    mr_msg(8, "Eight...");
    9696    printf("See %s for details of backup run.\n", MONDO_LOGFILE);
    9797}
     
    106106void distro_specific_kludges_at_start_of_mondoarchive()
    107107{
    108     log_msg(2, "Unmounting old ramdisks if necessary");
     108    mr_msg(2, "Unmounting old ramdisks if necessary");
    109109    stop_magicdev_if_necessary();   // for RH+Gnome users
    110110    run_program_and_log_output
     
    124124{
    125125//  char tmp[500];
    126     log_msg(2, "Restarting magicdev if necessary");
     126    mr_msg(2, "Restarting magicdev if necessary");
    127127    sync();
    128128    restart_magicdev_if_necessary();    // for RH+Gnome users
    129129
    130     log_msg(2, "Restarting autofs if necessary");
     130    mr_msg(2, "Restarting autofs if necessary");
    131131    sync();
    132132    //  restart_autofs_if_necessary(); // for Xandros users
    133133
    134     log_msg(2, "Restarting supermounts if necessary");
     134    mr_msg(2, "Restarting supermounts if necessary");
    135135    sync();
    136136    remount_supermounts_if_necessary(); // for Mandrake users
    137137
    138     log_msg(2, "Unmounting /boot if necessary");
     138    mr_msg(2, "Unmounting /boot if necessary");
    139139    sync();
    140140    unmount_boot_if_necessary();    // for Gentoo users
    141141
    142 //  log_msg( 2, "Cleaning up KDE desktop");
     142//  mr_msg( 2, "Cleaning up KDE desktop");
    143143//  clean_up_KDE_desktop_if_necessary();
    144144}
     
    189189    /* initialize log file with time stamp */
    190190    unlink(MONDO_LOGFILE);
    191     log_msg(0, "Time started: %s", mr_date());
     191    mr_msg(0, "Time started: %s", mr_date());
    192192
    193193    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     
    215215    /* Configure the bkpinfo structure, global file paths, etc. */
    216216    g_main_pid = getpid();
    217     log_msg(9, "This");
     217    mr_msg(9, "This");
    218218
    219219    register_pid(g_main_pid, "mondo");
     
    221221    run_program_and_log_output("dmesg -n1", TRUE);
    222222
    223     log_msg(9, "Next");
     223    mr_msg(9, "Next");
    224224    welcome_to_mondoarchive();
    225225    distro_specific_kludges_at_start_of_mondoarchive();
     
    340340                ("Errors were detected in the command line you supplied.\n");
    341341            printf("Please review the log file - " MONDO_LOGFILE "\n");
    342             log_msg(1, "Mondoarchive will now exit.");
     342            mr_msg(1, "Mondoarchive will now exit.");
    343343            finish(1);
    344344        }
     
    410410                ("Type 'less /tmp/changed.files' to see which files don't match the archives");
    411411        } else {
    412             log_msg(1,
     412            mr_msg(1,
    413413                    "Type 'less /tmp/changed.files' to see which files don't match the archives");
    414             log_msg(2, "Calling popup_changelist_from_file()");
     414            mr_msg(2, "Calling popup_changelist_from_file()");
    415415            popup_changelist_from_file("/tmp/changed.files");
    416             log_msg(2, "Returned from popup_changelist_from_file()");
     416            mr_msg(2, "Returned from popup_changelist_from_file()");
    417417        }
    418418    } else {
     
    447447
    448448    if (!g_cdrom_drive_is_here) {
    449         log_msg(10, "FYI, g_cdrom_drive_is_here was never used");
     449        mr_msg(10, "FYI, g_cdrom_drive_is_here was never used");
    450450    }
    451451    if (!g_dvd_drive_is_here) {
    452         log_msg(10, "FYI, g_dvd_drive_is_here was never used");
     452        mr_msg(10, "FYI, g_dvd_drive_is_here was never used");
    453453    }
    454454
    455455    /* finalize log file with time stamp */
    456     log_msg(0, "Time finished: %s", mr_date());
     456    mr_msg(0, "Time finished: %s", mr_date());
    457457
    458458    if (!g_text_mode) {
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1080 r1108  
    109109    {
    110110*/
    111     log_msg(3, "Switches:-");
     111    mr_msg(3, "Switches:-");
    112112    for (i = 0; i < 128; i++) {
    113113        if (flag_set[i]) {
    114114            sprintf(tmp, "-%c %s", i, flag_val[i]);
    115             log_msg(3, tmp);
     115            mr_msg(3, tmp);
    116116        }
    117117    }
     
    162162        sprintf(comment, "media_size[%d] = %ld", j,
    163163                bkpinfo->media_size[j]);
    164         log_msg(3, comment);
     164        mr_msg(3, comment);
    165165    }
    166166    for (; j <= MAX_NOOF_MEDIA; j++) {
     
    170170    for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    171171        if (bkpinfo->media_size[j] <= 0) {
    172             log_msg(1, "You gave media #%d an invalid size\n", j);
     172            mr_msg(1, "You gave media #%d an invalid size\n", j);
    173173            return (-1);
    174174        }
     
    253253        if (find_home_of_exe("star")) {
    254254            flag_set['R'] = TRUE;
    255             log_msg(1, "Using star instead of afio");
     255            mr_msg(1, "Using star instead of afio");
    256256        } else {
    257257            fatal_error
     
    284284    if (flag_set['I']) {
    285285        if (!strcmp(bkpinfo->include_paths, "/")) {
    286             log_msg(2, "'/' is pleonastic.");
     286            mr_msg(2, "'/' is pleonastic.");
    287287            bkpinfo->include_paths[0] = '\0';
    288288        }
     
    300300                *q = '\0';
    301301                if (stat(p, &buf) != 0) {
    302                     log_msg(1, "ERROR ! %s doesn't exist", p);
     302                    mr_msg(1, "ERROR ! %s doesn't exist", p);
    303303                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    304304                }
     
    306306            } else {
    307307                if (stat(p, &buf) != 0) {
    308                     log_msg(1, "ERROR ! %s doesn't exist", p);
     308                    mr_msg(1, "ERROR ! %s doesn't exist", p);
    309309                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    310310                }
     
    317317                flag_val['I'],
    318318                4*MAX_STR_LEN - strlen(bkpinfo->include_paths));
    319         log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     319        mr_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
    320320        if (bkpinfo->include_paths[0] == '-') {
    321321            retval++;
     
    374374            }
    375375        } else {
    376             log_msg(3, "flag_val['c'] = %s", flag_val['c']);
    377             log_msg(3, "flag_val['w'] = %s", flag_val['w']);
    378 //    log_msg(3, "flag_set['r'] = %i", flag_set['r'] );
     376            mr_msg(3, "flag_val['c'] = %s", flag_val['c']);
     377            mr_msg(3, "flag_val['w'] = %s", flag_val['w']);
     378//    mr_msg(3, "flag_set['r'] = %i", flag_set['r'] );
    379379            if (flag_set['c']) {
    380380                bkpinfo->cdrw_speed = atoi(flag_val['c']);
     
    502502            log_to_screen("NFS share is not mounted. Please mount it.\n");
    503503        }
    504         log_msg(3, "mount = %s", bkpinfo->nfs_mount);
    505         log_msg(3, "isodir= %s", bkpinfo->isodir);
     504        mr_msg(3, "mount = %s", bkpinfo->nfs_mount);
     505        mr_msg(3, "isodir= %s", bkpinfo->isodir);
    506506    }
    507507    if (flag_set['c']) {
     
    568568                /* End of bug fix */
    569569                if (stat(p, &buf) != 0) {
    570                     log_msg(1, "WARNING ! %s doesn't exist", p);
     570                    mr_msg(1, "WARNING ! %s doesn't exist", p);
    571571                }
    572572                p = q+1 ;
    573573            } else {
    574574                if (stat(p, &buf) != 0) {
    575                     log_msg(1, "WARNING ! %s doesn't exist", p);
     575                    mr_msg(1, "WARNING ! %s doesn't exist", p);
    576576                }
    577577                p = NULL;
     
    595595        }
    596596        strncat(bkpinfo->exclude_paths, psz, MAX_STR_LEN);
    597         log_msg(3, "-N means we're now excluding %s",
     597        mr_msg(3, "-N means we're now excluding %s",
    598598                bkpinfo->exclude_paths);
    599599    }
     
    604604    if (flag_set['b']) {
    605605        strcpy(psz, flag_val['b']);
    606         log_msg(1, "psz = '%s'", psz);
     606        mr_msg(1, "psz = '%s'", psz);
    607607        if (psz[strlen(psz) - 1] == 'k') {
    608608            psz[strlen(psz) - 1] = '\0';
     
    611611            itbs = atol(psz);
    612612        }
    613         log_msg(1, "'%s' --> %ld", flag_val['b'], itbs);
    614         log_msg(1, "Internal tape block size is now %ld bytes", itbs);
     613        mr_msg(1, "'%s' --> %ld", flag_val['b'], itbs);
     614        mr_msg(1, "Internal tape block size is now %ld bytes", itbs);
    615615        if (itbs % 512 != 0 || itbs < 256 || itbs > 1024L * 1024) {
    616616            fatal_error
     
    761761            (BOOT_LOADER_CHARS,
    762762             (bkpinfo->boot_loader = flag_val['l'][0]))) {
    763             log_msg(1, "%c? WTF is %c? I need G, L, E or R.",
     763            mr_msg(1, "%c? WTF is %c? I need G, L, E or R.",
    764764                    bkpinfo->boot_loader, bkpinfo->boot_loader);
    765765            fatal_error
     
    779779    if (flag_set['Q']) {
    780780        i = which_boot_loader(tmp);
    781         log_msg(3, "boot loader is %c, residing at %s", i, tmp);
     781        mr_msg(3, "boot loader is %c, residing at %s", i, tmp);
    782782        printf("boot loader is %c, residing at %s\n", i, tmp);
    783783        finish(0);
     
    948948void help_screen()
    949949{
    950     log_msg(1, "Type 'man mondo-archive' for more information\n");
     950    mr_msg(1, "Type 'man mondo-archive' for more information\n");
    951951    exit(1);
    952952}
     
    10441044void termination_in_progress(int sig)
    10451045{
    1046     log_msg(1, "Termination in progress");
     1046    mr_msg(1, "Termination in progress");
    10471047    usleep(1000);
    10481048    pthread_exit(0);
  • branches/stable/mondo/src/mondorestore/mondo-prep.c

    r1103 r1108  
    8686                    drivelist->el[lino].device, MONDO_WAS_HERE);
    8787            if (!run_program_and_log_output(command, 1)) {
    88                 log_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",
     88                mr_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",
    8989                        lino, drivelist->el[lino].device);
    9090                break;
     
    108108                fout = fopen(drivelist->el[lino].device, "w+");
    109109                if (!fout) {
    110                     log_msg(1, "Unable to open+wipe %s",
     110                    mr_msg(1, "Unable to open+wipe %s",
    111111                            drivelist->el[lino].device);
    112112                } else {
    113113                    if (1 != fwrite(buf, blocksize, 1, fout)) {
    114                         log_msg(1, "Failed to wipe %s",
     114                        mr_msg(1, "Failed to wipe %s",
    115115                                drivelist->el[lino].device);
    116116                    } else {
    117                         log_msg(1, "Successfully wiped %s",
     117                        mr_msg(1, "Successfully wiped %s",
    118118                                drivelist->el[lino].device);
    119119                    }
     
    132132    mr_free(command);
    133133    mr_free(tmp);
    134     log_msg(1, "Cool. I didn't have to wipe anything.");
     134    mr_msg(1, "Cool. I didn't have to wipe anything.");
    135135}
    136136
     
    148148        return (-1);
    149149    }
    150     log_msg(5, "Writing string '%s', one char at a time", str);
     150    mr_msg(5, "Writing string '%s', one char at a time", str);
    151151    j = strlen(str);
    152152    for (i = 0; i < j; i++) {
    153         log_msg(6, "Writing %d ('%c')", str[i], str[i]);
     153        mr_msg(6, "Writing %d ('%c')", str[i], str[i]);
    154154        if ((fq = fopen(FDISK_LOG, "a+"))) {
    155155            fputc(str[i], fq);
     
    163163        }
    164164    }
    165     log_msg(5, "Returning");
     165    mr_msg(5, "Returning");
    166166
    167167    return (i);
     
    244244//  do_this_last[0] = '\0';
    245245    iamhere("STARTING");
    246     log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");
     246    mr_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");
    247247    if (find_home_of_exe("lvm"))    // found it :) cool
    248248    {
     
    274274    if (just_erase_existing_volumes) {
    275275        paranoid_fclose(fin);
    276         log_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");
     276        mr_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");
    277277        retval = 0;
    278278        goto end_of_i_want_my_lvm;
    279279    }
    280280
    281     log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");
     281    mr_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");
    282282    rewind(fin);
    283283    for (fgets(incoming, 512, fin); !feof(fin); fgets(incoming, 512, fin)) {
     
    311311            for (q = tmp; *q > 32; q++);
    312312            *q = '\0';
    313             log_msg(1, "Deleting old entries at /dev/%s", tmp);
     313            mr_msg(1, "Deleting old entries at /dev/%s", tmp);
    314314//             sprintf(command, "%s -f %s", vgremove_sz, tmp);
    315315//             run_program_and_log_output(command, 1);
     
    318318            run_program_and_log_output(vgscan_sz, 1);
    319319            run_program_and_log_output(pvscan_sz, 1);
    320             log_msg(3,
     320            mr_msg(3,
    321321                    "After working around potentially broken i-want-my-lvm, incoming[] is now '%s'",
    322322                    incoming);
     
    332332            res = run_program_and_log_output(command, 5);
    333333        }
    334         log_msg(0, "%s --> %d", command, res);
     334        mr_msg(0, "%s --> %d", command, res);
    335335        if (res > 0) {
    336336            res = 1;
     
    350350            for (p = tmp; *p != '\0' && !isdigit(*p); p++);
    351351            extents = atol(p);
    352             log_msg(5, "p='%s' --> extents=%ld", p, extents);
     352            mr_msg(5, "p='%s' --> extents=%ld", p, extents);
    353353            p = strstr(command, "-L");
    354354            if (!p) {
    355                 log_msg(0, "Fiddlesticks. '%s' returned %d", command, res);
     355                mr_msg(0, "Fiddlesticks. '%s' returned %d", command, res);
    356356            } else {
    357357                if (lvmversion == 2) {
     
    376376                    *(p + i) = ' ';
    377377                }
    378                 log_msg(5, "Retrying with '%s'", command);
     378                mr_msg(5, "Retrying with '%s'", command);
    379379                res = run_program_and_log_output(command, 5);
    380380                if (res > 0) {
     
    384384                    fprintf(g_fprep, "%s\n", command);
    385385                }
    386                 log_msg(0, "%s --> %d", command, res);
     386                mr_msg(0, "%s --> %d", command, res);
    387387                if (!res) {
    388                     log_msg(5, "YAY! This time, it succeeded.");
     388                    mr_msg(5, "YAY! This time, it succeeded.");
    389389                }
    390390            }
    391391        }
    392392        if (strstr(command, "vgcreate")) {
    393             log_msg(0, "In case you're interested...");
     393            mr_msg(0, "In case you're interested...");
    394394            run_program_and_log_output(vgscan_sz, 1);
    395395            run_program_and_log_output(pvscan_sz, 1);
     
    403403    }
    404404    paranoid_fclose(fin);
    405     log_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");
     405    mr_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");
    406406  end_of_i_want_my_lvm:
    407407    mr_free(tmp);
     
    422422    iamhere("ENDING");
    423423    if (retval > 2) {
    424         log_msg(1, "%d errors. I'm reporting this.", retval);
     424        mr_msg(1, "%d errors. I'm reporting this.", retval);
    425425        return (retval);
    426426    } else {
    427         log_msg(1, "Not many errors. Returning 0.");
     427        mr_msg(1, "Not many errors. Returning 0.");
    428428        return (0);
    429429    }
     
    572572  // leave straight away if raidlist is initial or has no entries
    573573  if (!raidlist || raidlist->entries == 0) {
    574     log_msg(1, "No RAID arrays found.");
     574    mr_msg(1, "No RAID arrays found.");
    575575    return 1;
    576576  } else {
    577     log_msg(1, "%d RAID arrays found.", raidlist->entries);
     577    mr_msg(1, "%d RAID arrays found.", raidlist->entries);
    578578  }
    579579  // find raidlist entry for requested device
     
    583583  // check whether RAID device was found in raidlist
    584584  if (i == raidlist->entries) {
    585     log_msg(1, "RAID device %s not found in list.", device);
     585    mr_msg(1, "RAID device %s not found in list.", device);
    586586    return 1;
    587587  }
     
    809809        }
    810810
    811         log_msg(1, "Making %s", device);
     811        mr_msg(1, "Making %s", device);
    812812        // use mkraid if it exists, otherwise use mdadm
    813813        if (run_program_and_log_output("which mkraid", FALSE)) {
    814814            res = create_raid_device_via_mdadm(raidlist, device);
    815             log_msg(1, "Creating RAID device %s via mdadm returned %d", device, res);
     815            mr_msg(1, "Creating RAID device %s via mdadm returned %d", device, res);
    816816        } else {
    817817            sprintf(program, "mkraid --really-force %s", device);
    818818            res = run_program_and_log_output(program, 1);
    819             log_msg(1, "%s returned %d", program, res);
     819            mr_msg(1, "%s returned %d", program, res);
    820820            system("sync");
    821821            sleep(3);
     
    830830//      sprintf(program, "raidstart %s", device);
    831831//      res = run_program_and_log_output(program, 1);
    832 //      log_msg(1, "%s returned %d", program, res);
     832//      mr_msg(1, "%s returned %d", program, res);
    833833//      system("sync"); sleep(1);
    834834#endif
     
    841841
    842842    if (!strcmp(format, "lvm")) {
    843         log_msg(1, "Don't format %s - it's part of an lvm volume", device);
     843        mr_msg(1, "Don't format %s - it's part of an lvm volume", device);
    844844        mr_free(program);
    845845        mr_free(tmp);
     
    938938// start soft-raids now (because LVM might depend on them)
    939939// ...and for simplicity's sake, let's format them at the same time :)
    940     log_msg(1, "Stopping all RAID devices");
     940    mr_msg(1, "Stopping all RAID devices");
    941941    stop_all_raid_devices(mountlist);
    942942    system("sync");
     
    944944    system("sync");
    945945    sleep(2);
    946     log_msg(1, "Prepare soft-RAIDs");   // prep and format too
     946    mr_msg(1, "Prepare soft-RAIDs");    // prep and format too
    947947    for (lino = 0; lino < mountlist->entries; lino++) {
    948948        me = &mountlist->el[lino];  // the current mountlist entry
    949         log_msg(2, "Examining %s", me->device);
     949        mr_msg(2, "Examining %s", me->device);
    950950        if (!strncmp(me->device, "/dev/md", 7)) {
    951951            if (interactively) {
     
    974974//  sleep(5);
    975975// do LVMs now
    976     log_msg(1, "Creating LVMs");
     976    mr_msg(1, "Creating LVMs");
    977977    if (does_file_exist("/tmp/i-want-my-lvm")) {
    978978        wait_until_software_raids_are_prepped("/proc/mdstat", 100);
     
    991991          }
    992992        if (res) {
    993             log_msg(1, "Vacuum-packing...");
     993            mr_msg(1, "Vacuum-packing...");
    994994*/
    995995        res = do_my_funky_lvm_stuff(FALSE, TRUE);
     
    10131013// do regulars at last
    10141014    sleep(2);                   // woo!
    1015     log_msg(1, "Formatting regulars");
     1015    mr_msg(1, "Formatting regulars");
    10161016    for (lino = 0; lino < mountlist->entries; lino++) {
    10171017        me = &mountlist->el[lino];  // the current mountlist entry
     
    16681668        system("sync");
    16691669        paranoid_pclose(pout_to_fdisk);
    1670         log_msg(0,
     1670        mr_msg(0,
    16711671                "------------------- fdisk.log looks like this ------------------");
    16721672        sprintf(tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE);
    16731673        system(tmp);
    1674         log_msg(0,
     1674        mr_msg(0,
    16751675                "------------------- end of fdisk.log... word! ------------------");
    16761676        sprintf(tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG);
     
    18091809    if (partsize > 0) {
    18101810        if (!strcmp(format, "7")) {
    1811             log_msg(1, "Adding 512K, just in case");
     1811            mr_msg(1, "Adding 512K, just in case");
    18121812            partsize += 512;
    18131813        }
     
    18291829
    18301830    if (pout_to_fdisk) {
    1831         log_msg(1, "Doing the new all-in-one fdisk thing");
    1832         log_msg(1, "output = '%s'", output);
     1831        mr_msg(1, "Doing the new all-in-one fdisk thing");
     1832        mr_msg(1, "output = '%s'", output);
    18331833        fput_string_one_char_at_a_time(pout_to_fdisk, output);
    18341834        fput_string_one_char_at_a_time(pout_to_fdisk, "\n\np\n");
    18351835        strcpy(tmp, last_line_of_file(FDISK_LOG));
    18361836        if (strstr(tmp, " (m ")) {
    1837             log_msg(1, "Successfully created %s%d", drive, partno);
     1837            mr_msg(1, "Successfully created %s%d", drive, partno);
    18381838        } else {
    1839             log_msg(1, "last line = %s", tmp);
    1840             log_msg(1, "Failed to create %s%d; sending 'Enter'...", drive,
     1839            mr_msg(1, "last line = %s", tmp);
     1840            mr_msg(1, "Failed to create %s%d; sending 'Enter'...", drive,
    18411841                    partno);
    18421842        }
    18431843        if (!retval) {
    1844             log_msg(1, "Trying to set %s%d's partition type now", drive,
     1844            mr_msg(1, "Trying to set %s%d's partition type now", drive,
    18451845                    partno);
    18461846            retval =
     
    18481848                                   partsize);
    18491849            if (retval) {
    1850                 log_msg(1, "Failed. Trying again...");
     1850                mr_msg(1, "Failed. Trying again...");
    18511851                retval =
    18521852                    set_partition_type(pout_to_fdisk, drive, partno,
     
    18551855        }
    18561856        if (retval) {
    1857             log_msg(1, "...but failed to set type");
     1857            mr_msg(1, "...but failed to set type");
    18581858        }
    18591859    } else {
     
    19521952        /*      mountlist=&new_mtlist; */
    19531953        /*      extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */
    1954         log_msg(0,
     1954        mr_msg(0,
    19551955                "Mountlist, including the partitions incorporated in RAID devices:-");
    19561956        for (i = 0; i < mountlist->entries; i++) {
    19571957            log_it(mountlist->el[i].device);
    19581958        }
    1959         log_msg(0, "End of mountlist.");
    1960     }
    1961     log_msg(0, "Stopping all LVMs, just in case");
     1959        mr_msg(0, "End of mountlist.");
     1960    }
     1961    mr_msg(0, "Stopping all LVMs, just in case");
    19621962    if (!g_text_mode) {
    19631963        newtSuspend();
     
    19671967        newtResume();
    19681968    }
    1969     log_msg(0, "Stopping all software RAID devices, just in case");
     1969    mr_msg(0, "Stopping all software RAID devices, just in case");
    19701970    stop_all_raid_devices(mountlist);
    1971     log_msg(0, "Done.");
     1971    mr_msg(0, "Done.");
    19721972
    19731973/* 
     
    20932093    sprintf(tmp, "Setting %s's type to %s (%s)", partition, format,
    20942094            partcode);
    2095     log_msg(1, tmp);
     2095    mr_msg(1, tmp);
    20962096    if (partcode[0] != '\0' && strcmp(partcode, "83")) {    /* no need to set type if 83: 83 is default */
    20972097
     
    21012101            if (partno > 1
    21022102                || strstr(last_line_of_file(FDISK_LOG), " (1-4)")) {
    2103                 log_msg(5, "Specifying partno (%d) - yay", partno);
     2103                mr_msg(5, "Specifying partno (%d) - yay", partno);
    21042104                sprintf(tmp, "%d\n", partno);
    21052105                fput_string_one_char_at_a_time(pout_to_fdisk, tmp);
    2106                 log_msg(5, "A - last line = '%s'",
     2106                mr_msg(5, "A - last line = '%s'",
    21072107                        last_line_of_file(FDISK_LOG));
    21082108            }
     
    21102110            sprintf(tmp, "%s\n", partcode);
    21112111            fput_string_one_char_at_a_time(pout_to_fdisk, tmp);
    2112             log_msg(5, "B - last line = '%s'",
     2112            mr_msg(5, "B - last line = '%s'",
    21132113                    last_line_of_file(FDISK_LOG));
    21142114            fput_string_one_char_at_a_time(pout_to_fdisk, "\n");
    2115             log_msg(5, "C - last line = '%s'",
     2115            mr_msg(5, "C - last line = '%s'",
    21162116                    last_line_of_file(FDISK_LOG));
    21172117
    21182118            strcpy(tmp, last_line_of_file(FDISK_LOG));
    21192119            if (!strstr(tmp, " (m ")) {
    2120                 log_msg(1, "last line = '%s'; part type set failed", tmp);
     2120                mr_msg(1, "last line = '%s'; part type set failed", tmp);
    21212121                res++;
    21222122                fput_string_one_char_at_a_time(pout_to_fdisk, "\n");
     
    21282128            sprintf(command, "parted2fdisk %s >> %s 2>> %s", drive,
    21292129                    MONDO_LOGFILE, MONDO_LOGFILE);
    2130             log_msg(5, "output = '%s'", output);
    2131             log_msg(5, "partno=%d; partcode=%s", partno, partcode);
    2132             log_msg(5, "command = '%s'", command);
     2130            mr_msg(5, "output = '%s'", output);
     2131            mr_msg(5, "partno=%d; partcode=%s", partno, partcode);
     2132            mr_msg(5, "command = '%s'", command);
    21332133            fout = popen(command, "w");
    21342134            if (!fout) {
     
    21802180    sprintf(program, "raidstart %s", raid_device);
    21812181#endif
    2182     log_msg(1, "program = %s", program);
     2182    mr_msg(1, "program = %s", program);
    21832183    res = run_program_and_log_output(program, 1);
    21842184    if (g_fprep) {
     
    21862186    }
    21872187    if (res) {
    2188         log_msg(1, "Warning - failed to start RAID device %s",
     2188        mr_msg(1, "Warning - failed to start RAID device %s",
    21892189                raid_device);
    21902190    }
     
    22292229    }
    22302230#endif
    2231     log_msg(1, "program = %s", program);
     2231    mr_msg(1, "program = %s", program);
    22322232    res = run_program_and_log_output(program, 1);
    22332233    if (g_fprep) {
     
    22352235    }
    22362236    if (res) {
    2237         log_msg(1, "Warning - failed to stop RAID device %s", raid_device);
     2237        mr_msg(1, "Warning - failed to stop RAID device %s", raid_device);
    22382238    }
    22392239    retval += res;
     
    22522252            (mountlist->el[i].device, RAID_DEVICE_STUB,
    22532253             strlen(RAID_DEVICE_STUB))) {
    2254             log_msg(1, "Starting %s", mountlist->el[i].device);
     2254            mr_msg(1, "Starting %s", mountlist->el[i].device);
    22552255            res = start_raid_device(mountlist->el[i].device);
    22562256            retval += res;
     
    22582258    }
    22592259    if (retval) {
    2260         log_msg(1, "Started all s/w raid devices OK");
     2260        mr_msg(1, "Started all s/w raid devices OK");
    22612261    } else {
    2262         log_msg(1, "Failed to start some/all s/w raid devices");
     2262        mr_msg(1, "Failed to start some/all s/w raid devices");
    22632263    }
    22642264    return (retval);
     
    23362336    paranoid_fclose(fin);
    23372337    if (retval) {
    2338         log_msg(1, "Warning - unable to stop some RAID devices");
     2338        mr_msg(1, "Warning - unable to stop some RAID devices");
    23392339    }
    23402340    mr_free(dev);
     
    25502550
    25512551        if (!strcmp(drivemntlist->el[partno]->mountpoint, "image")) {
    2552             log_msg(1, "Skipping %s (%s) because it's an image",
     2552            mr_msg(1, "Skipping %s (%s) because it's an image",
    25532553                    drivemntlist->el[partno]->device,
    25542554                    drivemntlist->el[partno]->mountpoint);
     
    26272627    assert(drivemntlist != NULL);
    26282628
    2629     log_msg(1, "Creating list of partitions for drive %s", drive_name);
     2629    mr_msg(1, "Creating list of partitions for drive %s", drive_name);
    26302630
    26312631    tmp_drive_name = strdup(drive_name);
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r1080 r1108  
    163163    int retval = 0, res = 0;
    164164
    165     log_msg(2, "let_user_edit_the_mountlist() --- starting");
     165    mr_msg(2, "let_user_edit_the_mountlist() --- starting");
    166166
    167167    assert(bkpinfo != NULL);
     
    170170    if (!bkpinfo->disaster_recovery) {
    171171        strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
    172         log_msg(2, "I guess you're testing edit_mountlist()");
     172        mr_msg(2, "I guess you're testing edit_mountlist()");
    173173    }
    174174    if (!does_file_exist(g_mountlist_fname)) {
     
    218218    for (i = 0; i < mountlist->entries; i++) {
    219219        if (strstr(mountlist->el[i].format, "ompaq")) {
    220             log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
     220            mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
    221221                    i, mountlist->el[i].device, mountlist->el[i].format);
    222222
     
    296296    if (bkpinfo->backup_media_type == iso) {
    297297        if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) {
    298             log_msg(2,
     298            mr_msg(2,
    299299                    "catchall_mode --- iso_fiddly_bits returned w/ error");
    300300            return (1);
    301301        } else {
    302             log_msg(2, "catchall_mode --- iso_fiddly_bits ok");
     302            mr_msg(2, "catchall_mode --- iso_fiddly_bits ok");
    303303        }
    304304    }
    305305
    306306    if (c == 'I') {
    307         log_msg(2, "IM selected");
     307        mr_msg(2, "IM selected");
    308308        retval += interactive_mode(bkpinfo, mountlist, raidlist);
    309309    } else if (c == 'N') {
    310         log_msg(2, "NM selected");
     310        mr_msg(2, "NM selected");
    311311        retval += nuke_mode(bkpinfo, mountlist, raidlist);
    312312    } else if (c == 'C') {
    313         log_msg(2, "CM selected");
     313        mr_msg(2, "CM selected");
    314314        retval += compare_mode(bkpinfo, mountlist, raidlist);
    315315    }
     
    400400    /* try to partition and format */
    401401
    402     log_msg(2, "interactive_mode --- starting (great, assertions OK)");
     402    mr_msg(2, "interactive_mode --- starting (great, assertions OK)");
    403403
    404404    malloc_string(tmp);
     
    409409    assert(raidlist != NULL);
    410410
    411     log_msg(2, "interactive_mode --- assertions OK");
     411    mr_msg(2, "interactive_mode --- assertions OK");
    412412
    413413    if (g_text_mode) {
     
    433433#endif
    434434    {
    435         log_msg(1, "Not resizing mountlist.");
     435        mr_msg(1, "Not resizing mountlist.");
    436436    } else {
    437437        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    451451            paranoid_MR_finish(1);
    452452        }
    453         log_msg(2, "Proceeding...");
     453        mr_msg(2, "Proceeding...");
    454454        save_mountlist_to_disk(mountlist, g_mountlist_fname);
    455455        save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME);
     
    534534         ask_me_yes_or_no("Do you want me to restore all of your data?")))
    535535    {
    536         log_msg(1, "Restoring all data");
     536        mr_msg(1, "Restoring all data");
    537537        retval += restore_everything(bkpinfo, NULL);
    538538    } else
     
    561561                    }
    562562                    strcpy(bkpinfo->restore_path, tmp);
    563                     log_msg(1, "Restoring subset");
     563                    mr_msg(1, "Restoring subset");
    564564                    retval += restore_everything(bkpinfo, filelist);
    565565                    free_filelist(filelist);
     
    666666    assert(raidlist != NULL);
    667667    if (iso_fiddly_bits(bkpinfo, nuke_me_please)) {
    668         log_msg(1, "iso_mode --- returning w/ error");
     668        mr_msg(1, "iso_mode --- returning w/ error");
    669669        return (1);
    670670    } else {
     
    732732    assert(raidlist != NULL);
    733733
    734     log_msg(2, "nuke_mode --- starting");
     734    mr_msg(2, "nuke_mode --- starting");
    735735
    736736    get_cfg_file_from_archive_or_bust(bkpinfo);
     
    746746#endif
    747747    {
    748         log_msg(2, "Not resizing mountlist.");
     748        mr_msg(2, "Not resizing mountlist.");
    749749    } else {
    750750        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    784784#endif
    785785            {
    786                 log_msg(2,
     786                mr_msg(2,
    787787                        "Not partitioning drives due to 'nopart' option.");
    788788                res = 0;
     
    831831    retval += restore_everything(bkpinfo, NULL);
    832832    if (!run_boot_loader(FALSE)) {
    833         log_msg(1,
     833        mr_msg(1,
    834834                "Great! Boot loader was installed. No need for msg at end.");
    835835        boot_loader_installed = TRUE;
     
    910910    struct s_node *filelist;
    911911
    912     log_msg(1, "restore_to_live_filesystem() - starting");
     912    mr_msg(1, "restore_to_live_filesystem() - starting");
    913913    assert(bkpinfo != NULL);
    914914    malloc_string(old_restpath);
     
    923923    }
    924924    interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    925     log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
     925    mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    926926    if (!bkpinfo->media_device[0]) {
    927         log_msg(2, "Warning - failed to find media dev");
    928     }
    929 
    930 
    931     log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
     927        mr_msg(2, "Warning - failed to find media dev");
     928    }
     929
     930
     931    mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
    932932
    933933    open_evalcall_form("Thinking...");
     
    957957    }
    958958    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    959         log_msg(2,
     959        mr_msg(2,
    960960                "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway.");
    961961    }
     
    10461046    if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) <
    10471047        sizeof(biggiestruct)) {
    1048         log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
     1048        mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
    10491049                bigfileno + 1);
    10501050    }
     
    10561056        sprintf(tmp, "Warning - bigfile %ld does not have a checksum",
    10571057                bigfileno + 1);
    1058         log_msg(3, tmp);
     1058        mr_msg(3, tmp);
    10591059        p = checksum;
    10601060    }
     
    10721072        node = find_string_at_node(filelist, biggiestruct.filename);
    10731073        if (!node) {
    1074             log_msg(0, "Skipping %s (name isn't in filelist)",
     1074            mr_msg(0, "Skipping %s (name isn't in filelist)",
    10751075                    biggiestruct.filename);
    10761076            pathname_of_last_file_restored[0] = '\0';
    10771077            return (0);
    10781078        } else if (!(node->selected)) {
    1079             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1079            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    10801080                    biggiestruct.filename);
    10811081            pathname_of_last_file_restored[0] = '\0';
     
    10851085    /* otherwise, continue */
    10861086
    1087     log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
     1087    mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
    10881088    if (biggiestruct.use_ntfsprog) {
    10891089        if (strncmp(biggiestruct.filename, "/dev/", 5)) {
    1090             log_msg(1,
     1090            mr_msg(1,
    10911091                    "I was in error when I set biggiestruct.use_ntfsprog to TRUE.");
    1092             log_msg(1, "%s isn't even in /dev", biggiestruct.filename);
     1092            mr_msg(1, "%s isn't even in /dev", biggiestruct.filename);
    10931093            biggiestruct.use_ntfsprog = FALSE;
    10941094        }
     
    11001100        g_loglevel = 4;
    11011101        use_ntfsprog_hack = TRUE;
    1102         log_msg(2,
     1102        mr_msg(2,
    11031103                "Calling ntfsclone in background because %s is an NTFS /dev entry",
    11041104                outfile_fname);
     
    11121112            fatal_error("Fork failure");
    11131113        case 0:
    1114             log_msg(3,
     1114            mr_msg(3,
    11151115                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    11161116                    biggiestruct.filename, ntfsprog_fifo);
     
    11181118                feed_outfrom_ntfsprog(biggiestruct.filename,
    11191119                                       ntfsprog_fifo);
    1120 //          log_msg(3, "CHILD - fip - exiting");
     1120//          mr_msg(3, "CHILD - fip - exiting");
    11211121            exit(res);
    11221122            break;
    11231123        default:
    1124             log_msg(3,
     1124            mr_msg(3,
    11251125                    "feed_into_ntfsprog() called in background --- pid=%ld",
    11261126                    (long int) (pid));
     
    11381138    sprintf(tmp, "Reassembling big file %ld (%s)", bigfileno + 1,
    11391139            outfile_fname);
    1140     log_msg(2, tmp);
     1140    mr_msg(2, tmp);
    11411141
    11421142    /*
     
    11501150    pathname_of_last_file_restored[MAX_STR_LEN - 1] = '\0';
    11511151
    1152     log_msg(3, "file_to_openout = %s", file_to_openout);
     1152    mr_msg(3, "file_to_openout = %s", file_to_openout);
    11531153    if (!(fout = fopen(file_to_openout, "w"))) {
    11541154        log_to_screen("Cannot openout outfile_fname - hard disk full?");
    11551155        return (1);
    11561156    }
    1157     log_msg(3, "Opened out to %s", outfile_fname);  // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
     1157    mr_msg(3, "Opened out to %s", outfile_fname);   // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
    11581158
    11591159    for (sliceno = 1, finished = FALSE; !finished;) {
     
    11691169            !does_file_exist(slice_fname
    11701170                             (bigfileno, sliceno, ARCHIVES_PATH, "bz2"))) {
    1171             log_msg(3,
     1171            mr_msg(3,
    11721172                    "Cannot find a data slice or terminator slice on CD %d",
    11731173                    g_current_media_number);
     
    11771177                    media_descriptor_string(bkpinfo->backup_media_type),
    11781178                    g_current_media_number, sliceno);
    1179             log_msg(2, tmp);
     1179            mr_msg(2, tmp);
    11801180            sprintf(tmp, "Restoring from %s #%d",
    11811181                    media_descriptor_string(bkpinfo->backup_media_type),
     
    11881188                   slice_fname(bigfileno, sliceno, ARCHIVES_PATH, ""));
    11891189            if (does_file_exist(tmp) && length_of_file(tmp) == 0) {
    1190                 log_msg(2,
     1190                mr_msg(2,
    11911191                        "End of bigfile # %ld (slice %ld is the terminator)",
    11921192                        bigfileno + 1, sliceno);
     
    12351235                    media_descriptor_string(bkpinfo->backup_media_type),
    12361236                    g_current_media_number, bigfileno + 1, sliceno);
    1237             log_msg(2, tmp);
     1237            mr_msg(2, tmp);
    12381238
    12391239            if (!g_text_mode) {
     
    12531253                    sprintf(sz_msg + strlen(sz_msg),
    12541254                            "; written %ld to fout", siz);
    1255 //        log_msg(2. sz_msg);
     1255//        mr_msg(2. sz_msg);
    12561256                }
    12571257            }
     
    12741274
    12751275    if (use_ntfsprog_hack) {
    1276         log_msg(3, "Waiting for ntfsclone to finish");
     1276        mr_msg(3, "Waiting for ntfsclone to finish");
    12771277        sprintf(tmp,
    12781278                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    13701370    if (use_ntfsprog == BLK_START_A_PIHBIGGIE) {
    13711371        use_ntfsprog = 1;
    1372         log_msg(1, "%s --- pih=YES", orig_bf_fname);
     1372        mr_msg(1, "%s --- pih=YES", orig_bf_fname);
    13731373    } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) {
    13741374        use_ntfsprog = 0;
    1375         log_msg(1, "%s --- pih=NO", orig_bf_fname);
     1375        mr_msg(1, "%s --- pih=NO", orig_bf_fname);
    13761376    } else {
    13771377        use_ntfsprog = 0;
    1378         log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
     1378        mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
    13791379    }
    13801380
     
    13891389        if (!node) {
    13901390            dummy_restore = TRUE;
    1391             log_msg(1,
     1391            mr_msg(1,
    13921392                    "Skipping big file %ld (%s) - not in biggielist subset",
    13931393                    biggiefile_number + 1, orig_bf_fname);
     
    13951395        } else if (!(node->selected)) {
    13961396            dummy_restore = TRUE;
    1397             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1397            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    13981398                    orig_bf_fname);
    13991399            pathname_of_last_file_restored[0] = '\0';
     
    14031403    if (use_ntfsprog) {
    14041404        if (strncmp(orig_bf_fname, "/dev/", 5)) {
    1405             log_msg(1,
     1405            mr_msg(1,
    14061406                    "I was in error when I set use_ntfsprog to TRUE.");
    1407             log_msg(1, "%s isn't even in /dev", orig_bf_fname);
     1407            mr_msg(1, "%s isn't even in /dev", orig_bf_fname);
    14081408            use_ntfsprog = FALSE;
    14091409        }
     
    14141414        strcpy(outfile_fname, orig_bf_fname);
    14151415        use_ntfsprog_hack = TRUE;
    1416         log_msg(2,
     1416        mr_msg(2,
    14171417                "Calling ntfsclone in background because %s is a /dev entry",
    14181418                outfile_fname);
     
    14281428            fatal_error("Fork failure");
    14291429        case 0:
    1430             log_msg(3,
     1430            mr_msg(3,
    14311431                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    14321432                    outfile_fname, ntfsprog_fifo);
    14331433            res =
    14341434                feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo);
    1435 //          log_msg(3, "CHILD - fip - exiting");
     1435//          mr_msg(3, "CHILD - fip - exiting");
    14361436            exit(res);
    14371437            break;
    14381438        default:
    1439             log_msg(3,
     1439            mr_msg(3,
    14401440                    "feed_into_ntfsprog() called in background --- pid=%ld",
    14411441                    (long int) (pid));
     
    14591459        sprintf(tmp, "Reassembling big file %ld (%s)",
    14601460                biggiefile_number + 1, orig_bf_fname);
    1461         log_msg(2, tmp);
     1461        mr_msg(2, tmp);
    14621462    }
    14631463
     
    14731473    }
    14741474    sprintf(tmp, "Pipe command = '%s'", command);
    1475     log_msg(3, tmp);
     1475    mr_msg(3, tmp);
    14761476
    14771477    /* restore biggiefile, one slice at a time */
     
    14871487        sprintf(tmp, "Working on file #%ld, slice #%ld    ",
    14881488                biggiefile_number + 1, current_slice_number);
    1489         log_msg(2, tmp);
     1489        mr_msg(2, tmp);
    14901490        if (!g_text_mode) {
    14911491            newtDrawRootText(0, g_noof_rows - 2, tmp);
     
    15051505                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    15061506                     fin) < sizeof(biggiestruct)) {
    1507                     log_msg(2,
     1507                    mr_msg(2,
    15081508                            "Warning - unable to get biggiestruct of bigfile #%d",
    15091509                            biggiefile_number + 1);
     
    15251525    paranoid_pclose(pout);
    15261526
    1527     log_msg(1, "pathname_of_last_file_restored is now %s",
     1527    mr_msg(1, "pathname_of_last_file_restored is now %s",
    15281528            pathname_of_last_file_restored);
    15291529
    15301530    if (use_ntfsprog_hack) {
    1531         log_msg(3, "Waiting for ntfsclone to finish");
     1531        mr_msg(3, "Waiting for ntfsclone to finish");
    15321532        sprintf(tmp,
    15331533                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    15351535            sleep(1);
    15361536        }
    1537         log_msg(3, "OK, ntfsclone has really finished");
    1538     }
    1539 
    1540     log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
    1541     log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
     1537        mr_msg(3, "OK, ntfsclone has really finished");
     1538    }
     1539
     1540    mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
     1541    mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
    15421542    if (strcmp(outfile_fname, "/dev/null")) {
    15431543        chmod(outfile_fname, biggiestruct.properties.st_mode);
     
    16091609    malloc_string(acl_fname);
    16101610
    1611     log_msg(5, "Entering");
     1611    mr_msg(5, "Entering");
    16121612    filelist_subset_fname[0] = '\0';
    16131613    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
     
    16211621            current_tarball_number);
    16221622    if (length_of_file(filelist_name) <= 2) {
    1623         log_msg(2, "There are _zero_ files in filelist '%s'",
     1623        mr_msg(2, "There are _zero_ files in filelist '%s'",
    16241624                filelist_name);
    1625         log_msg(2,
     1625        mr_msg(2,
    16261626                "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)");
    1627         log_msg(2,
     1627        mr_msg(2,
    16281628                "but it's non-critical. It's cosmetic. Don't worry about it.");
    16291629        retval = 0;
     
    16321632    if (count_lines_in_file(filelist_name) <= 0
    16331633        || length_of_file(tarball_fname) <= 0) {
    1634         log_msg(3, "length_of_file(%s) = %llu", tarball_fname,
     1634        mr_msg(3, "length_of_file(%s) = %llu", tarball_fname,
    16351635                length_of_file(tarball_fname));
    16361636        sprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)",
     
    16501650            <= 0) {
    16511651            sprintf(tmp, "Skipping fileset %ld", current_tarball_number);
    1652             log_msg(1, tmp);
     1652            mr_msg(1, tmp);
    16531653        } else {
    1654             log_msg(3, "Saved fileset %ld's subset to %s",
     1654            mr_msg(3, "Saved fileset %ld's subset to %s",
    16551655                    current_tarball_number, filelist_subset_fname);
    16561656        }
     
    17221722        sprintf(command + strlen(command), " 2>> %s >> %s", temp_log,
    17231723                temp_log);
    1724         log_msg(1, "command = '%s'", command);
     1724        mr_msg(1, "command = '%s'", command);
    17251725        unlink(temp_log);
    17261726        res = system(command);
     
    17291729            if (p) {
    17301730                p[0] = p[1] = p[2] = p[3] = ' ';
    1731                 log_msg(1, "new command = '%s'", command);
     1731                mr_msg(1, "new command = '%s'", command);
    17321732                res = system(command);
    17331733            }
     
    17381738
    17391739        if (g_getfattr) {
    1740             log_msg(1, "Setting fattr list %s", xattr_fname);
     1740            mr_msg(1, "Setting fattr list %s", xattr_fname);
    17411741            if (length_of_file(xattr_fname) > 0) {
    17421742                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     
    17451745                        ("Errors occurred while setting extended attributes");
    17461746                } else {
    1747                     log_msg(1, "I set xattr OK");
     1747                    mr_msg(1, "I set xattr OK");
    17481748                }
    17491749                retval += res;
     
    17511751        }
    17521752        if (g_getfacl) {
    1753             log_msg(1, "Setting acl list %s", acl_fname);
     1753            mr_msg(1, "Setting acl list %s", acl_fname);
    17541754            if (length_of_file(acl_fname) > 0) {
    17551755                res = set_acl_list(filelist_subset_fname, acl_fname);
     
    17581758                        ("Errors occurred while setting access control lists");
    17591759                } else {
    1760                     log_msg(1, "I set ACL OK");
     1760                    mr_msg(1, "I set ACL OK");
    17611761                }
    17621762                retval += res;
     
    17661766            sprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE);
    17671767            system(command);
    1768             log_msg(2, "Errors occurred while processing fileset #%d",
     1768            mr_msg(2, "Errors occurred while processing fileset #%d",
    17691769                    current_tarball_number);
    17701770        } else {
    1771             log_msg(2, "Fileset #%d processed OK", current_tarball_number);
     1771            mr_msg(2, "Fileset #%d processed OK", current_tarball_number);
    17721772        }
    17731773    }
     
    17901790    mr_free(xattr_fname);
    17911791    mr_free(acl_fname);
    1792     log_msg(5, "Leaving");
     1792    mr_msg(5, "Leaving");
    17931793    return (retval);
    17941794}
     
    18521852            media_descriptor_string(bkpinfo->backup_media_type),
    18531853            g_current_media_number);
    1854     log_msg(2, tmp);
     1854    mr_msg(2, tmp);
    18551855    run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE);
    18561856
     
    18731873    }
    18741874    if (res) {
    1875         log_msg(1, "Warning - error reading afioball from tape");
     1875        mr_msg(1, "Warning - error reading afioball from tape");
    18761876    }
    18771877    if (bkpinfo->compression_level == 0) {
     
    19001900        sprintf(command + strlen(command), " > %s 2>> %s", filelist_fname,
    19011901                MONDO_LOGFILE);
    1902         log_msg(1, "command = %s", command);
     1902        mr_msg(1, "command = %s", command);
    19031903        if (system(command)) {
    1904             log_msg(4, "Warning - error occurred while retrieving TOC");
     1904            mr_msg(4, "Warning - error occurred while retrieving TOC");
    19051905        }
    19061906        if ((matches =
     
    19101910            <= 0 || length_of_file(filelist_subset_fname) < 2) {
    19111911            if (length_of_file(filelist_subset_fname) < 2) {
    1912                 log_msg(1, "No matches found in fileset %ld",
     1912                mr_msg(1, "No matches found in fileset %ld",
    19131913                        current_tarball_number);
    19141914            }
    19151915            sprintf(tmp, "Skipping fileset %ld", current_tarball_number);
    1916             log_msg(2, tmp);
     1916            mr_msg(2, tmp);
    19171917            restore_this_fileset = FALSE;
    19181918        } else {
    1919             log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
     1919            mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
    19201920                    matches, current_tarball_number,
    19211921                    filelist_subset_fname);
     
    19461946// Call if IF there are files to restore (selectively/unconditionally)
    19471947    if (restore_this_fileset) {
    1948         log_msg(1, "Calling command='%s'", command);
     1948        mr_msg(1, "Calling command='%s'", command);
    19491949        paranoid_system(command);
    19501950
     
    19531953            res = set_fattr_list(filelist_subset_fname, xattr_fname);
    19541954            if (res) {
    1955                 log_msg(1, "Errors occurred while setting xattr");
     1955                mr_msg(1, "Errors occurred while setting xattr");
    19561956            } else {
    1957                 log_msg(1, "I set xattr OK");
     1957                mr_msg(1, "I set xattr OK");
    19581958            }
    19591959            retval += res;
     
    19641964            res = set_acl_list(filelist_subset_fname, acl_fname);
    19651965            if (res) {
    1966                 log_msg(1, "Errors occurred while setting ACL");
     1966                mr_msg(1, "Errors occurred while setting ACL");
    19671967            } else {
    1968                 log_msg(1, "I set ACL OK");
     1968                mr_msg(1, "I set ACL OK");
    19691969            }
    19701970            retval += res;
     
    19721972
    19731973    } else {
    1974         log_msg(1, "NOT CALLING '%s'", command);
     1974        mr_msg(1, "NOT CALLING '%s'", command);
    19751975    }
    19761976
     
    20342034            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    20352035    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2036         log_msg(1, "Warning - cannot openout %s",
     2036        mr_msg(1, "Warning - cannot openout %s",
    20372037                biggies_whose_EXATs_we_should_set);
    20382038    }
     
    20432043    mvaddstr_and_log_it(g_currentY, 0, tmp);
    20442044    if (length_of_file(BIGGIELIST) < 6) {
    2045         log_msg(1, "OK, no biggielist; not restoring biggiefiles");
     2045        mr_msg(1, "OK, no biggielist; not restoring biggiefiles");
    20462046        return (0);
    20472047    }
    20482048    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    20492049    if (noof_biggiefiles <= 0) {
    2050         log_msg(2,
     2050        mr_msg(2,
    20512051                "OK, no biggiefiles in biggielist; not restoring biggiefiles");
    20522052        return (0);
     
    20542054    sprintf(tmp, "OK, there are %ld biggiefiles in the archives",
    20552055            noof_biggiefiles);
    2056     log_msg(2, tmp);
     2056    mr_msg(2, tmp);
    20572057
    20582058    open_progress_form("Reassembling large files",
     
    20612061                       "", total_slices);
    20622062    for (bigfileno = 0, finished = FALSE; !finished;) {
    2063         log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
     2063        mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
    20642064        if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) {
    2065             log_msg(3,
     2065            mr_msg(3,
    20662066                    "...but its first slice isn't on this CD. Perhaps this was a selective restore?");
    2067             log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
     2067            mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
    20682068                    bigfileno + 1,
    20692069                    media_descriptor_string(bkpinfo->backup_media_type),
    20702070                    g_current_media_number);
    2071             log_msg(3, "Slicename would have been %s",
     2071            mr_msg(3, "Slicename would have been %s",
    20722072                    slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""));
    20732073            // I'm not positive 'just_changed_cds' is even necessary...
    20742074            if (just_changed_cds) {
    20752075                just_changed_cds = FALSE;
    2076                 log_msg(3,
     2076                mr_msg(3,
    20772077                        "I'll continue to scan this CD for bigfiles to be restored.");
    20782078            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
     
    20862086                just_changed_cds = TRUE;
    20872087            } else {
    2088                 log_msg(2, "There was no bigfile #%ld. That's OK.",
     2088                mr_msg(2, "There was no bigfile #%ld. That's OK.",
    20892089                        bigfileno + 1);
    2090                 log_msg(2, "I'm going to stop restoring bigfiles now.");
     2090                mr_msg(2, "I'm going to stop restoring bigfiles now.");
    20912091                finished = TRUE;
    20922092            }
     
    21802180
    21812181    mvaddstr_and_log_it(g_currentY, 0, "Restoring from archives");
    2182     log_msg(2,
     2182    mr_msg(2,
    21832183            "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER");
    21842184    if (g_current_media_number != 1) {
    2185         log_msg(3, "OK, that's jacked up.");
     2185        mr_msg(3, "OK, that's jacked up.");
    21862186        g_current_media_number = 1;
    21872187    }
     
    22442244                    media_descriptor_string(bkpinfo->backup_media_type),
    22452245                    g_current_media_number);
    2246 //    log_msg(3, "progress_str = %s", progress_str);
     2246//    mr_msg(3, "progress_str = %s", progress_str);
    22472247            for (res = 999, attempts = 0; attempts < 3 && res != 0;
    22482248                 attempts++) {
     
    23502350            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    23512351    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2352         log_msg(1, "Warning - cannot openout %s",
     2352        mr_msg(1, "Warning - cannot openout %s",
    23532353                biggies_whose_EXATs_we_should_set);
    23542354    }
     
    23662366    sprintf(tmp, "OK, there are %ld biggiefiles in the archives",
    23672367            noof_biggiefiles);
    2368     log_msg(2, tmp);
     2368    mr_msg(2, tmp);
    23692369    open_progress_form("Reassembling large files",
    23702370                       "I am now reassembling all the large files.",
     
    23982398                                               filelist, ctrl_chr,
    23992399                                               pathname_of_last_biggie_restored);
    2400         log_msg(1, "I believe I have restored %s",
     2400        mr_msg(1, "I believe I have restored %s",
    24012401                pathname_of_last_biggie_restored);
    24022402        if (fbw && pathname_of_last_biggie_restored[0]) {
     
    24162416                noof_biggiefiles, current_bigfile_number);
    24172417    }
    2418     log_msg(1, tmp);
     2418    mr_msg(1, tmp);
    24192419
    24202420    if (fbw) {
     
    24242424            if (g_getfattr) {
    24252425                if (length_of_file(xattr_fname) > 0) {
    2426                     log_msg(1, "set_fattr_List(%s,%s)",
     2426                    mr_msg(1, "set_fattr_List(%s,%s)",
    24272427                        biggies_whose_EXATs_we_should_set, xattr_fname);
    24282428                    set_fattr_list(biggies_whose_EXATs_we_should_set,
     
    24322432            if (g_getfacl) {
    24332433                if (length_of_file(acl_fname) > 0) {
    2434                     log_msg(1, "set_acl_list(%s,%s)",
     2434                    mr_msg(1, "set_acl_list(%s,%s)",
    24352435                            biggies_whose_EXATs_we_should_set, acl_fname);
    24362436                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     
    25232523                       progress_str, max_val);
    25242524
    2525     log_msg(3, "hey");
     2525    mr_msg(3, "hey");
    25262526
    25272527    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    25282528    if (res) {
    2529         log_msg(2, "Warning - error reading afioball from tape");
     2529        mr_msg(2, "Warning - error reading afioball from tape");
    25302530    }
    25312531    retval += res;
     
    25332533        wrong_marker(BLK_START_AFIOBALLS, ctrl_chr);
    25342534    }
    2535     log_msg(2, "ho");
     2535    mr_msg(2, "ho");
    25362536    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    25372537    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
     
    25922592        }
    25932593    }                           // next
    2594     log_msg(1, "All done with afioballs");
     2594    mr_msg(1, "All done with afioballs");
    25952595    close_progress_form();
    25962596    if (retval) {
     
    26362636    malloc_string(newpath);
    26372637    malloc_string(tmp);
    2638     log_msg(2, "restore_everything() --- starting");
     2638    mr_msg(2, "restore_everything() --- starting");
    26392639    g_current_media_number = 1;
    26402640    getcwd(cwd, MAX_STR_LEN - 1);
    26412641    sprintf(tmp, "mkdir -p %s", bkpinfo->restore_path);
    26422642    run_program_and_log_output(tmp, FALSE);
    2643     log_msg(1, "Changing dir to %s", bkpinfo->restore_path);
     2643    mr_msg(1, "Changing dir to %s", bkpinfo->restore_path);
    26442644    chdir(bkpinfo->restore_path);
    26452645    getcwd(newpath, MAX_STR_LEN - 1);
    2646     log_msg(1, "path is now %s", newpath);
    2647     log_msg(1, "restoring everything");
     2646    mr_msg(1, "path is now %s", newpath);
     2647    mr_msg(1, "restoring everything");
    26482648    if (!find_home_of_exe("petris") && !g_text_mode) {
    26492649        newtDrawRootText(0, g_noof_rows - 2,
     
    26822682    }
    26832683    if (length_of_file("/etc/raidtab") > 0) {
    2684         log_msg(2, "Copying local raidtab to restored filesystem");
     2684        mr_msg(2, "Copying local raidtab to restored filesystem");
    26852685        run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING
    26862686                                   "/etc/raidtab", FALSE);
    26872687    }
    26882688    kill_petris();
    2689     log_msg(2, "restore_everything() --- leaving");
     2689    mr_msg(2, "restore_everything() --- leaving");
    26902690    mr_free(cwd);
    26912691    mr_free(newpath);
     
    27322732    sprintf(tmp, "restore_here = '%s'", restore_here);
    27332733
    2734     log_msg(2, tmp);
    2735 
    2736     log_msg(2, "restore_live_from_monitas_server() - starting");
     2734    mr_msg(2, tmp);
     2735
     2736    mr_msg(2, "restore_live_from_monitas_server() - starting");
    27372737    unlink("/tmp/mountlist.txt");
    27382738    unlink("/tmp/filelist.full");
     
    27432743        strcpy(bkpinfo->restore_path, restore_here);
    27442744    }
    2745     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2745    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27462746    sprintf(tmp, "FYI - data will be restored to %s",
    27472747            bkpinfo->restore_path);
    2748     log_msg(3, tmp);
    2749     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2748    mr_msg(3, tmp);
     2749    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27502750    sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d",
    27512751            (int) (random() % 32768));
     
    27982798            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
    27992799    if (system(command)) {
    2800         log_msg(1,
     2800        mr_msg(1,
    28012801                "Error(s) occurred while processing biggielist and wildcard");
    28022802    }
     
    28062806    retval += restore_everything(bkpinfo, filelist);
    28072807    free_filelist(filelist);
    2808     log_msg(2, "--------End of restore_live_from_monitas_server--------");
     2808    mr_msg(2, "--------End of restore_live_from_monitas_server--------");
    28092809    return (retval);
    28102810}
     
    28282828void welcome_to_mondorestore()
    28292829{
    2830     log_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION);
    2831     log_msg(0,
     2830    mr_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION);
     2831    mr_msg(0,
    28322832            "DON'T PANIC! Mondorestore logs almost everything, so please ");
    2833     log_msg(0,
     2833    mr_msg(0,
    28342834            "don't break out in a cold sweat just because you see a few  ");
    2835     log_msg(0,
     2835    mr_msg(0,
    28362836            "error messages in the log. Read them; analyze them; see if  ");
    2837     log_msg(0,
     2837    mr_msg(0,
    28382838            "they are significant; above all, verify your backups! Please");
    2839     log_msg(0,
     2839    mr_msg(0,
    28402840            "attach a compressed copy of this log to any e-mail you send ");
    2841     log_msg(0,
     2841    mr_msg(0,
    28422842            "to the Mondo mailing list when you are seeking technical    ");
    2843     log_msg(0,
     2843    mr_msg(0,
    28442844            "support. Without it, we can't help you.            - DevTeam");
    2845     log_msg(0,
     2845    mr_msg(0,
    28462846            "------------------------------------------------------------");
    2847     log_msg(0,
     2847    mr_msg(0,
    28482848            "BTW, despite (or perhaps because of) the wealth of messages,");
    2849     log_msg(0,
     2849    mr_msg(0,
    28502850            "some users are inclined to stop reading this log.  If Mondo ");
    2851     log_msg(0,
     2851    mr_msg(0,
    28522852            "stopped for some reason, chances are it's detailed here.    ");
    2853     log_msg(0,
     2853    mr_msg(0,
    28542854            "More than likely there's a message at the very end of this  ");
    2855     log_msg(0,
     2855    mr_msg(0,
    28562856            "log that will tell you what is wrong.  Please read it!      ");
    2857     log_msg(0,
     2857    mr_msg(0,
    28582858            "------------------------------------------------------------");
    28592859}
     
    29062906    {
    29072907        g_text_mode = TRUE;
    2908         log_msg(1, "TEXTONLY MODE");
     2908        mr_msg(1, "TEXTONLY MODE");
    29092909    } else {
    29102910        g_text_mode = FALSE;
     
    29412941    g_kernel_version = get_kernel_version();
    29422942
    2943     log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
     2943    mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
    29442944    if (strlen(g_mountlist_fname) < 3) {
    29452945        fatal_error
     
    29512951    sprintf(tmp, "%s.orig", g_mountlist_fname);
    29522952    if (!does_file_exist(g_mountlist_fname)) {
    2953         log_msg(2,
     2953        mr_msg(2,
    29542954                "%ld: Warning - g_mountlist_fname (%s) does not exist yet",
    29552955                __LINE__, g_mountlist_fname);
     
    29782978    welcome_to_mondorestore();
    29792979    if (bkpinfo->disaster_recovery) {
    2980         log_msg(1, "I am in disaster recovery mode");
     2980        mr_msg(1, "I am in disaster recovery mode");
    29812981    } else {
    2982         log_msg(1, "I am in normal, live mode");
     2982        mr_msg(1, "I am in normal, live mode");
    29832983    }
    29842984
     
    30613061
    30623062    if (argc == 5 && strcmp(argv[1], "--copy") == 0) {
    3063         log_msg(1, "SCORE");
     3063        mr_msg(1, "SCORE");
    30643064        g_loglevel = 10;
    30653065        if (strstr(argv[2], "save")) {
    3066             log_msg(1, "Saving from %s to %s", argv[3], argv[4]);
     3066            mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
    30673067            fin = fopen(argv[3], "r");
    30683068            fout = fopen(argv[4], "w");
     
    31163116//    return(1);
    31173117        }
    3118         log_msg(1, "I am in normal, live mode.");
    3119         log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
     3118        mr_msg(1, "I am in normal, live mode.");
     3119        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
    31203120        mount_boot_if_necessary();  /* for Gentoo users */
    3121         log_msg(2, "Still here.");
     3121        mr_msg(2, "Still here.");
    31223122        if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {
    31233123            g_restoring_live_from_cd = TRUE;
     
    31293129                                                 argv[3], argv[4]);
    31303130        } else {
    3131             log_msg(2, "Calling restore_to_live_filesystem()");
     3131            mr_msg(2, "Calling restore_to_live_filesystem()");
    31323132            retval = restore_to_live_filesystem(bkpinfo);
    31333133        }
    3134         log_msg(2, "Still here. Yay.");
     3134        mr_msg(2, "Still here. Yay.");
    31353135        if (strlen(bkpinfo->tmpdir) > 0) {
    31363136            sprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir);
     
    31413141    } else {
    31423142        /* Disaster recovery mode (must be) */
    3143         log_msg(1, "I must be in disaster recovery mode.");
    3144         log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
     3143        mr_msg(1, "I must be in disaster recovery mode.");
     3144        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
    31453145        if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {
    31463146            log_to_screen("Uh, that hasn't been implemented yet.");
     
    31613161            if (bkpinfo->backup_media_type == nfs
    31623162                && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    3163                 log_msg(1, "Mounting nfs dir");
     3163                mr_msg(1, "Mounting nfs dir");
    31643164                sprintf(bkpinfo->isodir, "/tmp/isodir");
    31653165                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
     
    31773177
    31783178
    3179         log_msg(1, "Send in the clowns.");
     3179        mr_msg(1, "Send in the clowns.");
    31803180
    31813181        if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {
    3182             log_msg(0, "Partitioning only.");
     3182            mr_msg(0, "Partitioning only.");
    31833183            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31843184            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31893189
    31903190        if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {
    3191             log_msg(0, "Formatting only.");
     3191            mr_msg(0, "Formatting only.");
    31923192            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31933193            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31983198
    31993199        if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {
    3200             log_msg(0, "Stopping LVM and RAID");
     3200            mr_msg(0, "Stopping LVM and RAID");
    32013201            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    32023202            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    32813281// g_I_have_just_nuked is set true by nuke_mode() just before it returns
    32823282    if (!system("which post-nuke > /dev/null 2> /dev/null")) {
    3283       log_msg(1, "post-nuke found; find out whether we should run it...");
     3283      mr_msg(1, "post-nuke found; find out whether we should run it...");
    32843284      if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
    32853285        run_postnuke = TRUE;
    3286         log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
     3286        mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
    32873287      } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) {
    32883288        run_postnuke = TRUE;
    3289         log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
     3289        mr_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
    32903290      } else {
    32913291        run_postnuke = FALSE;
    3292         log_msg(1, "No, will not run post-nuke.");
     3292        mr_msg(1, "No, will not run post-nuke.");
    32933293      }
    32943294    } else {
    3295       log_msg(1, "No post-nuke found.");
     3295      mr_msg(1, "No post-nuke found.");
    32963296    }
    32973297    if (run_postnuke) {
     
    33013301          ("Unable to re-mount partitions for post-nuke stuff");
    33023302      } else {
    3303         log_msg(1, "Re-mounted partitions for post-nuke stuff");
     3303        mr_msg(1, "Re-mounted partitions for post-nuke stuff");
    33043304        sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path,
    33053305            retval);
    3306         log_msg(2, "Calling '%s'", tmp);
     3306        mr_msg(2, "Calling '%s'", tmp);
    33073307        if ((res = run_program_and_log_output(tmp, 0))) {
    33083308          log_OS_error(tmp);
    33093309        }
    3310         log_msg(1, "post-nuke returned w/ res=%d", res);
     3310        mr_msg(1, "post-nuke returned w/ res=%d", res);
    33113311      }
    33123312      unmount_all_devices(mountlist);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c

    r1080 r1108  
    7878            sprintf(tmp_ptr,
    7979                    "No CD's left. No biggiefiles left. No prob, Bob.");
    80             log_msg(2, tmp_ptr);
     80            mr_msg(2, tmp_ptr);
    8181            return (0);
    8282        }
     
    9595    strcpy(bigfile_fname_ptr, biggiestruct.filename);
    9696
    97     log_msg(2, "biggiestruct.filename = %s", biggiestruct.filename);
    98     log_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum);
     97    mr_msg(2, "biggiestruct.filename = %s", biggiestruct.filename);
     98    mr_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum);
    9999
    100100    sprintf(tmp_ptr, "Comparing %s", bigfile_fname_ptr);
     
    105105    }
    106106    if (!checksum[0]) {
    107         log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
     107        mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
    108108    }
    109109    if (!strncmp(bigfile_fname_ptr, "/dev/", 5)) {
     
    114114                MNT_RESTORING, bigfile_fname_ptr);
    115115    }
    116     log_msg(2, command_ptr);
     116    mr_msg(2, command_ptr);
    117117    paranoid_system
    118118        ("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null");
     
    123123    } else {
    124124        if (!(fin = fopen("/tmp/md5sum.txt", "r"))) {
    125             log_msg(2,
     125            mr_msg(2,
    126126                    "Unable to open /tmp/md5sum.txt; can't get live checksum");
    127127            original_cksum[0] = '\0';
     
    147147        retval++;
    148148    }
    149     log_msg(1, tmp_ptr);
     149    mr_msg(1, tmp_ptr);
    150150    if (retval) {
    151151        if (!(fout = fopen("/tmp/changed.txt", "a"))) {
     
    188188
    189189    assert(bkpinfo != NULL);
    190     log_msg(1, "Comparing biggiefiles");
     190    mr_msg(1, "Comparing biggiefiles");
    191191
    192192    if (length_of_file(BIGGIELIST) < 6) {
    193         log_msg(1,
     193        mr_msg(1,
    194194                "OK, really teeny-tiny biggielist; not comparing biggiefiles");
    195195        return (0);
     
    197197    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    198198    if (noof_biggiefiles <= 0) {
    199         log_msg(1, "OK, no biggiefiles; not comparing biggiefiles");
     199        mr_msg(1, "OK, no biggiefiles; not comparing biggiefiles");
    200200        return (0);
    201201    }
     
    208208    for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) {
    209209        sprintf(tmp, "Comparing big file #%ld", bigfileno + 1);
    210         log_msg(1, tmp);
     210        mr_msg(1, tmp);
    211211        update_progress_form(tmp);
    212212        res = compare_a_biggiefile(bkpinfo, bigfileno);
     
    341341                "Differences found while processing fileset #%d       ",
    342342                current_tarball_number);
    343         log_msg(1, tmp);
     343        mr_msg(1, tmp);
    344344    }
    345345    unlink(logfile);
     
    421421                       "/archives/slice* > /dev/null 2> /dev/null")
    422422                == 0) {
    423                 log_msg(2, "OK, I think I'm done with tarballs...");
     423                mr_msg(2, "OK, I think I'm done with tarballs...");
    424424                break;
    425425            }
    426             log_msg(2, "OK, I think it's time for another CD...");
     426            mr_msg(2, "OK, I think it's time for another CD...");
    427427            g_current_media_number++;
    428428            sprintf(progress_str, "Comparing with %s #%d ",
     
    603603            log_to_screen(tmp);
    604604
    605             log_msg(2, "calling popup_changelist_from_file()");
     605            mr_msg(2, "calling popup_changelist_from_file()");
    606606            popup_changelist_from_file("/tmp/changed.files");
    607             log_msg(2, "Returning from popup_changelist_from_file()");
     607            mr_msg(2, "Returning from popup_changelist_from_file()");
    608608        }
    609609    } else {
     
    658658    if (length_of_file("/tmp/changed.txt") > 2
    659659        && length_of_file("/tmp/changed.files") > 2) {
    660         log_msg(0,
     660        mr_msg(0,
    661661                "Type 'less /tmp/changed.files' to see which files don't match the archives");
    662         log_msg(2, "Calling popup_changelist_from_file()");
     662        mr_msg(2, "Calling popup_changelist_from_file()");
    663663        popup_changelist_from_file("/tmp/changed.files");
    664         log_msg(2, "Returned from popup_changelist_from_file()");
     664        mr_msg(2, "Returned from popup_changelist_from_file()");
    665665    }
    666666
  • branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c

    r1103 r1108  
    15861586           sizeof(struct raid_device_record));
    15871587    sprintf(title_of_editraidForm_window, "%s", raidrec->raid_device);
    1588     log_msg(2, "Opening newt window");
     1588    mr_msg(2, "Opening newt window");
    15891589    newtOpenWindow(20, 5, 40, 14, title_of_editraidForm_window);
    15901590    for (;;) {
    1591         log_msg(2, "Main loop");
     1591        mr_msg(2, "Main loop");
    15921592        sprintf(title_of_editraidForm_window, "Edit %s",
    15931593                raidrec->raid_device);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1103 r1108  
    207207        || (!does_file_exist(output_mountlist_file)
    208208            && does_file_exist(orig_fname))) {
    209         log_msg(2, "Failed to extract %s and/or %s from ramdisk",
     209        mr_msg(2, "Failed to extract %s and/or %s from ramdisk",
    210210                output_cfg_file, output_mountlist_file);
    211211        retval = 1;
     
    275275            "Checking to see if f=%s, file=%s, is in the list of biggiefiles",
    276276            f, file);
    277     log_msg(2, tmp);
     277    mr_msg(2, tmp);
    278278    sprintf(command, "grep -E '^%s$' %s", file, list_fname);
    279279    res = run_program_and_log_output(command, FALSE);
     
    324324        sprintf(command, "mkdir -p %s", bkpinfo->isodir);
    325325        run_program_and_log_output(command, 5);
    326         log_msg(2, "Setting isodir to %s", bkpinfo->isodir);
     326        mr_msg(2, "Setting isodir to %s", bkpinfo->isodir);
    327327    }
    328328
     
    349349                "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?",
    350350                mount_isodir_command);
    351         log_msg(1, tmp);
     351        mr_msg(1, tmp);
    352352        if (run_program_and_log_output(mount_isodir_command, FALSE)) {
    353353            popup_and_OK
     
    364364    sprintf(tmp, "%s #%d has been mounted via loopback mount",
    365365            media_descriptor_string(bkpinfo->backup_media_type), i);
    366     log_msg(1, tmp);
     366    mr_msg(1, tmp);
    367367    if (i < 0) {
    368368        popup_and_OK
     
    370370        retval = 1;
    371371    }
    372     log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
     372    mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
    373373            bkpinfo->isodir);
    374374    mr_free(mount_isodir_command);
     
    501501    for (lino = 0; lino < mountlist->entries; lino++) {
    502502        if (!strcmp(mountlist->el[lino].device, "/proc")) {
    503             log_msg(1,
     503            mr_msg(1,
    504504                    "Again with the /proc - why is this in your mountlist?");
    505505        } else if (is_this_device_mounted(mountlist->el[lino].device)) {
     
    591591    if (bkpinfo->backup_media_type == tape
    592592        || bkpinfo->backup_media_type == udev) {
    593         log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
     593        mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
    594594        mr_free(mount_cmd);
    595595        return 0;
     
    597597
    598598    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
    599         log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
     599        mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
    600600        mr_free(mount_cmd);
    601601        return (0);
     
    603603
    604604    if (bkpinfo->backup_media_type == nfs) {
    605         log_msg(2, "Mounting for NFS thingy");
    606         log_msg(2, "isodir = %s", bkpinfo->isodir);
     605        mr_msg(2, "Mounting for NFS thingy");
     606        mr_msg(2, "isodir = %s", bkpinfo->isodir);
    607607        if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
    608608            && am_I_in_disaster_recovery_mode()) {
    609609            strcpy(bkpinfo->isodir, "/tmp/isodir");
    610             log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     610            mr_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    611611        }
    612612#ifdef __FreeBSD__
     
    663663
    664664    }
    665     log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
     665    mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
    666666    for (i = 0; i < 2; i++) {
    667667        res = run_program_and_log_output(mount_cmd, FALSE);
     
    669669            break;
    670670        } else {
    671             log_msg(2, "Failed to mount CD-ROM drive.");
     671            mr_msg(2, "Failed to mount CD-ROM drive.");
    672672            sleep(5);
    673673            run_program_and_log_output("sync", FALSE);
     
    675675    }
    676676    if (res) {
    677         log_msg(2, "Failed, despite %d attempts", i);
    678     } else {
    679         log_msg(2, "Mounted CD-ROM drive OK");
     677        mr_msg(2, "Failed, despite %d attempts", i);
     678    } else {
     679        mr_msg(2, "Mounted CD-ROM drive OK");
    680680    }
    681681    mr_free(mount_cmd);
     
    718718    if (!strcmp(mpt, "/1")) {
    719719        strcpy(mountpoint, "/");
    720         log_msg(3, "Mommm! SME is being a dildo!");
     720        mr_msg(3, "Mommm! SME is being a dildo!");
    721721    } else {
    722722        strcpy(mountpoint, mpt);
     
    730730    }
    731731    sprintf(tmp, "Mounting device %s   ", device);
    732     log_msg(1, tmp);
     732    mr_msg(1, tmp);
    733733    if (writeable) {
    734734        strcpy(additional_parameters, "-o rw");
     
    755755        sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device,
    756756                additional_parameters, mountdir, MONDO_LOGFILE);
    757         log_msg(2, "command='%s'", command);
     757        mr_msg(2, "command='%s'", command);
    758758    }
    759759    res = run_program_and_log_output(command, TRUE);
    760760    if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {
    761         log_msg(1, "Re-trying without the fancy extra parameters");
     761        mr_msg(1, "Re-trying without the fancy extra parameters");
    762762        sprintf(command, "mount -t %s %s %s 2>> %s", format, device,
    763763                mountdir, MONDO_LOGFILE);
     
    765765    }
    766766    if (res) {
    767         log_msg(1, "Unable to mount device %s (type %s) at %s", device,
     767        mr_msg(1, "Unable to mount device %s (type %s) at %s", device,
    768768                format, mountdir);
    769         log_msg(1, "command was '%s'", command);
     769        mr_msg(1, "command was '%s'", command);
    770770        if (!strcmp(mountpoint, "swap")) {
    771771            log_to_screen(tmp);
    772772        } else {
    773             log_msg(2, "Retrying w/o the '-t' switch");
     773            mr_msg(2, "Retrying w/o the '-t' switch");
    774774            sprintf(command, "mount %s %s 2>> %s", device, mountdir,
    775775                    MONDO_LOGFILE);
    776             log_msg(2, "2nd command = '%s'", command);
     776            mr_msg(2, "2nd command = '%s'", command);
    777777            res = run_program_and_log_output(command, TRUE);
    778778            if (res == 0) {
    779                 log_msg(1,
     779                mr_msg(1,
    780780                        "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");
    781781            } else {
     
    785785    }
    786786    if (res && !strcmp(mountpoint, "swap")) {
    787         log_msg(2, "That's ok. It's just a swap partition.");
    788         log_msg(2, "Non-fatal error. Returning 0.");
     787        mr_msg(2, "That's ok. It's just a swap partition.");
     788        mr_msg(2, "Non-fatal error. Returning 0.");
    789789        res = 0;
    790790    }
     
    898898                /* Check to see if CD is already mounted before mounting it... */
    899899                if (!is_this_device_mounted("/dev/cdrom")) {
    900                     log_msg(2,
     900                    mr_msg(2,
    901901                            "NB: CDROM device not mounted, mounting...");
    902902                    run_program_and_log_output("mount /dev/cdrom "
     
    959959            sprintf(tmp, "Backup medium is TAPE --- dev=%s",
    960960                    bkpinfo->media_device);
    961             log_msg(2, tmp);
     961            mr_msg(2, tmp);
    962962        } else {
    963963            strcpy(bkpinfo->media_device, "/dev/cdrom");    /* we don't really need this var */
    964964            bkpinfo->media_size[0] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    965965            bkpinfo->media_size[1] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    966             log_msg(2, "Backup medium is CD-R[W]");
    967         }
    968     } else {
    969         log_msg(2,
     966            mr_msg(2, "Backup medium is CD-R[W]");
     967        }
     968    } else {
     969        mr_msg(2,
    970970                "Not in Disaster Recovery Mode. No need to derive device name from config file.");
    971971    }
     
    974974    if (strstr(value, "yes")) {
    975975        bkpinfo->use_star = TRUE;
    976         log_msg(1, "Goody! ... bkpinfo->use_star is now true.");
     976        mr_msg(1, "Goody! ... bkpinfo->use_star is now true.");
    977977    }
    978978
     
    980980    if (strstr(value, "yes")) {
    981981        mr_asprintf(&g_getfacl,"setfacl");
    982         log_msg(1, "We will restore ACLs");
     982        mr_msg(1, "We will restore ACLs");
    983983        if (! find_home_of_exe("setfacl")) {
    984             log_msg(1, "Unable to restore ACLs as no setfacl found");
     984            mr_msg(1, "Unable to restore ACLs as no setfacl found");
    985985        }
    986986    }
     
    988988    if (strstr(value, "yes")) {
    989989        mr_asprintf(&g_getfattr,"setfattr");
    990         log_msg(1, "We will restore XATTRs");
     990        mr_msg(1, "We will restore XATTRs");
    991991        if (! find_home_of_exe("setfattr")) {
    992             log_msg(1, "Unable to restore XATTRs as no setfattr found");
     992            mr_msg(1, "Unable to restore XATTRs as no setfattr found");
    993993        }
    994994    }
     
    996996    if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) {
    997997        bkpinfo->internal_tape_block_size = atol(value);
    998         log_msg(1, "Internal tape block size has been custom-set to %ld",
     998        mr_msg(1, "Internal tape block size has been custom-set to %ld",
    999999                bkpinfo->internal_tape_block_size);
    10001000    } else {
    10011001        bkpinfo->internal_tape_block_size =
    10021002            DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
    1003         log_msg(1, "Internal tape block size = default (%ld)",
     1003        mr_msg(1, "Internal tape block size = default (%ld)",
    10041004                DEFAULT_INTERNAL_TAPE_BLOCK_SIZE);
    10051005    }
     
    10361036        bkpinfo->differential = TRUE;
    10371037    }
    1038     log_msg(2, "differential var = '%s'", value);
     1038    mr_msg(2, "differential var = '%s'", value);
    10391039    if (bkpinfo->differential) {
    1040         log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
    1041     } else {
    1042         log_msg(2, "This is a regular (full) backup");
     1040        mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
     1041    } else {
     1042        mr_msg(2, "This is a regular (full) backup");
    10431043    }
    10441044
     
    10491049               ("cat /proc/cmdline"), "donteject")) {
    10501050        bkpinfo->please_dont_eject = TRUE;
    1051         log_msg(2, "Ok, I shan't eject when restoring! Groovy.");
     1051        mr_msg(2, "Ok, I shan't eject when restoring! Groovy.");
    10521052    }
    10531053
    10541054    if (bkpinfo->backup_media_type == nfs) {
    10551055        if (!cfgf) {
    1056             log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    1057             log_msg(2, "nfs_remote_dir remains %s",
     1056            mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
     1057            mr_msg(2, "nfs_remote_dir remains %s",
    10581058                    bkpinfo->nfs_remote_dir);
    1059             log_msg(2,
     1059            mr_msg(2,
    10601060                    "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    10611061        } else {
     
    10641064            read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
    10651065                         bkpinfo->nfs_remote_dir);
    1066             log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
    1067             log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
     1066            mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
     1067            mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    10681068        }
    10691069        if (strstr(call_program_and_get_last_line_of_output
     
    11031103        }
    11041104        read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
    1105         log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
     1105        mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
    11061106                g_isodir_device);
    11071107        if (bkpinfo->disaster_recovery) {
    11081108            if (is_this_device_mounted(g_isodir_device)) {
    1109                 log_msg(2, "NB: isodir is already mounted");
     1109                mr_msg(2, "NB: isodir is already mounted");
    11101110                /* Find out where it's mounted */
    11111111                sprintf(command,
     
    11231123                sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt);
    11241124                if (run_program_and_log_output(tmp, 3)) {
    1125                     log_msg(1,
     1125                    mr_msg(1,
    11261126                            "Unable to mount isodir. Perhaps this is really a CD backup?");
    11271127                    bkpinfo->backup_media_type = cdr;
     
    11321132                            ("Unable to mount isodir. Failed to mount CD-ROM as well.");
    11331133                    } else {
    1134                         log_msg(1,
     1134                        mr_msg(1,
    11351135                                "You backed up to disk, then burned some CDs.");
    11361136                    }
     
    11471147        if (g_restoring_live_from_cd) {
    11481148            if (bkpinfo->backup_media_type != media_specified_by_user) {
    1149                 log_msg(2,
     1149                mr_msg(2,
    11501150                        "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    11511151                interactively_obtain_media_parameters_from_user(bkpinfo,
     
    12061206    if (does_file_exist(g_filelist_full)
    12071207        && does_file_exist(g_biggielist_txt)) {
    1208         log_msg(1, "%s exists", g_filelist_full);
    1209         log_msg(1, "%s exists", g_biggielist_txt);
    1210         log_msg(2,
     1208        mr_msg(1, "%s exists", g_filelist_full);
     1209        mr_msg(1, "%s exists", g_biggielist_txt);
     1210        mr_msg(2,
    12111211                "Filelist and biggielist already recovered from media. Yay!");
    12121212    } else {
    12131213        getcwd(tmp, MAX_STR_LEN);
    12141214        chdir(bkpinfo->tmpdir);
    1215         log_msg(1, "chdir(%s)", bkpinfo->tmpdir);
     1215        mr_msg(1, "chdir(%s)", bkpinfo->tmpdir);
    12161216        log_to_screen("Extracting filelist and biggielist from media...");
    12171217        unlink("/tmp/filelist.full");
     
    12261226                    FILELIST_FULL_STUB,
    12271227                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    1228             log_msg(1, "tarcommand = %s", command);
     1228            mr_msg(1, "tarcommand = %s", command);
    12291229            run_program_and_log_output(command, 1);
    12301230        } else {
    1231             log_msg(2,
     1231            mr_msg(2,
    12321232                    "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    12331233                    bkpinfo->isodir);
    12341234            insist_on_this_cd_number(bkpinfo, 1);
    1235             log_msg(2, "Back from iotcn");
     1235            mr_msg(2, "Back from iotcn");
    12361236            run_program_and_log_output("mount", 1);
    12371237            sprintf(command,
     
    12431243                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    12441244
    1245             log_msg(1, "tarcommand = %s", command);
     1245            mr_msg(1, "tarcommand = %s", command);
    12461246            run_program_and_log_output(command, 1);
    12471247//    popup_and_OK("Press ENTER to continue");
     
    12611261        sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir,
    12621262                BIGGIELIST_TXT_STUB, g_biggielist_txt);
    1263         log_msg(1, "command = %s", command);
     1263        mr_msg(1, "command = %s", command);
    12641264        paranoid_system(command);
    12651265        sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir,
    12661266                FILELIST_FULL_STUB, g_filelist_full);
    1267         log_msg(1, "command = %s", command);
     1267        mr_msg(1, "command = %s", command);
    12681268        paranoid_system(command);
    12691269    }
     
    12821282
    12831283    if (!does_file_exist(g_biggielist_txt)) {
    1284         log_msg(1, "Warning - %s not found", g_biggielist_txt);
     1284        mr_msg(1, "Warning - %s not found", g_biggielist_txt);
    12851285    }
    12861286    if (!does_file_exist(g_filelist_full)) {
    1287         log_msg(1, "Warning - %s does not exist", g_filelist_full);
     1287        mr_msg(1, "Warning - %s does not exist", g_filelist_full);
    12881288    }
    12891289//  popup_and_OK("Wonderful.");
    12901290
    1291     log_msg(2, "Forking");
     1291    mr_msg(2, "Forking");
    12921292    pid = fork();
    12931293    switch (pid) {
     
    13171317    close_evalcall_form();
    13181318
    1319     log_msg(3, "loading filelist");
     1319    mr_msg(3, "loading filelist");
    13201320    filelist = load_filelist(g_filelist_full);
    1321     log_msg(3, "deleting original filelist");
     1321    mr_msg(3, "deleting original filelist");
    13221322    unlink(g_filelist_full);
    13231323    if (g_text_mode) {
     
    13341334    }
    13351335    if (res) {
    1336         log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
     1336        mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
    13371337        free_filelist(filelist);
    13381338        return (NULL);
     
    14181418    read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);
    14191419    sprintf(tmp, "run_boot_loader: device='%s', name='%s'", device, name);
    1420     log_msg(2, tmp);
     1420    mr_msg(2, tmp);
    14211421    system("sync");
    14221422    if (!strcmp(name, "LILO")) {
     
    14321432//      else
    14331433//        {
    1434 //    log_msg(1, "Not running run_grub(). Was a bad idea anyway.");
     1434//    mr_msg(1, "Not running run_grub(). Was a bad idea anyway.");
    14351435//    res = 1;
    14361436//  }
     
    14481448            res = run_program_and_log_output(tmp, 3);
    14491449        } else {
    1450             log_msg(1,
     1450            mr_msg(1,
    14511451                    "I'm not running any boot loader. You have a DD boot drive. It's already loaded up.");
    14521452        }
     
    14971497    }
    14981498    if (!find_home_of_exe(output)) {
    1499         log_msg(2, " (find_my_editor) --- warning - %s not found", output);
     1499        mr_msg(2, " (find_my_editor) --- warning - %s not found", output);
    15001500    }
    15011501    return (output);
     
    15351535
    15361536    if (!run_program_and_log_output("which grub-MR", FALSE)) {
    1537         log_msg(1, "Yay! grub-MR found...");
     1537        mr_msg(1, "Yay! grub-MR found...");
    15381538        sprintf(command, "grub-MR %s /tmp/mountlist.txt", boot_device);
    1539         log_msg(1, "command = %s", command);
     1539        mr_msg(1, "command = %s", command);
    15401540    } else {
    15411541        sprintf(command, "chroot " MNT_RESTORING " grub-install %s",
    15421542                boot_device);
    1543         log_msg(1, "WARNING - grub-MR not found; using grub-install");
     1543        mr_msg(1, "WARNING - grub-MR not found; using grub-install");
    15441544    }
    15451545    if (offer_to_run_stabgrub
     
    15991599        log_to_screen
    16001600            ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.");
    1601         log_msg(1, "Type:-");
    1602         log_msg(1, "    mount-me");
    1603         log_msg(1, "    chroot " MNT_RESTORING);
    1604         log_msg(1, "    mount /boot");
    1605         log_msg(1, "    grub-install '(hd0)'");
    1606         log_msg(1, "    exit");
    1607         log_msg(1, "    unmount-me");
    1608         log_msg(1,
     1601        mr_msg(1, "Type:-");
     1602        mr_msg(1, "    mount-me");
     1603        mr_msg(1, "    chroot " MNT_RESTORING);
     1604        mr_msg(1, "    mount /boot");
     1605        mr_msg(1, "    grub-install '(hd0)'");
     1606        mr_msg(1, "    exit");
     1607        mr_msg(1, "    unmount-me");
     1608        mr_msg(1,
    16091609                "If you're really stuck, please e-mail the mailing list.");
    16101610    } else {
     
    18321832    strcpy(boot_device, bd);
    18331833    sprintf(command, "raw-MR %s /tmp/mountlist.txt", boot_device);
    1834     log_msg(2, "run_raw_mbr() --- command='%s'", command);
     1834    mr_msg(2, "run_raw_mbr() --- command='%s'", command);
    18351835
    18361836    if (offer_to_hack_scripts
     
    20662066void termination_in_progress(int sig)
    20672067{
    2068     log_msg(1, "Termination in progress");
     2068    mr_msg(1, "Termination in progress");
    20692069    usleep(1000);
    20702070    pthread_exit(0);
     
    21132113         i++) {
    21142114        sleep(1);
    2115         log_msg(2, "Waiting for buffer() to finish");
     2115        mr_msg(2, "Waiting for buffer() to finish");
    21162116    }
    21172117
     
    21202120    if (run_program_and_log_output
    21212121        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) {
    2122         log_msg(1,
     2122        mr_msg(1,
    21232123                "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)");
    21242124    }
    21252125    if (run_program_and_log_output
    21262126        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) {
    2127         log_msg(1,
     2127        mr_msg(1,
    21282128                "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)");
    21292129    }
     
    21452145                if (!strcmp(mountlist->el[lino].mountpoint, "/1")) {
    21462146                    sprintf(command, "umount %s/", MNT_RESTORING);
    2147                     log_msg(3,
     2147                    mr_msg(3,
    21482148                            "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight...");
    21492149                } else {
     
    21522152                }
    21532153            }
    2154             log_msg(10, "The 'umount' command is '%s'", command);
     2154            mr_msg(10, "The 'umount' command is '%s'", command);
    21552155            res = run_program_and_log_output(command, 3);
    21562156        } else {
     
    21642164            log_to_screen(tmp);
    21652165        } else {
    2166             log_msg(2, tmp);
     2166            mr_msg(2, tmp);
    21672167        }
    21682168    }
     
    22132213            MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB,
    22142214            BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");
    2215     log_msg(2, "command = '%s'", command);
     2215    mr_msg(2, "command = '%s'", command);
    22162216    res = run_program_and_log_output(command, -1);
    22172217    if (res != 0 && does_file_exist(MONDO_CFG_FILE_STUB)) {
     
    22582258    malloc_string(command);
    22592259    malloc_string(tmp);
    2260     log_msg(2, "gcffa --- starting");
     2260    mr_msg(2, "gcffa --- starting");
    22612261    log_to_screen("I'm thinking...");
    22622262    sprintf(mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir);
     
    22782278    //   make_hole_for_file( cfg_file );
    22792279    //   make_hole_for_file( mountlist_file);
    2280     log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
     2280    mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
    22812281
    22822282    /* Floppy? */
     
    22902290            "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &",
    22912291            command);
    2292     log_msg(1, "tmp = '%s'", tmp);
     2292    mr_msg(1, "tmp = '%s'", tmp);
    22932293    system(tmp);
    22942294    res = run_program_and_log_output(command, FALSE);
     
    23012301    } else {
    23022302        try_plan_B = TRUE;
    2303         log_msg(2,
     2303        mr_msg(2,
    23042304                "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does.");
    23052305// NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK.
    2306         log_msg(2, "Processing floppy (plan A?)");
     2306        mr_msg(2, "Processing floppy (plan A?)");
    23072307        sprintf(ramdisk_fname, "%s/mindi.rdz", mountpt);
    23082308        if (!does_file_exist(ramdisk_fname)) {
     
    23102310        }
    23112311        if (!does_file_exist(ramdisk_fname)) {
    2312             log_msg(2,
     2312            mr_msg(2,
    23132313                    "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    23142314        }
    23152315        if (extract_config_file_from_ramdisk
    23162316            (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) {
    2317             log_msg(2,
     2317            mr_msg(2,
    23182318                    "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
    23192319        }
     
    23232323    }
    23242324    if (!does_file_exist(cfg_file)) {
    2325         log_msg(2, "gcffa --- we don't have cfg file yet.");
     2325        mr_msg(2, "gcffa --- we don't have cfg file yet.");
    23262326        if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    23272327            try_plan_B = TRUE;
    23282328        } else {
    2329             log_msg(2, "gcffa --- calling mount_cdrom now :)");
     2329            mr_msg(2, "gcffa --- calling mount_cdrom now :)");
    23302330            if (!mount_cdrom(bkpinfo)) {
    2331                 log_msg(2,
     2331                mr_msg(2,
    23322332                        "gcffa --- managed to mount CD; so, no need for Plan B");
    23332333                try_plan_B = FALSE;
     
    23412341        }
    23422342        if (try_plan_B) {
    2343             log_msg(2, "gcffa --- OK, switching to Plan B");
     2343            mr_msg(2, "gcffa --- OK, switching to Plan B");
    23442344            chdir(bkpinfo->tmpdir);
    23452345            run_program_and_log_output("mkdir -p tmp", FALSE);
     
    23472347            if (strlen(bkpinfo->media_device) == 0) {
    23482348                strcpy(bkpinfo->media_device, "/dev/st0");
    2349                 log_msg(2, "media_device is blank; assuming %s");
     2349                mr_msg(2, "media_device is blank; assuming %s");
    23502350            }
    23512351            strcpy(tmp, bkpinfo->media_device);
     
    23612361                        if (extract_cfg_file_and_mountlist_from_tape_dev
    23622362                            (bkpinfo->media_device)) {
    2363                             log_msg(3,
     2363                            mr_msg(3,
    23642364                                    "I tried lots of devices but none worked.");
    23652365                            strcpy(bkpinfo->media_device, tmp);
     
    23742374            }
    23752375        } else {
    2376             log_msg(2,
     2376            mr_msg(2,
    23772377                    "gcffa --- looking at mounted CD for mindi-boot.2880.img");
    23782378            sprintf(command,
     
    23812381            sprintf(mounted_cfgf_path, "%s/%s", mountpt, cfg_file);
    23822382            if (!does_file_exist(mounted_cfgf_path)) {
    2383                 log_msg(2,
     2383                mr_msg(2,
    23842384                        "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz");
    23852385                sprintf(command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");  // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
     
    23932393    }
    23942394    if (does_file_exist(MONDO_CFG_FILE_STUB)) {
    2395         log_msg(1, "gcffa --- great! We've got the config file");
     2395        mr_msg(1, "gcffa --- great! We've got the config file");
    23962396        sprintf(tmp, "%s/%s",
    23972397                call_program_and_get_last_line_of_output("pwd"),
     
    24012401        if (strcmp(tmp, cfg_file)
    24022402            && run_program_and_log_output(command, 1)) {
    2403             log_msg(1,
     2403            mr_msg(1,
    24042404                    "... but an error occurred when I tried to move it to %s",
    24052405                    cfg_file);
    24062406        } else {
    2407             log_msg(1, "... and I moved it successfully to %s", cfg_file);
     2407            mr_msg(1, "... and I moved it successfully to %s", cfg_file);
    24082408        }
    24092409        sprintf(command, "cp -f %s/%s %s",
     
    24132413        if (strcmp(tmp, cfg_file)
    24142414            && run_program_and_log_output(command, 1)) {
    2415             log_msg(1, "Failed to get mountlist");
     2415            mr_msg(1, "Failed to get mountlist");
    24162416        } else {
    2417             log_msg(1, "Got mountlist too");
     2417            mr_msg(1, "Got mountlist too");
    24182418            sprintf(command, "cp -f %s %s", mountlist_file,
    24192419                    g_mountlist_fname);
    24202420            if (run_program_and_log_output(command, 1)) {
    2421                 log_msg(1, "Failed to copy mountlist to /tmp");
     2421                mr_msg(1, "Failed to copy mountlist to /tmp");
    24222422            } else {
    2423                 log_msg(1, "Copied mountlist to /tmp as well OK");
     2423                mr_msg(1, "Copied mountlist to /tmp as well OK");
    24242424                sprintf(command, "cp -f tmp/i-want-my-lvm /tmp/");
    24252425                run_program_and_log_output(command, 1);
     
    24272427          if (!run_program_and_log_output(command, 5) && !does_file_exist("/tmp/i-want-my-lvm"))
    24282428            {
    2429           log_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME.");
     2429          mr_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME.");
    24302430        }
    24312431              else if (run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm"))
    24322432                {
    2433           log_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool.");
     2433          mr_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool.");
    24342434              do_my_funky_lvm_stuff(TRUE, FALSE); // ...after I stop any LVMs :)
    24352435          stop_raid_device("/dev/md0");
     
    24402440          else if (!run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm"))
    24412441            {
    2442           log_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME.");
     2442          mr_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME.");
    24432443        }
    24442444*/
     
    24492449    if (!does_file_exist(cfg_file)) {
    24502450        iamhere(cfg_file);
    2451         log_msg(1, "%s not found", cfg_file);
     2451        mr_msg(1, "%s not found", cfg_file);
    24522452        log_to_screen
    24532453            ("Oh dear. Unable to recover configuration file from boot disk");
     
    25292529        if (parse_mdstat(raidlist, "/dev/")) {
    25302530            log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
    2531             log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
     2531            mr_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
    25322532            return;
    25332533        }
     
    25392539                    continue;
    25402540                }
    2541                 log_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);
     2541                mr_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);
    25422542                sprintf(screen_message, "Sync'ing %s",
    25432543                        raidlist->el[i].raid_device);
    25442544                open_evalcall_form(screen_message);
    25452545                while (raidlist->el[i].progress < wait_for_percentage) {
    2546                     log_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);
     2546                    mr_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);
    25472547                    update_evalcall_form(raidlist->el[i].progress);
    25482548                    sleep(2);
Note: See TracChangeset for help on using the changeset viewer.