Changeset 1086 in MondoRescue for trunk/mondo


Ignore:
Timestamp:
Feb 2, 2007, 11:21:27 PM (17 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg in trunk

Location:
trunk/mondo/src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/common/libmondo-archive.c

    r1081 r1086  
    142142
    143143    if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) {
    144         log_msg(3, "Failed to delete semaphore");
     144        mr_msg(3, "Failed to delete semaphore");
    145145    }
    146146}
     
    159159    sem_b.sem_flg = SEM_UNDO;
    160160    if (semop(g_sem_id, &sem_b, 1) == -1) {
    161         log_msg(3, "semaphore_p failed");
     161        mr_msg(3, "semaphore_p failed");
    162162        return (0);
    163163    }
     
    177177    sem_b.sem_flg = SEM_UNDO;
    178178    if (semop(g_sem_id, &sem_b, 1) == -1) {
    179         log_msg(3, "semaphore_v failed");
     179        mr_msg(3, "semaphore_v failed");
    180180        return (0);
    181181    }
     
    237237    mr_free(command);
    238238    command = tmp;
    239     log_msg(4, "command = '%s'", command);
     239    mr_msg(4, "command = '%s'", command);
    240240
    241241    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    242         log_msg(5, "command='%s'", command);
     242        mr_msg(5, "command='%s'", command);
    243243        res = system(command);
    244244        tmp = last_line_of_file(MONDO_LOGFILE);
    245         log_msg(1, "res=%d; tmp='%s'", res, tmp);
     245        mr_msg(1, "res=%d; tmp='%s'", res, tmp);
    246246        if (bkpinfo->use_star && (res == 254 || res == 65024)
    247247            && strstr(tmp, "star: Processed all possible files")
    248248            && tries > 0) {
    249             log_msg(1, "Star returned nonfatal error");
     249            mr_msg(1, "Star returned nonfatal error");
    250250            res = 0;
    251251        }
     
    256256            if (p) {
    257257                p[0] = p[1] = p[2] = p[3] = ' ';
    258                 log_msg(1, "new command = '%s'", command);
     258                mr_msg(1, "new command = '%s'", command);
    259259            } else {
    260                 log_msg(3,
     260                mr_msg(3,
    261261                        "Attempt #%d failed. Pausing 3 seconds and retrying...",
    262262                        tries + 1);
     
    269269    retval += res;
    270270    if (retval) {
    271         log_msg(3, "Failed to write set %d", setno);
     271        mr_msg(3, "Failed to write set %d", setno);
    272272    } else if (tries > 1) {
    273         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     273        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    274274                tries);
    275275    }
     
    348348        } else {
    349349            mr_asprintf(&zipparams, " ");
    350             log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
     350            mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
    351351        }
    352352        mr_free(tmp);
     
    381381
    382382    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    383         log_msg(5, "command='%s'", command);
     383        mr_msg(5, "command='%s'", command);
    384384        res = system(command);
    385385        if (res) {
    386386            log_OS_error(command);
    387             log_msg(3,
     387            mr_msg(3,
    388388                    "Attempt #%d failed. Pausing 3 seconds and retrying...",
    389389                    tries + 1);
     
    395395    retval += res;
    396396    if (retval) {
    397         log_msg(3, "Failed to write set %d", setno);
     397        mr_msg(3, "Failed to write set %d", setno);
    398398    } else if (tries > 1) {
    399         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     399        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    400400                tries);
    401401    }
     
    410410            if (free_ramdisk_space > i) {
    411411                free_ramdisk_space = i;
    412                 log_msg(2, "min(free_ramdisk_space) is now %d",
     412                mr_msg(2, "min(free_ramdisk_space) is now %d",
    413413                        free_ramdisk_space);
    414414                if (free_ramdisk_space < 10) {
     
    507507    retval += make_those_slices_phase(bkpinfo); // backup BIG files
    508508    retval += do_that_final_phase(bkpinfo); // clean up
    509     log_msg(1, "Creation of archives... complete.");
     509    mr_msg(1, "Creation of archives... complete.");
    510510    if (bkpinfo->verify_data) {
    511511        sleep(2);
     
    581581    mr_free(tmp);
    582582    mr_asprintf(&tmp, "devs_to_exclude = '%s'", devs_to_exclude);
    583     log_msg(2, tmp);
     583    mr_msg(2, tmp);
    584584    mr_free(tmp);
    585585    mvaddstr_and_log_it(g_currentY, 0,
     
    673673            mr_asprintf(&tmp, "User specified boot loader. It is '%c'.",
    674674                     bkpinfo->boot_loader);
    675             log_msg(2, tmp);
     675            mr_msg(2, tmp);
    676676            mr_free(tmp);
    677677        } else {
     
    681681            mr_asprintf(&tmp, "User specified boot device. It is '%s'.",
    682682                     bkpinfo->boot_device);
    683             log_msg(2, tmp);
     683            mr_msg(2, tmp);
    684684            mr_free(tmp);
    685685            mr_free(bootdev);
     
    759759    mr_asprintf(&tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir);
    760760    if (write_one_liner_data_file(tmp, bkpinfo->boot_device)) {
    761         log_msg(1, "%ld: Unable to write one-liner boot device", __LINE__);
     761        mr_msg(1, "%ld: Unable to write one-liner boot device", __LINE__);
    762762    }
    763763    mr_free(tmp);
     
    797797    if (write_one_liner_data_file(tmp, value)) {
    798798        res++;
    799         log_msg(1, "%ld: Unable to write one-liner backup-media-type",
     799        mr_msg(1, "%ld: Unable to write one-liner backup-media-type",
    800800                __LINE__);
    801801    }
     
    806806    if (write_one_liner_data_file(tmp, bootldr_str)) {
    807807        res++;
    808         log_msg(1, "%ld: Unable to write one-liner bootloader.name",
     808        mr_msg(1, "%ld: Unable to write one-liner bootloader.name",
    809809                __LINE__);
    810810    }
     
    822822        mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
    823823        if (write_one_liner_data_file(tmp1, "TRUE")) {
    824             log_msg(1, "%ld: Unable to write one-liner XATTR",
     824            mr_msg(1, "%ld: Unable to write one-liner XATTR",
    825825                __LINE__);
    826826        }
     
    830830        mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
    831831        if (write_one_liner_data_file(tmp1, "TRUE")) {
    832             log_msg(1, "%ld: Unable to write one-liner ACL",
     832            mr_msg(1, "%ld: Unable to write one-liner ACL",
    833833                __LINE__);
    834834        }
     
    857857    mr_free(tmp);
    858858
    859     log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);
     859    mr_msg(1, "lines_in_filelist = %ld", lines_in_filelist);
    860860
    861861    if (bkpinfo->backup_media_type == usb) {
     
    911911    mr_free(tmp2);
    912912
    913     log_msg(2, command);
     913    mr_msg(2, command);
    914914
    915915    //  popup_and_OK("Pausing");
     
    924924        log_to_screen("Boot+data disks were created OK");
    925925        mr_asprintf(&command, "mkdir -p /var/cache/mindi/");
    926         log_msg(2, command);
     926        mr_msg(2, command);
    927927        run_program_and_log_output(command, FALSE);
    928928        mr_free(command);
     
    931931                 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
    932932                 bkpinfo->scratchdir);
    933         log_msg(2, command);
     933        mr_msg(2, command);
    934934        run_program_and_log_output(command, FALSE);
    935935        mr_free(command);
     
    945945        mr_asprintf(&command, "cp -f %s/mindi-*oot*.img %s/images",
    946946                 bkpinfo->tmpdir, bkpinfo->scratchdir);
    947         log_msg(2, command);
     947        mr_msg(2, command);
    948948        run_program_and_log_output(command, FALSE);
    949949        mr_free(command);
     
    10471047        }
    10481048        if (!semaphore_p()) {
    1049             log_msg(3, "P sem failed (pid=%d)", (int) getpid());
     1049            mr_msg(3, "P sem failed (pid=%d)", (int) getpid());
    10501050            fatal_error("Cannot get semaphore P");
    10511051        }
     
    10641064                 bkpinfo->tmpdir, archiving_set_no);
    10651065        if (!does_file_exist(archiving_filelist_fname)) {
    1066             log_msg(3,
     1066            mr_msg(3,
    10671067                    "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.",
    10681068                    FORTY_SPACES, getpid(), this_thread_no,
     
    10761076                 archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix);
    10771077        if (does_file_exist(tmp)) {
    1078             log_msg(4, "%s[%d:%d] - waiting for storer",
     1078            mr_msg(4, "%s[%d:%d] - waiting for storer",
    10791079                    FORTY_SPACES, getpid(), this_thread_no);
    10801080            while (does_file_exist(tmp)) {
    10811081                sleep(1);
    10821082            }
    1083             log_msg(4, "[%d] - continuing", getpid());
     1083            mr_msg(4, "[%d] - continuing", getpid());
    10841084        }
    10851085        mr_free(tmp);
    10861086
    1087         log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
     1087        mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
    10881088                this_thread_no, archiving_set_no);
    10891089        if (g_getfattr) {
     
    11001100        }
    11011101
    1102         log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
     1102        mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
    11031103                this_thread_no, archiving_set_no);
    11041104        res = archive_this_fileset(bkpinfo, archiving_filelist_fname,
     
    11291129            fatal_error("Cannot get semaphore V");
    11301130        }
    1131         log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
     1131        mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
    11321132                this_thread_no, archiving_set_no);
    11331133        archiving_set_no++;
     
    11421142        fatal_error("Cannot get semaphore V");
    11431143    }
    1144     log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
     1144    mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
    11451145            this_thread_no);
    11461146    mr_free(archiving_filelist_fname);
     
    11711171                        "Writing any remaining data to media         ");
    11721172
    1173     log_msg(1, "Closing tape/CD ... ");
     1173    mr_msg(1, "Closing tape/CD ... ");
    11741174    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    11751175        /* write tape/cdstream */
     
    11801180        retval += res;
    11811181        if (res) {
    1182             log_msg(1, "write_final_iso_if_necessary returned an error");
    1183         }
    1184     }
    1185     log_msg(2, "Fork is exiting ... ");
     1182            mr_msg(1, "write_final_iso_if_necessary returned an error");
     1183        }
     1184    }
     1185    mr_msg(2, "Fork is exiting ... ");
    11861186
    11871187    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    12341234    mr_free(g_serial_string);
    12351235    g_serial_string = tmp;
    1236     log_msg(2, "g_serial_string = '%s'", g_serial_string);
     1236    mr_msg(2, "g_serial_string = '%s'", g_serial_string);
    12371237
    12381238    mr_asprintf(&tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir);
    12391239    if (write_one_liner_data_file(tmpfile, g_serial_string)) {
    1240         log_msg(1, "%ld: Failed to write serial string", __LINE__);
     1240        mr_msg(1, "%ld: Failed to write serial string", __LINE__);
    12411241    }
    12421242    mr_free(g_serial_string);
     
    12531253            fatal_error("Cannot open backup (streaming) device");
    12541254        }
    1255         log_msg(1, "Backup (stream) opened OK");
     1255        mr_msg(1, "Backup (stream) opened OK");
    12561256        write_data_disks_to_stream(data_disks_file);
    12571257    } else {
    1258         log_msg(1, "Backing up to CD's");
     1258        mr_msg(1, "Backing up to CD's");
    12591259    }
    12601260    mr_free(data_disks_file);
     
    13241324    mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile,
    13251325             tempfile, tempfile);
    1326     log_msg(3, command);
     1326    mr_msg(3, command);
    13271327    open_evalcall_form(title);
    13281328    if (!(pin = popen(command, "r"))) {
     
    13401340        trackno = get_trackno_from_logfile(tempfile);
    13411341        if (trackno < 0 || trackno > 80) {
    1342             log_msg(1, "Weird track#");
     1342            mr_msg(1, "Weird track#");
    13431343            continue;
    13441344        }
     
    14811481    int misc_counter_that_is_not_important = 0;
    14821482
    1483     log_msg(8, "here");
     1483    mr_msg(8, "here");
    14841484    assert(bkpinfo != NULL);
    14851485    /* BERLIOS: To be removed */
     
    15011501    *p_next_set_to_archive = 0;
    15021502    log_to_screen("Archiving regular files");
    1503     log_msg(5, "Go, Shorty. It's your birthday.");
     1503    mr_msg(5, "Go, Shorty. It's your birthday.");
    15041504    open_progress_form(_("Backing up filesystem"),
    15051505                       _("I am backing up your live filesystem now."),
     
    15081508                       get_last_filelist_number(bkpinfo) + 1);
    15091509
    1510     log_msg(5, "We're gonna party like it's your birthday.");
     1510    mr_msg(5, "We're gonna party like it's your birthday.");
    15111511
    15121512    srand((unsigned int) getpid());
     
    15211521    }                           // initialize semaphore
    15221522    for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) {
    1523         log_msg(8, "Creating thread #%d", noof_threads);
     1523        mr_msg(8, "Creating thread #%d", noof_threads);
    15241524        (*p_archival_threads_running)++;
    15251525        if ((res =
     
    15311531    }
    15321532
    1533     log_msg(8, "About to enter while() loop");
     1533    mr_msg(8, "About to enter while() loop");
    15341534    while (!done_storing) {
    15351535        if (g_exiting) {
     
    15381538        if (*p_archival_threads_running == 0
    15391539            && *p_last_set_archived == storing_set_no - 1) {
    1540             log_msg(2,
     1540            mr_msg(2,
    15411541                    "No archival threads are running. The last stored set was %d and I'm looking for %d. Take off your make-up; the party's over... :-)",
    15421542                    *p_last_set_archived, storing_set_no);
     
    15721572            }
    15731573
    1574             log_msg(2, "Storing set %d", storing_set_no);
     1574            mr_msg(2, "Storing set %d", storing_set_no);
    15751575            while (!does_file_exist(storing_filelist_fname)
    15761576                   || !does_file_exist(storing_afioball_fname)) {
    1577                 log_msg(2,
     1577                mr_msg(2,
    15781578                        "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.",
    15791579                        storing_filelist_fname, storing_afioball_fname);
     
    16441644    close_progress_form();
    16451645
    1646     log_msg(2, "Joining background threads to foreground thread");
     1646    mr_msg(2, "Joining background threads to foreground thread");
    16471647    for (i = 0; i < noof_threads; i++) {
    16481648        pthread_join(archival_thread[i], pvp);
    1649         log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
     1649        mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
    16501650    }
    16511651    del_semvalue();
    1652     log_msg(2, "Done.");
     1652    mr_msg(2, "Done.");
    16531653    if (retval) {
    16541654        mr_asprintf(&tmp,
     
    17341734    }
    17351735
    1736     log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
     1736    mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
    17371737            bkpinfo->scratchdir, destfile);
    17381738    /* BERLIOS: Do not ignore getcwd result */
     
    17591759
    17601760    if (bkpinfo->call_make_iso != NULL) {
    1761         log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
     1761        mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
    17621762        mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir);
    17631763        mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)",
     
    18081808                mr_asprintf(&sz_blank_disk, "dvd+rw-format -force %s",
    18091809                         bkpinfo->media_device);
    1810                 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
     1810                mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
    18111811                res = run_external_binary_with_percentage_indicator_NEW
    18121812                    ("Blanking DVD disk", sz_blank_disk);
     
    18621862                 bkpinfo->backup_media_string,
    18631863                 g_current_media_number);
    1864         log_msg(1, message_to_screen);
     1864        mr_msg(1, message_to_screen);
    18651865        mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ",
    18661866                 bkpinfo->backup_media_string,
    18671867                 g_current_media_number);
    18681868        if (bkpinfo->nonbootable_backup) {
    1869             log_msg(1, "Making nonbootable backup");
     1869            mr_msg(1, "Making nonbootable backup");
    18701870// FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end
    18711871            res = eval_call_to_make_ISO(bkpinfo,
     
    18741874                                        MONDO_LOGFILE, message_to_screen);
    18751875        } else {
    1876             log_msg(1, "Making bootable backup");
     1876            mr_msg(1, "Making bootable backup");
    18771877
    18781878#ifdef __FreeBSD__
     
    18811881
    18821882
    1883             log_msg(1, "make_cd_use_lilo is actually %d",
     1883            mr_msg(1, "make_cd_use_lilo is actually %d",
    18841884                    bkpinfo->make_cd_use_lilo);
    18851885            if (bkpinfo->make_cd_use_lilo) {
    1886                 log_msg(1, "make_cd_use_lilo = TRUE");
     1886                mr_msg(1, "make_cd_use_lilo = TRUE");
    18871887// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    18881888// and add ' .' at end
    18891889#ifdef __IA64__
    1890                 log_msg(1, "IA64 --> elilo");
     1890                mr_msg(1, "IA64 --> elilo");
    18911891                mr_asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size);
    18921892                res = eval_call_to_make_ISO(bkpinfo,
     
    19001900// and add ' .' at end
    19011901                mr_free(tmp2);
    1902                 log_msg(1, "Non-ia64 --> lilo");
     1902                mr_msg(1, "Non-ia64 --> lilo");
    19031903                res = eval_call_to_make_ISO(bkpinfo,
    19041904                                            "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     
    19091909#endif
    19101910            } else {
    1911                 log_msg(1, "make_cd_use_lilo = FALSE");
    1912                 log_msg(1, "Isolinux");
     1911                mr_msg(1, "make_cd_use_lilo = FALSE");
     1912                mr_msg(1, "Isolinux");
    19131913                res = eval_call_to_make_ISO(bkpinfo,
    19141914                                            "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     
    19321932        || bkpinfo->backup_media_type == cdrw) {
    19331933        if (is_this_device_mounted(bkpinfo->media_device)) {
    1934             log_msg(2,
     1934            mr_msg(2,
    19351935                    "Warning - %s mounted. I'm unmounting it before I burn to it.",
    19361936                    bkpinfo->media_device);
     
    19421942
    19431943    if (bkpinfo->call_burn_iso != NULL) {
    1944         log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
     1944        mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
    19451945        mr_asprintf(&message_to_screen, "Burning %s #%d",
    19461946                 bkpinfo->backup_media_string,
     
    19771977    chdir(old_pwd);
    19781978    if (retval) {
    1979         log_msg(1, "WARNING - make_iso_fs returned an error");
     1979        mr_msg(1, "WARNING - make_iso_fs returned an error");
    19801980    }
    19811981    mr_free(old_pwd);
     
    19921992             "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1",
    19931993             bigfile_fname);
    1994     log_msg(1, "command = '%s'", command);
     1994    mr_msg(1, "command = '%s'", command);
    19951995    tmp = call_program_and_get_last_line_of_output(command);
    1996     log_msg(1, "--> tmp = '%s'", tmp);
     1996    mr_msg(1, "--> tmp = '%s'", tmp);
    19971997    mr_free(command);
    19981998    if (strstr(tmp, "NTFS")) {
     
    20552055        size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
    20562056
    2057     log_msg(1, "size of all biggiefiles = %ld",
     2057    mr_msg(1, "size of all biggiefiles = %ld",
    20582058            size_of_all_biggiefiles_K(bkpinfo));
    2059     log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
     2059    mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
    20602060            size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size,
    20612061            estimated_total_noof_slices);
    20622062
    20632063    if (length_of_file(biggielist_fname) < 6) {
    2064         log_msg(1, "No biggiefiles; fair enough...");
     2064        mr_msg(1, "No biggiefiles; fair enough...");
    20652065        return (0);
    20662066    }
     
    20952095            // Call ntfsclone (formerly partimagehack) if it's a /dev entry
    20962096            // (i.e. a partition to be imaged)
    2097             log_msg(2, "bigfile_fname = %s", bigfile_fname);
     2097            mr_msg(2, "bigfile_fname = %s", bigfile_fname);
    20982098            use_ntfsprog = FALSE;
    20992099            if (!strncmp(bigfile_fname, "/dev/", 5)
    21002100                && is_dev_an_NTFS_dev(bigfile_fname)) {
    21012101                use_ntfsprog = TRUE;
    2102                 log_msg(2,
     2102                mr_msg(2,
    21032103                        "Calling ntfsclone in background because %s is an NTFS partition",
    21042104                        bigfile_fname);
     
    21132113                    fatal_error("Fork failure");
    21142114                case 0:
    2115                     log_msg(2,
     2115                    mr_msg(2,
    21162116                            "CHILD - fip - calling feed_into_ntfsprog(%s, %s)",
    21172117                            bigfile_fname, sz_devfile);
     
    21202120                    break;
    21212121                default:
    2122                     log_msg(2,
     2122                    mr_msg(2,
    21232123                            "feed_into_ntfsprog() called in background --- pid=%ld",
    21242124                            (long int) (pid));
     
    21332133
    21342134            // Whether partition or biggiefile, just do your thang :-)
    2135             log_msg(2, "Bigfile #%ld is '%s' (%ld KB)",
     2135            mr_msg(2, "Bigfile #%ld is '%s' (%ld KB)",
    21362136                    biggie_file_number + 1, bigfile_fname,
    21372137                    (long) biggie_fsize >> 10);
     
    21802180    paranoid_fclose(fin);
    21812181
    2182     log_msg(1, "Finished backing up bigfiles");
    2183     log_msg(1, "estimated slices = %ld; actual slices = %ld",
     2182    mr_msg(1, "Finished backing up bigfiles");
     2183    mr_msg(1, "estimated slices = %ld; actual slices = %ld",
    21842184            estimated_total_noof_slices, g_current_progress);
    21852185    close_progress_form();
     
    22292229                 bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix);
    22302230
    2231         log_msg(1, "EXAT'g set %ld", curr_set_no);
     2231        mr_msg(1, "EXAT'g set %ld", curr_set_no);
    22322232        if (g_getfattr) {
    22332233            mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     
    22412241        }
    22422242
    2243         log_msg(1, "Archiving set %ld", curr_set_no);
     2243        mr_msg(1, "Archiving set %ld", curr_set_no);
    22442244        res = archive_this_fileset(bkpinfo, curr_filelist_fname,
    22452245                                   curr_afioball_fname, curr_set_no);
     
    23492349                                     BLK_START_AFIOBALLS);
    23502350#if __FreeBSD__ == 5
    2351         log_msg(1,
     2351        mr_msg(1,
    23522352                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    23532353        res = make_afioballs_and_images_OLD(bkpinfo);
     
    23642364    if (res) {
    23652365        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    2366         log_msg(1, "make_afioballs_and_images returned an error");
     2366        mr_msg(1, "make_afioballs_and_images returned an error");
    23672367    } else {
    23682368        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    24132413
    24142414    mr_asprintf(&blah, "biggielist = %s", biggielist);
    2415     log_msg(2, blah);
     2415    mr_msg(2, blah);
    24162416    mr_free(blah);
    24172417
    24182418    if (!does_file_exist(biggielist)) {
    2419         log_msg(1, "BTW, the biggielist does not exist");
     2419        mr_msg(1, "BTW, the biggielist does not exist");
    24202420    }
    24212421
     
    24572457    retval += res;
    24582458    if (res) {
    2459         log_msg(1, "make_slices_and_images returned an error");
     2459        mr_msg(1, "make_slices_and_images returned an error");
    24602460        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    24612461    } else {
     
    25192519        mr_asprintf(&curr_file, "%s", cf);
    25202520        if (!does_file_exist(curr_file)) {
    2521             log_msg(1,
     2521            mr_msg(1,
    25222522                    "Warning - you're trying to add a non-existent file - '%s' to the CD",
    25232523                    curr_file);
    25242524        } else {
    2525             log_msg(8, "Trying to add file %s to CD", curr_file);
     2525            mr_msg(8, "Trying to add file %s to CD", curr_file);
    25262526            would_occupy += length_of_file(curr_file) / 1024;
    25272527        }
     
    25382538        retval += res;
    25392539        if (res) {
    2540             log_msg(1, "WARNING - write_iso_and_go_on returned an error");
     2540            mr_msg(1, "WARNING - write_iso_and_go_on returned an error");
    25412541        }
    25422542    }
     
    25542554        retval += res;
    25552555        if (res) {
    2556             log_msg(1, "(move_files_to_cd) '%s' failed", tmp);
     2556            mr_msg(1, "(move_files_to_cd) '%s' failed", tmp);
    25572557        } else {
    2558             log_msg(8, "Moved %s to CD OK", tmp);
     2558            mr_msg(8, "Moved %s to CD OK", tmp);
    25592559        }
    25602560        mr_free(tmp);
     
    25652565
    25662566    if (retval) {
    2567         log_msg(1,
     2567        mr_msg(1,
    25682568                "Warning - errors occurred while I was adding files to CD dir");
    25692569    }
     
    26212621        mr_asprintf(&bootdisk_dev, "/dev/fd0H1722");
    26222622    } else {
    2623         log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
     2623        mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
    26242624        mr_asprintf(&bootdisk_dev, DEFAULT_1722MB_DISK);
    26252625    }
    26262626    mr_asprintf(&datadisk_dev, "%s", "/dev/fd0");
    26272627    if (!does_device_exist(datadisk_dev)) {
    2628         log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
     2628        mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
    26292629        mr_free(datadisk_dev);
    26302630        mr_asprintf(&datadisk_dev, "%s", "/dev/fd0");
     
    26862686                }
    26872687                mr_asprintf(&tmp, "cat %s > %s", rootdisk_file, datadisk_dev);
    2688                 log_msg(1, "tmp = '%s'", tmp);
     2688                mr_msg(1, "tmp = '%s'", tmp);
    26892689                res +=
    26902690                    run_external_binary_with_percentage_indicator_NEW
     
    27072707    for (i = 1; i < 99; i++) {
    27082708        mr_asprintf(&tmp, "%s/mindi-data-%d.img", imagesdir, i);
    2709         log_msg(3, tmp);
     2709        mr_msg(3, tmp);
    27102710        if (!does_file_exist(tmp)) {
    2711             log_msg(3, "...not found");
     2711            mr_msg(3, "...not found");
    27122712            break;
    27132713        }
     
    28302830        mr_asprintf(&curr_file, "%s", cf);
    28312831        if (!does_file_exist(curr_file)) {
    2832             log_msg(1,
     2832            mr_msg(1,
    28332833                    "Warning - you're trying to add a non-existent file - '%s' to the tape",
    28342834                    curr_file);
     
    28582858
    28592859    if (retval) {
    2860         log_msg(1,
     2860        mr_msg(1,
    28612861                "Warning - errors occurred while I was adding file to tape");
    28622862    }
     
    28902890        } else {
    28912891            mr_asprintf(&cdrecord, " ");
    2892             log_msg(2, "Found no cdrecord nor dvdrecord in path.");
     2892            mr_msg(2, "Found no cdrecord nor dvdrecord in path.");
    28932893        }
    28942894        if (cdrecord[0]) {
     
    29442944    if (cdrom_dev != NULL) {
    29452945/* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird
    2946       log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
     2946      mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
    29472947      retract_CD_tray_and_defeat_autorun();
    29482948*/
     
    29572957        if ((attempt_to_mount_returned_this =
    29582958             run_program_and_log_output(tmp, 1))) {
    2959             log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
     2959            mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
    29602960            log_to_screen("If there's a CD/DVD in the drive, it's blank.");
    29612961            mr_asprintf(&our_serial_str, "%s", "");
     
    29842984        mr_free(szunmount);
    29852985
    2986         log_msg(2, "paafcd: cd_number = %d", cd_number);
    2987         log_msg(2, "our serial str = %s; g_serial_string = %s",
     2986        mr_msg(2, "paafcd: cd_number = %d", cd_number);
     2987        mr_msg(2, "our serial str = %s; g_serial_string = %s",
    29882988                our_serial_str, g_serial_string);
    29892989        if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) {
    2990             log_msg(2, "This %s is part of this backup set!",
     2990            mr_msg(2, "This %s is part of this backup set!",
    29912991                    g_backup_media_string);
    29922992            ok_go_ahead_burn_it = FALSE;
     
    30053005        mr_free(our_serial_str);
    30063006    } else {
    3007         log_msg(2,
     3007        mr_msg(2,
    30083008                "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?",
    30093009                g_backup_media_string);
     
    30283028        goto gotos_make_me_puke;
    30293029    } else {
    3030         log_msg(2, "paafcd: OK, going ahead and burning it.");
     3030        mr_msg(2, "paafcd: OK, going ahead and burning it.");
    30313031    }
    30323032    mr_free(cdrom_dev);
    30333033
    3034     log_msg(2,
     3034    mr_msg(2,
    30353035            "paafcd: OK, I assume I have a blank/reusable %s in the drive...",
    30363036            g_backup_media_string);
     
    31613161        file_to_openin = ntfsprog_fifo;
    31623162        mr_asprintf(&checksum_line, "IGNORE");
    3163         log_msg(2,
     3163        mr_msg(2,
    31643164                "Not calculating checksum for %s: it would take too long",
    31653165                biggie_filename);
     
    32213221    paranoid_fclose(fout);
    32223222    length = totallength / optimal_set_size / 1024;
    3223     log_msg(1, "Opening in %s; slicing it and writing to CD/tape",
     3223    mr_msg(1, "Opening in %s; slicing it and writing to CD/tape",
    32243224            file_to_openin);
    32253225    if (!(fin = fopen(file_to_openin, "r"))) {
     
    32793279        {
    32803280            if (!does_file_exist(curr_slice_fname_uncompressed)) {
    3281                 log_msg(2,
     3281                mr_msg(2,
    32823282                        "Warning - '%s' doesn't exist. How can I compress slice?",
    32833283                        curr_slice_fname_uncompressed);
     
    32873287                         bkpinfo->compression_level,
    32883288                         curr_slice_fname_uncompressed);
    3289                 log_msg(2, command);
     3289                mr_msg(2, command);
    32903290                if ((res = system(command))) {
    32913291                    log_OS_error(command);
     
    33033303            retval += res;
    33043304            if (res) {
    3305                 log_msg(2, "Failed to compress the slice");
     3305                mr_msg(2, "Failed to compress the slice");
    33063306            }
    33073307            if (bkpinfo->use_lzo
     
    33233323                newtRefresh();
    33243324            } else {
    3325                 log_msg(2, tmp);
     3325                mr_msg(2, tmp);
    33263326            }
    33273327#else
    3328             log_msg(2, tmp);
     3328            mr_msg(2, tmp);
    33293329#endif
    33303330            mr_free(tmp);
     
    33733373                 biggie_file_number + 1);
    33743374    }
    3375     log_msg(1, tmp);
     3375    mr_msg(1, tmp);
    33763376    mr_free(tmp);
    33773377    return (retval);
     
    34213421    mr_free(tmp);
    34223422
    3423     log_msg(1, "Wiped %s's archives", dir);
     3423    mr_msg(1, "Wiped %s's archives", dir);
    34243424    mr_asprintf(&tmp, "ls -l %s", dir);
    34253425    run_program_and_log_output(tmp, FALSE);
     
    34573457
    34583458    mr_asprintf(&tmp, "Writing the final ISO");
    3459     log_msg(2, tmp);
     3459    mr_msg(2, tmp);
    34603460    /* BERLIOS: center_string is now broken
    34613461       center_string(tmp, 80);
     
    34733473    }
    34743474#endif
    3475     log_msg(2, "Returning from writing final ISO (res=%d)", res);
     3475    mr_msg(2, "Returning from writing final ISO (res=%d)", res);
    34763476    return (res);
    34773477}
     
    35253525        using_nfs = FALSE;
    35263526    }
    3527     log_msg(1, "OK, time to make %s #%d",
     3527    mr_msg(1, "OK, time to make %s #%d",
    35283528            bkpinfo->backup_media_string,
    35293529            g_current_media_number);
     
    35413541             bkpinfo->scratchdir);
    35423542    if (run_program_and_log_output(tmp, FALSE)) {
    3543         log_msg(2, "Warning - unable to copy autorun to scratchdir");
     3543        mr_msg(2, "Warning - unable to copy autorun to scratchdir");
    35443544    }
    35453545    mr_free(tmp);
     
    35503550    if (last_cd) {
    35513551        unlink(lastcd_fname);
    3552         log_msg(2,
     3552        mr_msg(2,
    35533553                "OK, you're telling me this is the last CD. Fair enough.");
    35543554    } else {
     
    35793579            if ((tmp = find_cdrom_device(FALSE)) == NULL)   // make sure find_cdrom_device() finds, records CD-R's loc
    35803580            {
    3581                 log_msg(3, "*Sigh* Mike, I hate your computer.");
     3581                mr_msg(3, "*Sigh* Mike, I hate your computer.");
    35823582                bkpinfo->manual_cd_tray = TRUE;
    35833583            }                   // if it can't be found then force pausing
    35843584            else {
    3585                 log_msg(3, "Great. Found Mike's CD-ROM drive.");
     3585                mr_msg(3, "Great. Found Mike's CD-ROM drive.");
    35863586                mr_free(tmp);
    35873587            }
     
    36113611                }
    36123612            } else {
    3613                 log_msg(2, "Retrying, at user's request...");
     3613                mr_msg(2, "Retrying, at user's request...");
    36143614                res = 0;
    36153615            }
     
    36343634             bkpinfo->scratchdir, bkpinfo->scratchdir);
    36353635    if (system(tmp)) {
    3636         log_msg(2,
     3636        mr_msg(2,
    36373637                "Error occurred when I tried to delete the redundant IMGs and GZs");
    36383638    }
     
    36403640
    36413641    if (last_cd) {
    3642         log_msg(2, "This was your last CD.");
    3643     } else {
    3644         log_msg(2, "Continuing to backup your data...");
     3642        mr_msg(2, "This was your last CD.");
     3643    } else {
     3644        mr_msg(2, "Continuing to backup your data...");
    36453645    }
    36463646
     
    36823682        //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr))
    36833683    {
    3684         log_msg(2,
     3684        mr_msg(2,
    36853685                "Not verifying again. Per-CD/ISO verification already carried out.");
    36863686        paranoid_system
     
    36943694        for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) {
    36953695            if (cdno != g_current_media_number) {
    3696                 log_msg(2,
     3696                mr_msg(2,
    36973697                        "Warning - had to change g_current_media_number from %d to %d",
    36983698                        g_current_media_number, cdno);
     
    37873787    }
    37883788    mr_asprintf(&tmp, "maxblocks = %d; p=%s", maxblocks, p);
    3789     log_msg(2, tmp);
     3789    mr_msg(2, tmp);
    37903790    mr_free(tmp);
    37913791
     
    38033803        if (fread(blk, 1, 1024, fin) != 1024) {
    38043804            if (feof(fin)) {
    3805                 log_msg(1,
     3805                mr_msg(1,
    38063806                        "img read err - img ended prematurely - non-fatal error");
    38073807                sleep(3);
  • trunk/mondo/src/common/libmondo-devices.c

    r1079 r1086  
    133133    }
    134134
    135     log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,
     135    mr_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,
    136136            mountpoint);
    137137    /*@ end vars *************************************************** */
     
    145145#endif
    146146
    147     log_msg(4, command);
     147    mr_msg(4, command);
    148148    if (strncmp(device, "/dev/", 5) == 0) {
    149149        retract_CD_tray_and_defeat_autorun();
    150150    }
    151151    retval = system(command);
    152     log_msg(1, "system(%s) returned %d", command, retval);
     152    mr_msg(1, "system(%s) returned %d", command, retval);
    153153    mr_free(command);
    154154
     
    174174    mr_asprintf(&tmp, where_is_root_mounted());
    175175    mr_asprintf(&comment, "root is mounted at %s\n", tmp);
    176     log_msg(0, comment);
     176    mr_msg(0, comment);
    177177    mr_free(comment);
    178178
    179     log_msg(0,
     179    mr_msg(0,
    180180            "No, Schlomo, that doesn't mean %s is the root partition. It's just a debugging message. Relax. It's part of am_I_in_disaster_recovery_mode().",
    181181            tmp);
     
    208208        is_this_a_ramdisk = TRUE;
    209209    }
    210     log_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);
     210    mr_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);
    211211    return (is_this_a_ramdisk);
    212212}
     
    291291#endif
    292292
    293     log_msg(3, "Ejecting %s", dev);
     293    mr_msg(3, "Ejecting %s", dev);
    294294    res2 = run_program_and_log_output(command, 1);
    295295    mr_free(command);
     
    543543    }
    544544    if (res) {
    545         log_msg(1, _("mount failed"));
    546     } else {
    547         log_msg(1, _("mount succeeded with %s"), dev);
     545        mr_msg(1, _("mount failed"));
     546    } else {
     547        mr_msg(1, _("mount succeeded with %s"), dev);
    548548    }
    549549    mr_free(dev);
     
    568568    if (g_cdrw_drive_is_here != NULL) {
    569569        mr_asprintf(&cdrw_device, g_cdrw_drive_is_here);
    570         log_msg(3, "Been there, done that. Returning %s", cdrw_device);
     570        mr_msg(3, "Been there, done that. Returning %s", cdrw_device);
    571571        return(cdrw_device);
    572572    }
    573573    if (g_backup_media_type == dvd) {
    574         log_msg(1,
     574        mr_msg(1,
    575575                "This is dumb. You're calling find_cdrw_device() but you're backing up to DVD. WTF?");
    576576        return(NULL);
     
    652652    if ((g_cdrom_drive_is_here != NULL) && !isdigit(g_cdrom_drive_is_here[0])) {
    653653        mr_asprintf(&output, g_cdrom_drive_is_here);
    654         log_msg(3, "Been there, done that. Returning %s", output);
     654        mr_msg(3, "Been there, done that. Returning %s", output);
    655655        return(output);
    656656    }
    657657    if ((the_last_place_i_found_it != NULL) && !try_to_mount) {
    658658        mr_asprintf(&output, the_last_place_i_found_it);
    659         log_msg(3,
     659        mr_msg(3,
    660660                "find_cdrom_device() --- returning last found location - '%s'",
    661661                output);
     
    674674    if (!tmp) {
    675675        mr_asprintf(&output, "/dev/cdrom");
    676         log_msg(4, "Can't find cdrecord; assuming %s", output);
     676        mr_msg(4, "Can't find cdrecord; assuming %s", output);
    677677        if (!does_device_exist(output)) {
    678             log_msg(4, "That didn't work. Sorry.");
     678            mr_msg(4, "That didn't work. Sorry.");
    679679            mr_free(cdr_exe);
    680680            mr_free(output);
     
    690690    fin = popen(command, "r");
    691691    if (!fin) {
    692         log_msg(4, "command=%s", command);
     692        mr_msg(4, "command=%s", command);
    693693        log_OS_error("Cannot popen command");
    694694        mr_free(cdr_exe);
     
    730730#ifndef __FreeBSD__
    731731    if (strlen(phrase_two) == 0) {
    732         log_msg(4, "Not running phase two. String is empty.");
     732        mr_msg(4, "Not running phase two. String is empty.");
    733733    } else {
    734734        mr_asprintf(&command, "dmesg | grep \"%s\" 2> /dev/null", phrase_two);
    735735        fin = popen(command, "r");
    736736        if (!fin) {
    737             log_msg(4, "Cannot run 2nd command - non-fatal, fortunately");
     737            mr_msg(4, "Cannot run 2nd command - non-fatal, fortunately");
    738738        } else {
    739739            for (mr_getline(&tmp, &n, fin); !feof(fin);
    740740                 mr_getline(&tmp, &n, fin)) {
    741                 log_msg(5, "--> '%s'", tmp);
     741                mr_msg(5, "--> '%s'", tmp);
    742742                if (tmp[0] != ' ' && tmp[1] != ' ') {
    743743                    p = strchr(tmp, ':');
     
    747747                            mr_free(dvd_last_resort);
    748748                            mr_asprintf(&dvd_last_resort, "/dev/%s", tmp);
    749                             log_msg(4,
     749                            mr_msg(4,
    750750                                    "Ignoring '%s' because it's a DVD drive",
    751751                                    tmp);
     
    767767#ifdef __FreeBSD__
    768768    if (!found_it) {
    769         log_msg(4, "OK, approach 2");
     769        mr_msg(4, "OK, approach 2");
    770770        if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) {
    771771            if (!
     
    804804    if (dvd_last_resort != NULL) {
    805805        if (!found_it && strlen(dvd_last_resort) > 0) {
    806             log_msg(4, "Well, I'll use the DVD - %s - as a last resort",
     806            mr_msg(4, "Well, I'll use the DVD - %s - as a last resort",
    807807                    dvd_last_resort);
    808808            mr_free(output);
     
    817817                strrchr(output, '/') + 1);
    818818        if (system(tmp) == 0) {
    819             log_msg(4,
     819            mr_msg(4,
    820820                    "%s is not right. It's being SCSI-emulated. Continuing.",
    821821                    output);
     
    827827
    828828    if (found_it) {
    829         log_msg(4, "(find_cdrom_device) --> '%s'", output);
     829        mr_msg(4, "(find_cdrom_device) --> '%s'", output);
    830830        if (!does_device_exist(output)) {
    831             log_msg(4, "OK, I was wrong, I haven't found it... yet.");
     831            mr_msg(4, "OK, I was wrong, I haven't found it... yet.");
    832832            found_it = FALSE;
    833833            mr_free(output);
     
    836836
    837837    if (!found_it) {
    838         log_msg(4, "OK, approach 2");
     838        mr_msg(4, "OK, approach 2");
    839839        if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/scd0"))) {
    840840            if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/sr0"))) {
     
    882882    if (found_it && try_to_mount) {
    883883        if (! mount_CDROM_here(output, mountpoint)) {
    884             log_msg(4, "[Cardigans] I've changed my mind");
     884            mr_msg(4, "[Cardigans] I've changed my mind");
    885885            found_it = FALSE;
    886886            mr_free(output);
     
    888888            mr_asprintf(&tmp, "%s/archives", mountpoint);
    889889            if (!does_file_exist(tmp)) {
    890                 log_msg(4, "[Cardigans] I'll take it back");
     890                mr_msg(4, "[Cardigans] I'll take it back");
    891891                found_it = FALSE;
    892892                mr_free(output);
     
    895895                paranoid_system(command);
    896896                mr_free(command);
    897                 log_msg(4, "I'm confident the Mondo CD is in %s", output);
     897                mr_msg(4, "I'm confident the Mondo CD is in %s", output);
    898898            }
    899899            mr_free(tmp);
     
    905905    if (found_it) {
    906906        if (!does_file_exist(output)) {
    907             log_msg(3, "I still haven't found it.");
     907            mr_msg(3, "I still haven't found it.");
    908908            mr_free(output);
    909909            return(NULL);
    910910        }
    911         log_msg(3, "(find_cdrom_device) --> '%s'", output);
     911        mr_msg(3, "(find_cdrom_device) --> '%s'", output);
    912912        mr_asprintf(&the_last_place_i_found_it, output);
    913913        mr_free(g_cdrom_drive_is_here);
     
    921921    mr_free(cdr_exe);
    922922
    923     log_msg(1, "command=%s", command);
     923    mr_msg(1, "command=%s", command);
    924924    mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    925925    mr_free(command);
     
    927927    if (tmp[0]) {
    928928        output = tmp;
    929         log_msg(4, "Finally found it at %s", output);
     929        mr_msg(4, "Finally found it at %s", output);
    930930    } else {
    931931        mr_free(tmp);
    932932        mr_free(output);
    933         log_msg(4, "Still couldn't find it.");
     933        mr_msg(4, "Still couldn't find it.");
    934934    }
    935935    return(output);
     
    945945    if (g_dvd_drive_is_here != NULL) {
    946946        mr_asprintf(&output, g_dvd_drive_is_here);
    947         log_msg(3, "Been there, done that. Returning %s", output);
     947        mr_msg(3, "Been there, done that. Returning %s", output);
    948948        return (output);
    949949    }
     
    952952            ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1")
    953953        );
    954     log_msg(5, "tmp = '%s'", tmp);
     954    mr_msg(5, "tmp = '%s'", tmp);
    955955    if (!tmp[0]) {
    956956        mr_free(tmp);
     
    969969        mr_free(g_dvd_drive_is_here);
    970970        mr_asprintf(&g_dvd_drive_is_here, output);
    971         log_msg(2, "I think DVD is at %s", output);
    972     } else {
    973         log_msg(2, "I cannot find DVD");
     971        mr_msg(2, "I think DVD is at %s", output);
     972    } else {
     973        mr_msg(2, "I cannot find DVD");
    974974    }
    975975
     
    10321032
    10331033    if (outvalB <= 0) {
    1034         log_msg(1, "Error getting size of %s: %s", drive, strerror(errno));
     1034        mr_msg(1, "Error getting size of %s: %s", drive, strerror(errno));
    10351035#if linux
    10361036    fileid = open(drive, O_RDONLY);
     
    10411041                cylindersize = hdgeo.heads * hdgeo.sectors / 2;
    10421042                outvalA = cylindersize * cylinders / 1024;
    1043                 log_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",
     1043                mr_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",
    10441044                        hdgeo.cylinders, hdgeo.heads, hdgeo.sectors);
    10451045                gotgeo = 1;
    10461046            } else {
    1047                 log_msg(1, "Harddisk geometry wrong");
     1047                mr_msg(1, "Harddisk geometry wrong");
    10481048            }
    10491049        } else {
    1050             log_msg(1,
     1050            mr_msg(1,
    10511051                    "Error in ioctl() getting new hard disk geometry (%s), resizing in unsafe mode",
    10521052                    strerror(errno));
     
    10541054        close(fileid);
    10551055    } else {
    1056         log_msg(1, "Failed to open %s for reading: %s", drive,
     1056        mr_msg(1, "Failed to open %s for reading: %s", drive,
    10571057                strerror(errno));
    10581058    }
    10591059    if (!gotgeo) {
    1060         log_msg(1, "Failed to get harddisk geometry, using old mode");
     1060        mr_msg(1, "Failed to get harddisk geometry, using old mode");
    10611061    }
    10621062#endif
     
    10671067    outvalC = (outvalA > outvalB) ? outvalA : outvalB;
    10681068
    1069 //  log_msg (5, "drive = %s, error = %s", drive, strerror (errno));
     1069//  mr_msg (5, "drive = %s, error = %s", drive, strerror (errno));
    10701070//  fatal_error ("GPSOD: Unable to get size of drive");
    1071     log_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,
     1071    mr_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,
    10721072            outvalC);
    10731073
     
    11641164//  assert_string_is_neither_NULL_nor_zerolength(device_raw);
    11651165    if (device_raw[0] != '/' && !strstr(device_raw, ":/")) {
    1166         log_msg(1, "%s needs to have a '/' prefixed - I'll do it",
     1166        mr_msg(1, "%s needs to have a '/' prefixed - I'll do it",
    11671167                device_raw);
    11681168        mr_asprintf(&tmp, "/%s", device_raw);
     
    11701170        mr_asprintf(&tmp, device_raw);
    11711171    }
    1172     log_msg(1, "Is %s mounted?", tmp);
     1172    mr_msg(1, "Is %s mounted?", tmp);
    11731173    if (!strcmp(tmp, "/proc") || !strcmp(tmp, "proc")) {
    1174         log_msg(1,
     1174        mr_msg(1,
    11751175                "I don't know how the heck /proc made it into the mountlist. I'll ignore it.");
    11761176        return (FALSE);
     
    12011201    mr_free(device_with_space);
    12021202
    1203     log_msg(4, "tmp (command) = '%s'", tmp);
     1203    mr_msg(4, "tmp (command) = '%s'", tmp);
    12041204    if (!system(tmp)) {
    12051205        mr_free(tmp);
     
    13211321    assert(cd_number_i_want > 0);
    13221322
    1323 //  log_msg(3, "Insisting on CD number %d", cd_number_i_want);
     1323//  mr_msg(3, "Insisting on CD number %d", cd_number_i_want);
    13241324
    13251325    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1326         log_msg(3,
     1326        mr_msg(3,
    13271327                "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO");
    13281328        return;
     
    13351335    if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso
    13361336        || bkpinfo->backup_media_type == nfs) {
    1337         log_msg(3, "Remounting CD");
     1337        mr_msg(3, "Remounting CD");
    13381338        g_ISO_restore_mode = TRUE;
    13391339// FIXME --- I'm tempted to do something about this...
     
    13521352                    cd_number_i_want);
    13531353            if (does_file_exist(tmp)) {
    1354                 log_msg(1,
     1354                mr_msg(1,
    13551355                        "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir",
    13561356                        bkpinfo->isodir);
     
    13581358            }
    13591359        }
    1360         log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
     1360        mr_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
    13611361        if (! mount_CDROM_here(tmp, MNT_CDROM)) {
    13621362            fatal_error("Mommy!");
     
    13651365    }
    13661366    if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) {
    1367         log_msg(3, "Currently, we hold %d but we want %d", res,
     1367        mr_msg(3, "Currently, we hold %d but we want %d", res,
    13681368                cd_number_i_want);
    13691369        mr_asprintf(&tmp, "Insisting on %s #%d",
     
    13731373                bkpinfo->backup_media_string,
    13741374                cd_number_i_want);
    1375         log_msg(3, tmp);
     1375        mr_msg(3, tmp);
    13761376        mr_free(tmp);
    13771377
     
    14031403        mr_free(request);
    14041404
    1405         log_msg(1, "Thankyou. Proceeding...");
     1405        mr_msg(1, "Thankyou. Proceeding...");
    14061406        g_current_media_number = cd_number_i_want;
    14071407    }
     
    14521452    }
    14531453    bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type);
    1454     log_msg(3, "media type = %s",bkpinfo->backup_media_string);
     1454    mr_msg(3, "media type = %s",bkpinfo->backup_media_string);
    14551455
    14561456    if (archiving_to_media) {
     
    14901490                mr_asprintf(&tmp, "1");
    14911491                mr_asprintf(&sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    1492                 log_msg(1, "Setting to DVD defaults");
     1492                mr_msg(1, "Setting to DVD defaults");
    14931493            } else if (bkpinfo->backup_media_type == usb) {
    14941494                strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE);
     
    14981498                mr_asprintf(&tmp, "4");
    14991499                mr_asprintf(&sz_size, "650");
    1500                 log_msg(1, "Setting to CD defaults");
     1500                mr_msg(1, "Setting to CD defaults");
    15011501            }
    15021502            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
     
    15341534        if (bkpinfo->disaster_recovery) {
    15351535            mr_allocstr(bkpinfo->media_device, "/dev/cdrom");
    1536             log_msg(2, "CD-ROM device assumed to be at %s",
     1536            mr_msg(2, "CD-ROM device assumed to be at %s",
    15371537                    bkpinfo->media_device);
    15381538        } else if (bkpinfo->restore_data
     
    15411541                mr_asprintf(&bkpinfo->media_device, "/dev/cdrom");
    15421542            }                   // just for the heck of it :)
    1543             log_msg(1, "bkpinfo->media_device = %s",
     1543            mr_msg(1, "bkpinfo->media_device = %s",
    15441544                    bkpinfo->media_device);
    15451545            tmp = find_cdrom_device(FALSE);
     
    15471547                || (tmp != NULL)) {
    15481548                mr_allocstr(bkpinfo->media_device, tmp);
    1549                 log_msg(1, "bkpinfo->media_device = %s",
     1549                mr_msg(1, "bkpinfo->media_device = %s",
    15501550                        bkpinfo->media_device);
    15511551                mr_asprintf(&comment,
     
    15611561            mr_free(tmp);
    15621562
    1563             log_msg(2, "%s device found at %s",
     1563            mr_msg(2, "%s device found at %s",
    15641564                    bkpinfo->backup_media_string,
    15651565                    bkpinfo->media_device);
     
    16071607        mr_free(bkpinfo->media_device);
    16081608        if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) {
    1609             log_msg(3, _("Ok, using vanilla scsi tape."));
     1609            mr_msg(3, _("Ok, using vanilla scsi tape."));
    16101610            mr_allocstr(bkpinfo->media_device,VANILLA_SCSI_TAPE"0" );
    16111611            if ((fin = fopen(bkpinfo->media_device, "r"))) {
     
    16471647        }
    16481648        mr_free(tmp);
    1649         log_msg(4, "sz_size = %s", sz_size);
     1649        mr_msg(4, "sz_size = %s", sz_size);
    16501650        mr_free(sz_size);
    16511651        bkpinfo->media_size[0] = 0;
    1652         log_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);
     1652        mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);
    16531653        if (bkpinfo->media_size[0] <= 0) {
    16541654            bkpinfo->media_size[0] = 0;
     
    17811781            finish(1);
    17821782        }
    1783         log_msg(3, "prefix set to %s", bkpinfo->prefix);
     1783        mr_msg(3, "prefix set to %s", bkpinfo->prefix);
    17841784
    17851785        for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    17861786            bkpinfo->media_size[i] = 650;
    17871787        }
    1788         log_msg(3, "Just set nfs_remote_dir to %s",
     1788        mr_msg(3, "Just set nfs_remote_dir to %s",
    17891789                bkpinfo->nfs_remote_dir);
    1790         log_msg(3, "isodir is still %s", bkpinfo->isodir);
     1790        mr_msg(3, "isodir is still %s", bkpinfo->isodir);
    17911791        break;
    17921792
     
    18281828            finish(1);
    18291829        }
    1830         log_msg(3, "prefix set to %s", bkpinfo->prefix);
     1830        mr_msg(3, "prefix set to %s", bkpinfo->prefix);
    18311831        break;
    18321832    default:
     
    19741974#else
    19751975    if (bkpinfo->backup_media_type == nfs) {
    1976         log_msg(3, "I think the NFS mount is mounted at %s",
     1976        mr_msg(3, "I think the NFS mount is mounted at %s",
    19771977                bkpinfo->isodir);
    19781978    }
     
    19971997            fatal_error("Media size is less than zero.");
    19981998        } else {
    1999             log_msg(2, "Warning - media size is less than zero.");
     1999            mr_msg(2, "Warning - media size is less than zero.");
    20002000            bkpinfo->media_size[0] = 0;
    20012001        }
     
    20922092        return (FALSE);
    20932093    }
    2094     log_msg(10, "Injecting %s", dev);
     2094    mr_msg(10, "Injecting %s", dev);
    20952095    inject_device(dev);
    20962096    if (!does_file_exist(dev)) {
    2097         log_msg(10, "%s doesn't exist. Returning FALSE.", dev);
     2097        mr_msg(10, "%s doesn't exist. Returning FALSE.", dev);
    20982098        return (FALSE);
    20992099    }
     
    21032103        && !run_program_and_log_output(command, FALSE)) {
    21042104        mr_asprintf(&output, dev);
    2105         log_msg(4, "Found it - %s", dev);
     2105        mr_msg(4, "Found it - %s", dev);
    21062106        mr_free(command);
    21072107        return (TRUE);
    21082108    } else {
    2109         log_msg(4, "It's not %s", dev);
     2109        mr_msg(4, "It's not %s", dev);
    21102110        mr_free(command);
    21112111        return (FALSE);
     
    23652365        lstat(curr_fname, &statbuf);
    23662366        while (S_ISLNK(statbuf.st_mode)) {
    2367             log_msg(1, "curr_fname = %s", curr_fname);
     2367            mr_msg(1, "curr_fname = %s", curr_fname);
    23682368            mr_asprintf(&command, "file %s", curr_fname);
    23692369            tmp = call_program_and_get_last_line_of_output(command);
     
    23762376            for (p = scratch; *p != '\0' && *p != '\''; p++);
    23772377            *p = '\0';
    2378             log_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp, scratch);
     2378            mr_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp, scratch);
    23792379            mr_free(tmp);
    23802380
     
    24192419    char *fdisk = NULL;
    24202420
    2421     log_msg(0, "Looking for partition table format type");
     2421    mr_msg(0, "Looking for partition table format type");
    24222422    mr_asprintf(&fdisk, "/sbin/parted2fdisk");
    2423     log_msg(1, "Using %s", fdisk);
     2423    mr_msg(1, "Using %s", fdisk);
    24242424    mr_asprintf(&command, "%s -l %s | grep 'EFI GPT'", fdisk, drive);
    24252425    mr_free(fdisk);
     
    24342434    }
    24352435    mr_free(tmp);
    2436     log_msg(0, "Found %s partition table format type", output);
     2436    mr_msg(0, "Found %s partition table format type", output);
    24372437    return (output);
    24382438}
  • trunk/mondo/src/common/libmondo-fifo.c

    r1079 r1086  
    120120                 internal_tape_block_size, keych, device);
    121121    }
    122     log_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);
     122    mr_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);
    123123    fres = popen(g_sz_call_to_buffer, sz_dir);
    124124    mr_free(sz_dir);
    125125    if (fres) {
    126         log_msg(2, "Successfully opened ('%c') tape device %s", direction,
     126        mr_msg(2, "Successfully opened ('%c') tape device %s", direction,
    127127                device);
    128128    } else {
    129         log_msg(2, "Failed to open ('%c') tape device %s", direction,
     129        mr_msg(2, "Failed to open ('%c') tape device %s", direction,
    130130                device);
    131131    }
     
    133133    mr_asprintf(&tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer);
    134134    if (run_program_and_log_output(tmp, 2)) {
    135         log_msg(2, "Warning - I think I failed to open tape, actually.");
     135        mr_msg(2, "Warning - I think I failed to open tape, actually.");
    136136    }
    137137    mr_free(tmp);
     
    168168            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    169169    mr_free(g_sz_call_to_buffer);
    170     log_msg(2, "kill_buffer() --- command = %s", command);
     170    mr_msg(2, "kill_buffer() --- command = %s", command);
    171171
    172172    tmp = call_program_and_get_last_line_of_output(command);
     
    174174
    175175    mr_asprintf(&command, "kill %s", tmp);
    176     log_msg(2, "kill_buffer() --- command = %s", command);
     176    mr_msg(2, "kill_buffer() --- command = %s", command);
    177177
    178178    if (strlen(tmp) > 0) {
  • trunk/mondo/src/common/libmondo-filelist.c

    r1083 r1086  
    150150    int retval = 0;
    151151
    152     log_msg(1, "Sorting file %s", orig_fname);
     152    mr_msg(1, "Sorting file %s", orig_fname);
    153153    mr_asprintf(&tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768),
    154154             (int) (random() % 32768), (int) (random() % 32768));
     
    164164
    165165    if (retval) {
    166         log_msg(2, "Failed to sort %s - oh dear", orig_fname);
     166        mr_msg(2, "Failed to sort %s - oh dear", orig_fname);
    167167    } else {
    168         log_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",
     168        mr_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",
    169169                orig_fname, tmp_fname, orig_fname);
    170170        mr_asprintf(&command, "mv -f %s %s", tmp_fname, orig_fname);
     
    173173
    174174        if (retval) {
    175             log_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,
     175            mr_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,
    176176                    orig_fname);
    177177        } else {
    178             log_msg(2, "%s was sorted OK.", orig_fname);
     178            mr_msg(2, "%s was sorted OK.", orig_fname);
    179179        }
    180180    }
    181181    mr_free(tmp_fname);
    182     log_msg(1, "Finished sorting file %s", orig_fname);
     182    mr_msg(1, "Finished sorting file %s", orig_fname);
    183183    return (retval);
    184184}
     
    325325        mr_asprintf(&tmp, "Filelist divided into %ld sets", curr_set_no + 1);
    326326    }
    327     log_msg(1, tmp);
     327    mr_msg(1, tmp);
    328328    mr_free(tmp);
    329329    close_evalcall_form();
     
    403403    pattr = popen(syscall, "r");
    404404    if (!pattr) {
    405         log_msg(1, "Failed to open fattr() %s", syscall);
     405        mr_msg(1, "Failed to open fattr() %s", syscall);
    406406        return (1);
    407407    }
    408408    if (feof(pattr)) {
    409         log_msg(1, "Failed to call fattr() %s", syscall);
     409        mr_msg(1, "Failed to call fattr() %s", syscall);
    410410        paranoid_pclose(pattr);
    411411        return (2);
     
    433433
    434434    if (!(fin = fopen(filelist, "r"))) {
    435         log_msg(1, "Cannot openin filelist %s", filelist);
     435        mr_msg(1, "Cannot openin filelist %s", filelist);
    436436        return (1);
    437437    }
    438438    mr_asprintf(&pout_command, "gzip -c1 > %s", auxlist_fname);
    439439    if (!(pout = popen(pout_command, "w"))) {
    440         log_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);
     440        mr_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);
    441441        fclose(fin);
    442442        mr_free(pout_command);
     
    451451            file_to_analyze[i - 1] = '\0';
    452452        }
    453         log_msg(8, "Analyzing %s", file_to_analyze);
     453        mr_msg(8, "Analyzing %s", file_to_analyze);
    454454        /* BERLIOS : to be checked */
    455455        mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\'));
     
    520520    FILE *pin, *pout, *faclin;
    521521
    522     log_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,
     522    mr_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,
    523523            original_exat_fname, executable);
    524524    if (!orig_msklist || !orig_msklist[0]
    525525        || !does_file_exist(orig_msklist)) {
    526         log_msg(1,
     526        mr_msg(1,
    527527                "No masklist provided. I shall therefore set ALL attributes.");
    528528        mr_asprintf(&command, "gzip -dc %s | %s --restore - 2>> %s",
    529529                 original_exat_fname, executable, MONDO_LOGFILE);
    530         log_msg(1, "command = %s", command);
     530        mr_msg(1, "command = %s", command);
    531531        retval = system(command);
    532532        mr_free(command);
    533         log_msg(1, "Returning w/ retval=%d", retval);
     533        mr_msg(1, "Returning w/ retval=%d", retval);
    534534        return (retval);
    535535    }
    536536    if (length_of_file(original_exat_fname) <= 0) {
    537         log_msg(1,
     537        mr_msg(1,
    538538                "original_exat_fname %s is empty or missing, so no need to set EXAT list",
    539539                original_exat_fname);
     
    551551             MONDO_LOGFILE);
    552552
    553     log_msg(1, "syscall_pin = %s", syscall_pin);
    554     log_msg(1, "syscall_pout = %s", syscall_pout);
     553    mr_msg(1, "syscall_pin = %s", syscall_pin);
     554    mr_msg(1, "syscall_pout = %s", syscall_pout);
    555555    pout = popen(syscall_pout, "w");
    556556    if (!pout) {
     
    604604
    605605        i = strcmp(p, q);
    606         log_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);
     606        mr_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);
    607607
    608608//      printf("%s v %s --> %d\n", p, q, i);
    609609
    610610        if (i < 0) {            // read another subset file in.
    611             log_msg(my_depth, "Reading next subset line in\n\n");
     611            mr_msg(my_depth, "Reading next subset line in\n\n");
    612612            mr_getline(&current_subset_file, &n, faclin);
    613613            continue;
     
    619619        mr_getline(&incoming, &n, pin);
    620620        if (!i) {
    621             log_msg(my_depth, "Copying master %s", q);
     621            mr_msg(my_depth, "Copying master %s", q);
    622622        }
    623623//      if (!i) { printf("Match --- %s\n", q); }
     
    661661        return (set_EXAT_list(masklist, fattr_fname, "setfattr"));
    662662    } else {
    663         log_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");
     663        mr_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");
    664664        return(0);
    665665    }
     
    673673        return (set_EXAT_list(masklist, acl_fname, "setfacl"));
    674674    } else {
    675         log_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");
     675        mr_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");
    676676        return(0);
    677677    }
     
    748748    char_to_add = string_to_add[0];
    749749    if (node->right != NULL && node->ch < char_to_add) {
    750         log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
     750        mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
    751751                char_to_add, node->ch, (node->right)->ch);
    752752        return (add_string_at_node(node->right, string_to_add));
     
    754754    // walk down tree if appropriate
    755755    if (node->down != NULL && node->ch == char_to_add) {
    756         log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);
     756        mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);
    757757        depth++;
    758758        res = add_string_at_node(node->down, string_to_add + 1);
     
    762762
    763763    if (char_to_add == '\0' && node->ch == '\0') {
    764         log_msg(6, "%s already in tree", original_string);
     764        mr_msg(6, "%s already in tree", original_string);
    765765        return (1);
    766766    }
     
    769769    if (char_to_add < node->ch) // add to the left of node
    770770    {
    771         log_msg(7, "depth=%d char=%c --- adding (left)", depth,
     771        mr_msg(7, "depth=%d char=%c --- adding (left)", depth,
    772772                char_to_add);
    773773        memcpy((void *) newnode, (void *) node, sizeof(struct s_node));
     
    775775    } else if (char_to_add > node->ch)  // add to the right of node
    776776    {
    777         log_msg(7, "depth=%d char=%c --- adding (right)", depth,
     777        mr_msg(7, "depth=%d char=%c --- adding (right)", depth,
    778778                char_to_add);
    779779        newnode->right = node->right;   // newnode is to the RIGHT of node
     
    786786    node->expanded = node->selected = FALSE;
    787787    if (char_to_add == '\0') {
    788         log_msg(6, "Added %s OK", original_string);
     788        mr_msg(6, "Added %s OK", original_string);
    789789        return (0);
    790790    }
    791791    // add the rest
    792     log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);
     792    mr_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);
    793793    for (i = 1; i < noof_chars; i++) {
    794794        node->down = (struct s_node *) mr_malloc(sizeof(struct s_node));
    795795        node = node->down;
    796796        char_to_add = string_to_add[i];
    797         log_msg(6, "Adding '%c'", char_to_add);
     797        mr_msg(6, "Adding '%c'", char_to_add);
    798798        node->ch = char_to_add;
    799799        node->right = node->down = NULL;
     
    803803        }
    804804    }
    805     log_msg(6, "Finally - added %s OK", original_string);
     805    mr_msg(6, "Finally - added %s OK", original_string);
    806806    return (0);
    807807}
     
    838838    mr_asprintf(&command_to_open_fname, "gzip -dc %s", filelist_fname);
    839839    mr_asprintf(&tmp, "zcat %s | wc -l", filelist_fname);
    840     log_msg(6, "tmp = %s", tmp);
     840    mr_msg(6, "tmp = %s", tmp);
    841841    tmp1 = call_program_and_get_last_line_of_output(tmp);
    842842    mr_free(tmp);
     
    907907
    908908    if (depth == 0) {
    909         log_msg(0, "----------------show filelist--------------");
     909        mr_msg(0, "----------------show filelist--------------");
    910910    }
    911911    current_string[depth] = node->ch;
    912912
    913     log_msg(3, "depth=%d", depth);
     913    mr_msg(3, "depth=%d", depth);
    914914    if (node->down) {
    915         log_msg(3, "moving down");
     915        mr_msg(3, "moving down");
    916916        depth++;
    917917        show_filelist(node->down);
     
    920920
    921921    if (!node->ch) {
    922         log_msg(0, "%s\n", current_string);
     922        mr_msg(0, "%s\n", current_string);
    923923    }
    924924
    925925    if (node->right) {
    926         log_msg(3, "moving right");
     926        mr_msg(3, "moving right");
    927927        show_filelist(node->right);
    928928    }
    929929    if (depth == 0) {
    930         log_msg(0, "----------------show filelist--------------");
     930        mr_msg(0, "----------------show filelist--------------");
    931931    }
    932932    return;
     
    986986    for (node = filelist; node != NULL; node = node->right) {
    987987        str[depth] = node->ch;
    988         log_msg(5, "depth=%d ch=%c", depth, node->ch);
     988        mr_msg(5, "depth=%d ch=%c", depth, node->ch);
    989989        if (!node->ch) {
    990990//    if (node->selected)
     
    13401340#endif
    13411341        mr_free(find_excludes);
    1342         log_msg(5, "find command = %s", strtmp);
     1342        mr_msg(5, "find command = %s", strtmp);
    13431343        system(strtmp);
    13441344        mr_free(strtmp);
     
    13561356        find_skeleton_marker[0] = '\0';
    13571357        skeleton_lino = 1;
    1358         log_msg(5, "entries = %ld", g_skeleton_entries);
     1358        mr_msg(5, "entries = %ld", g_skeleton_entries);
    13591359        percentage = 0;
    13601360    } else if (depth <= MAX_SKEL_DEPTH) // update evalcall form if appropriate
     
    13631363                "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir,
    13641364                skeleton_filelist, skeleton_filelist);
    1365 //    log_msg(0, "fsm = %s", find_skeleton_marker);
     1365//    mr_msg(0, "fsm = %s", find_skeleton_marker);
    13661366        if (!system(find_skeleton_marker)) {
    13671367            percentage = (int) (skeleton_lino * 100 / g_skeleton_entries);
    13681368            skeleton_lino++;
    1369 //        log_msg(5, "Found %s", dir);
    1370 //        log_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);
     1369//        mr_msg(5, "Found %s", dir);
     1370//        mr_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);
    13711371            sprintf(find_skeleton_marker, "mv -f %s.new %s",
    13721372                    skeleton_filelist, skeleton_filelist);
    1373 //        log_msg(6, "fsm = %s", find_skeleton_marker);
     1373//        mr_msg(6, "fsm = %s", find_skeleton_marker);
    13741374            run_program_and_log_output(find_skeleton_marker, 8);
    13751375            time(&this_time);
     
    13901390    depth++;
    13911391
    1392 //  log_msg(0, "Cataloguing %s", dir);
     1392//  mr_msg(0, "Cataloguing %s", dir);
    13931393    if (sth[0] == ' ') {
    13941394        mr_asprintf(&skip_these, "%s", sth);
     
    14661466        mr_free(find_skeleton_marker);
    14671467        unlink(skeleton_filelist);
    1468         log_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);
     1468        mr_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);
    14691469    }
    14701470    return (0);
     
    15651565        mr_free(tmp);
    15661566    } else if (lstat(sz_datefile, &statbuf)) {
    1567         log_msg(2,
     1567        mr_msg(2,
    15681568                "Warning - unable to find date of previous backup. Full backup instead.");
    15691569        differential = 0;
     
    15711571    } else {
    15721572        time_of_last_full_backup = statbuf.st_mtime;
    1573         log_msg(2, "Differential backup. Yay.");
     1573        mr_msg(2, "Differential backup. Yay.");
    15741574    }
    15751575    mr_free(sz_datefile);
     
    15771577// use user-specified filelist (if specified)
    15781578    if (userdef_filelist) {
    1579         log_msg(1,
     1579        mr_msg(1,
    15801580                "Using the user-specified filelist - %s - instead of calculating one",
    15811581                userdef_filelist);
     
    15861586        mr_free(command);
    15871587    } else {
    1588         log_msg(2, "include_paths = '%s'", include_paths);
    1589         log_msg(1, "Calculating filelist");
     1588        mr_msg(2, "include_paths = '%s'", include_paths);
     1589        mr_msg(1, "Calculating filelist");
    15901590        tmp = call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null");
    15911591        tmp1 = call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null");
     
    15981598        mr_free(tmp2);
    15991599
    1600         log_msg(2, "Excluding paths = '%s'", exclude_paths);
    1601         log_msg(2,
     1600        mr_msg(2, "Excluding paths = '%s'", exclude_paths);
     1601        mr_msg(2,
    16021602                "Generating skeleton filelist so that we can track our progress");
    16031603        mr_asprintf(&skeleton_filelist, "%s/tmpfs/skeleton.txt", tmpdir);
    16041604        make_hole_for_file(skeleton_filelist);
    16051605
    1606         log_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);
    1607         log_msg(2, "Opening out filelist to %s", sz_filelist);
     1606        mr_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);
     1607        mr_msg(2, "Opening out filelist to %s", sz_filelist);
    16081608        if (!(fout = fopen(sz_filelist, "w"))) {
    16091609            fatal_error("Cannot openout to sz_filelist");
     
    16111611        i = 0;
    16121612        if (strlen(include_paths) == 0) {
    1613             log_msg(1, "Including only '/' in %s", sz_filelist);
     1613            mr_msg(1, "Including only '/' in %s", sz_filelist);
    16141614            open_and_list_dir("/", exclude_paths, fout,
    16151615                              time_of_last_full_backup, skeleton_filelist);
     
    16181618            while (*p) {
    16191619                q = next_entry(p);
    1620                 log_msg(1, "Including %s in filelist %s", q, sz_filelist);
     1620                mr_msg(1, "Including %s in filelist %s", q, sz_filelist);
    16211621                open_and_list_dir(q, exclude_paths, fout,
    16221622                                  time_of_last_full_backup,
     
    16321632        mr_free(exclude_paths);
    16331633    }
    1634     log_msg(2, "Copying new filelist to scratchdir");
     1634    mr_msg(2, "Copying new filelist to scratchdir");
    16351635    mr_asprintf(&command, "mkdir -p %s/archives", scratchdir);
    16361636    paranoid_system(command);
     
    16461646    mr_free(sz_filelist);
    16471647
    1648     log_msg(2, "Exiting");
     1648    mr_msg(2, "Exiting");
    16491649    return (0);
    16501650}
     
    16831683    noof_chars = strlen(string_to_find) + 1;    /* we include the '\0' */
    16841684
    1685     log_msg(7, "starting --- str=%s", string_to_find);
     1685    mr_msg(7, "starting --- str=%s", string_to_find);
    16861686
    16871687/* walk across tree if necessary */
     
    16891689    char_to_find = string_to_find[0];
    16901690    if (node->right != NULL && node->ch < char_to_find) {
    1691         log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
     1691        mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
    16921692                char_to_find, node->ch, (node->right)->ch);
    16931693        return (find_string_at_node(node->right, string_to_find));
     
    16961696/* walk down tree if appropriate */
    16971697    if (node->down != NULL && node->ch == char_to_find) {
    1698         log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);
     1698        mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);
    16991699        depth++;
    17001700        node = find_string_at_node(node->down, string_to_find + 1);
     
    17041704
    17051705    if (char_to_find == '\0' && node->ch == '\0') {
    1706         log_msg(7, "%s is in tree", original_string);
     1706        mr_msg(7, "%s is in tree", original_string);
    17071707        return (node);
    17081708    } else {
    1709         log_msg(7, "%s is NOT in tree", original_string);
     1709        mr_msg(7, "%s is NOT in tree", original_string);
    17101710        return (NULL);
    17111711    }
     
    17341734    size_t len = 0;             // Scrub's patch doesn't work without that
    17351735
    1736 //  log_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");
    1737     log_msg(5, "starting");
    1738     log_msg(5, "needles_list_fname = %s", needles_list_fname);
    1739     log_msg(5, "matches_list_fname = %s", matches_list_fname);
     1736//  mr_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");
     1737    mr_msg(5, "starting");
     1738    mr_msg(5, "needles_list_fname = %s", needles_list_fname);
     1739    mr_msg(5, "matches_list_fname = %s", matches_list_fname);
    17401740    if (!(fin = fopen(needles_list_fname, "r"))) {
    17411741        fatal_error("Cannot openin needles_list_fname");
     
    17591759        }
    17601760
    1761         log_msg(5, "Looking for '%s'", fname);
     1761        mr_msg(5, "Looking for '%s'", fname);
    17621762        found_node = find_string_at_node(filelist, fname);
    17631763        if (found_node) {
     
    17681768                    fname = tmp;
    17691769                }
    1770                 log_msg(5, "Found '%s'", fname);
     1770                mr_msg(5, "Found '%s'", fname);
    17711771                turn_wildcard_chars_into_literal_chars(tmp, fname);
    17721772                fprintf(fout, "%s\n", tmp);
     
    17991799    struct s_node *nod;
    18001800
    1801     log_msg(3, "Adding %s to filelist", list_of_files_fname);
     1801    mr_msg(3, "Adding %s to filelist", list_of_files_fname);
    18021802    if (!(fin = fopen(list_of_files_fname, "r"))) {
    18031803        iamhere(list_of_files_fname);
     
    18121812            tmp[strlen(tmp) - 1] = '\0';
    18131813        }
    1814         log_msg(2, "tmp = '%s'", tmp);
     1814        mr_msg(2, "tmp = '%s'", tmp);
    18151815        if (!tmp[0]) {
    18161816            continue;
    18171817        }
    18181818        if ((nod = find_string_at_node(filelist, tmp))) {
    1819             log_msg(5, "Found '%s' in filelist already. Cool.", tmp);
     1819            mr_msg(5, "Found '%s' in filelist already. Cool.", tmp);
    18201820        } else {
    18211821            add_string_at_node(filelist, tmp);
     
    18251825        if (nod && flag_em) {
    18261826            toggle_path_selection(filelist, tmp, TRUE);
    1827             log_msg(5, "Flagged '%s'", tmp);
     1827            mr_msg(5, "Flagged '%s'", tmp);
    18281828        }
    18291829    }
  • trunk/mondo/src/common/libmondo-files.c

    r1043 r1086  
    155155
    156156    if (lstat(filename, &buf)) {
    157         log_msg(20, "%s does not exist", filename);
     157        mr_msg(20, "%s does not exist", filename);
    158158        return (FALSE);
    159159    } else {
    160         log_msg(20, "%s exists", filename);
     160        mr_msg(20, "%s exists", filename);
    161161        return (TRUE);
    162162    }
     
    331331
    332332    if (output != NULL && does_file_exist(output)) {
    333         log_msg(4, "find_home_of_exe () --- Found %s at %s", fname, output);
     333        mr_msg(4, "find_home_of_exe () --- Found %s at %s", fname, output);
    334334    } else {
    335335        mr_free(output);
    336         log_msg(4, "find_home_of_exe() --- Could not find %s", fname);
     336        mr_msg(4, "find_home_of_exe() --- Could not find %s", fname);
    337337    }
    338338    return (output);
     
    662662    sz_res = call_program_and_get_last_line_of_output(command);
    663663    file_len_K = atol(sz_res);
    664     log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);
     664    mr_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);
    665665    mr_free(command);
    666666    mr_free(sz_res);
     
    699699            ("Cannot open biggielist. OK, so estimate is based on filesets only.");
    700700    } else {
    701         log_msg(4, "Reading it...");
     701        mr_msg(4, "Reading it...");
    702702        for (mr_getline(&fname, &n, fin); !feof(fin);
    703703             mr_getline(&fname, &n, fin)) {
     
    730730            if (file_len_K > 0) {
    731731                scratchL += file_len_K;
    732                 log_msg(4, "%s --> %ld K", fname, file_len_K);
     732                mr_msg(4, "%s --> %ld K", fname, file_len_K);
    733733            }
    734734            mr_asprintf(&comment,
    735735                    "After adding %s, scratchL+%ld now equals %ld", fname,
    736736                    file_len_K, scratchL);
    737             log_msg(4, comment);
     737            mr_msg(4, comment);
    738738            mr_free(comment);
    739739
     
    948948
    949949    /* BERLIOS: Why do we need to do it here as well ? */
    950     log_msg(4, "g_mondo_home='%s'", g_mondo_home);
     950    mr_msg(4, "g_mondo_home='%s'", g_mondo_home);
    951951    if ((g_mondo_home == NULL) || strlen(g_mondo_home) < 2) {
    952952        mr_free(g_mondo_home);
     
    956956            bkpinfo->scratchdir);
    957957
    958     log_msg(4, "command = %s", command);
     958    mr_msg(4, "command = %s", command);
    959959    if (run_program_and_log_output(command, 1)) {
    960960        fatal_error("Failed to copy Mondo's stuff to scratchdir");
     
    966966    /* i18n */
    967967    mr_asprintf(&command, CP_BIN " --parents /usr/share/locale/*/LC_MESSAGES/mondo.mo %s",bkpinfo->scratchdir);
    968     log_msg(4, "command = %s", command);
     968    mr_msg(4, "command = %s", command);
    969969    run_program_and_log_output(command, 1);
    970970    mr_free(command);
     
    12981298                "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n");
    12991299        paranoid_fclose(fout);
    1300         log_msg(2, "Created %s", outfile);
     1300        mr_msg(2, "Created %s", outfile);
    13011301        mr_asprintf(&tmp, "chmod +x %s", outfile);
    13021302        paranoid_system(tmp);
  • trunk/mondo/src/common/libmondo-fork.c

    r1081 r1086  
    7575/*@***********   End Variables ***************************************/
    7676
    77     log_msg(3, "Starting");
     77    mr_msg(3, "Starting");
    7878    assert(bkpinfo != NULL);
    7979    assert_string_is_neither_NULL_nor_zerolength(basic_call);
     
    9090
    9191    resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_");
    92     log_msg(4, "basic call = '%s'", basic_call);
    93     log_msg(4, "midway_call = '%s'", midway_call);
    94     log_msg(4, "tmp = '%s'", tmp);
    95     log_msg(4, "ultimate call = '%s'", ultimate_call);
     92    mr_msg(4, "basic call = '%s'", basic_call);
     93    mr_msg(4, "midway_call = '%s'", midway_call);
     94    mr_msg(4, "tmp = '%s'", tmp);
     95    mr_msg(4, "ultimate call = '%s'", ultimate_call);
    9696    mr_asprintf(&command, "%s >> %s", ultimate_call, MONDO_LOGFILE);
    9797
    9898    log_to_screen
    9999        (_("Please be patient. Do not be alarmed by on-screen inactivity."));
    100     log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
     100    mr_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
    101101            what_i_am_doing);
    102102    if (bkpinfo->manual_cd_tray) {
     
    113113        }
    114114#endif
    115         log_msg(1, "command = '%s'", command);
     115        mr_msg(1, "command = '%s'", command);
    116116        retval += system(command);
    117117        if (!g_text_mode) {
     
    119119        }
    120120        if (retval) {
    121             log_msg(2, "Basic call '%s' returned an error.", basic_call);
     121            mr_msg(2, "Basic call '%s' returned an error.", basic_call);
    122122            popup_and_OK(_("Press ENTER to continue."));
    123123            popup_and_OK
     
    127127    /* if text mode then do the above & RETURN; if not text mode, do this... */
    128128    else {
    129         log_msg(3, "command = '%s'", command);
     129        mr_msg(3, "command = '%s'", command);
    130130//      yes_this_is_a_goto:
    131131        retval =
     
    168168    assert(program != NULL);
    169169    if (!program[0]) {
    170         log_msg(2, "Warning - asked to run zerolength program");
     170        mr_msg(2, "Warning - asked to run zerolength program");
    171171        return (1);
    172172    }
     
    189189    res = system(callstr);
    190190    if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) {
    191         log_msg(0, "running: %s", callstr);
    192         log_msg(0,
     191        mr_msg(0, "running: %s", callstr);
     192        mr_msg(0,
    193193                "--------------------------------start of output-----------------------------");
    194194    }
     
    219219            if ((res == 0 && log_if_success)
    220220                || (res != 0 && log_if_failure)) {
    221                 log_msg(0, incoming);
     221                mr_msg(0, incoming);
    222222            }
    223223        }
     
    227227    unlink("/tmp/mondo-run-prog-thing.tmp");
    228228    if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) {
    229         log_msg(0,
     229        mr_msg(0,
    230230                "--------------------------------end of output------------------------------");
    231231        if (res) {
    232             log_msg(0, "...ran with res=%d", res);
     232            mr_msg(0, "...ran with res=%d", res);
    233233        } else {
    234             log_msg(0, "...ran just fine. :-)");
     234            mr_msg(0, "...ran just fine. :-)");
    235235        }
    236236    }
    237237//  else
    238 //    { log_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }
     238//    { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }
    239239    return (res);
    240240}
     
    275275    open_evalcall_form(what_i_am_doing);
    276276    mr_asprintf(&tmp, "Executing %s", basic_call);
    277     log_msg(2, tmp);
     277    mr_msg(2, tmp);
    278278    mr_free(tmp);
    279279
     
    292292        log_to_screen(_("Waiting for external binary to start"));
    293293        for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) {
    294             log_msg(3, "Waiting for lockfile %s to exist", lockfile);
     294            mr_msg(3, "Waiting for lockfile %s to exist", lockfile);
    295295        }
    296296    }
     
    305305    /* Log actual pclose errors. */
    306306    if (errno)
    307         log_msg(5, "pclose err: %d", errno);
     307        mr_msg(5, "pclose err: %d", errno);
    308308    /* Check if we have a valid status. If we do, extract the called program's exit code. */
    309309    /* If we don't, highlight this fact by returning -1. */
     
    343343    FILE *ftmp = NULL;
    344344
    345     log_msg(5, "Opening.");
     345    mr_msg(5, "Opening.");
    346346    bufcap = 256L * 1024L;
    347347    buf = mr_malloc(bufcap);
     
    367367            mr_free(tmp);
    368368
    369             log_msg(7,
     369            mr_msg(7,
    370370                    "subslice #%ld --- I have read %ld of %ld bytes in from f_orig",
    371371                    subsliceno, bytes_read_in, bytes_to_be_read);
     
    377377            mr_free(tmp);
    378378
    379             log_msg(7, "Subslice #%d written OK", subsliceno);
     379            mr_msg(7, "Subslice #%d written OK", subsliceno);
    380380            subsliceno++;
    381381        }
     
    393393            fatal_error("Cannot read the introductory block");
    394394        }
    395         log_msg(5, "tmp is %s", tmp);
     395        mr_msg(5, "tmp is %s", tmp);
    396396        if (!strstr(tmp, PIMP_START_SZ)) {
    397397            fatal_error("Can't find intro blk");
     
    402402        bytes_to_be_read = atol(tmp);
    403403        while (bytes_to_be_read > 0) {
    404             log_msg(7, "subslice#%ld, bytes=%ld", subsliceno,
     404            mr_msg(7, "subslice#%ld, bytes=%ld", subsliceno,
    405405                    bytes_to_be_read);
    406406            bytes_read_in = fread(buf, 1, bytes_to_be_read, fin);
     
    414414            }
    415415            if (atol(tmp) != subsliceno) {
    416                 log_msg(1, "Wanted subslice %ld but got %ld ('%s')",
     416                mr_msg(1, "Wanted subslice %ld but got %ld ('%s')",
    417417                        subsliceno, atol(tmp), tmp);
    418418            }
    419             log_msg(7, "Subslice #%ld read OK", subsliceno);
     419            mr_msg(7, "Subslice #%ld read OK", subsliceno);
    420420            subsliceno++;
    421421            if (fread(tmp, 1, 64L, fin) != 64L) {
     
    426426    }
    427427
    428 //  log_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);
     428//  mr_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);
    429429
    430430    if (direction == 'w') {
     
    436436        mr_free(tmp);
    437437    } else {
    438         log_msg(1, "tmpA is %s", tmp);
     438        mr_msg(1, "tmpA is %s", tmp);
    439439        if (!strstr(tmp, PIMP_END_SZ)) {
    440440            if (fread(tmp, 1, 64L, fin) != 64L) {
    441441                fatal_error("Can't read the final block");
    442442            }
    443             log_msg(5, "tmpB is %s", tmp);
     443            mr_msg(5, "tmpB is %s", tmp);
    444444            if (!strstr(tmp, PIMP_END_SZ)) {
    445445                ftmp = fopen("/tmp/out.leftover", "w");
    446446                bytes_read_in = fread(tmp, 1, 64L, fin);
    447                 log_msg(1, "bytes_read_in = %ld", bytes_read_in);
     447                mr_msg(1, "bytes_read_in = %ld", bytes_read_in);
    448448//      if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); }
    449449                fwrite(tmp, 1, bytes_read_in, ftmp);
     
    455455                /* BERLIOS : strange ???
    456456                s-printf(tmp, "I am here - %llu", ftello(fin));
    457                 log_msg(0, tmp);
     457                mr_msg(0, tmp);
    458458                */
    459459                fread(tmp, 1, 512, fin);
    460                 log_msg(0, "tmp = '%s'", tmp);
     460                mr_msg(0, "tmp = '%s'", tmp);
    461461                fwrite(tmp, 1, 512, ftmp);
    462462                fclose(ftmp);
     
    468468
    469469    mr_free(buf);
    470     log_msg(3, "Successfully copied %ld bytes", bytes_written_out);
     470    mr_msg(3, "Successfully copied %ld bytes", bytes_written_out);
    471471    return (retval);
    472472}
     
    521521    mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    522522            tempfile);
    523     log_msg(3, command);
     523    mr_msg(3, command);
    524524    open_evalcall_form(tt);
    525525
     
    537537        pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
    538538        if (pcno < 0 || pcno > 100) {
    539             log_msg(5, "Weird pc#");
     539            mr_msg(5, "Weird pc#");
    540540            continue;
    541541        }
     
    567567    res = 999;
    568568    sz_command = (char *) info;
    569     log_msg(4, "sz_command = '%s'", sz_command);
     569    mr_msg(4, "sz_command = '%s'", sz_command);
    570570    res = system(sz_command);
    571571    if (res > 256 && res != 4444) {
    572572        res = res / 256;
    573573    }
    574     log_msg(4, "child res = %d", res);
     574    mr_msg(4, "child res = %d", res);
    575575    sz_command[0] = '\0';
    576576    pthread_exit((void *) (&res));
     
    602602
    603603    mr_asprintf(&command, "%s 2>> %s", cmd, MONDO_LOGFILE);
    604     log_msg(3, "command = '%s'", command);
     604    mr_msg(3, "command = '%s'", command);
    605605    if ((res =
    606606         pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit,
     
    609609    }
    610610
    611     log_msg(8, "Parent running");
     611    mr_msg(8, "Parent running");
    612612    open_evalcall_form(tt);
    613613    for (sleep(1); command[0] != '\0'; sleep(1)) {
    614614        pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
    615615        if (pcno <= 0 || pcno > 100) {
    616             log_msg(8, "Weird pc#");
     616            mr_msg(8, "Weird pc#");
    617617            continue;
    618618        }
     
    639639        res = 666;
    640640    }
    641     log_msg(3, "Parent res = %d", res);
     641    mr_msg(3, "Parent res = %d", res);
    642642    return (res);
    643643}
  • trunk/mondo/src/common/libmondo-mountlist.c

    r1081 r1086  
    536536        flaws_str = tmp1;
    537537        res++;
    538         log_msg(1, tmp);
     538        mr_msg(1, tmp);
    539539        mr_free(tmp);
    540540        return (FALSE);
     
    902902                     "Not putting %s in list of drives: it's a virtual drive",
    903903                     drive);
    904             log_msg(8, tmp);
     904            mr_msg(8, tmp);
    905905            mr_free(tmp);
    906906            continue;
     
    912912                     "Not putting %s in list of drives: it has zero size (maybe an LVM volume)",
    913913                     drive);
    914             log_msg(8, tmp);
     914            mr_msg(8, tmp);
    915915            mr_free(tmp);
    916916            continue;
     
    931931                 "Putting %s with size %lli in list of drives",
    932932                 drive, size);
    933         log_msg(8, tmp);
     933        mr_msg(8, tmp);
    934934        mr_free(tmp);
    935935
     
    946946    }
    947947    drivelist->entries = noof_drives;
    948     log_msg(8, "Made list of drives");
     948    mr_msg(8, "Made list of drives");
    949949
    950950    return (noof_drives);
     
    10901090            !strcmp(mountlist->el[items].device, "devpts")
    10911091            ) {
    1092             log_msg(1,
     1092            mr_msg(1,
    10931093                    "Ignoring %s in mountlist - not loading that line :) ",
    10941094                    mountlist->el[items].device);
  • trunk/mondo/src/common/libmondo-msg.c

    r783 r1086  
    1717
    1818/**
    19  * The standard log_debug_msg() (log_msg() also due to a macro). Writes some describing
     19 * The standard log_debug_msg() (mr_msg() also due to a macro). Writes some describing
    2020 * information to the logfile.
    2121 */
  • trunk/mondo/src/common/libmondo-raid.c

    r1081 r1086  
    599599    get_next_raidtab_line(fin, label, value);
    600600    while (!feof(fin)) {
    601         log_msg(1, "Looking for raid record #%d", items);
     601        mr_msg(1, "Looking for raid record #%d", items);
    602602        initialize_raidrec(&raidlist->el[items]);
    603603        v = 0;
     
    611611        raidlist->el[items].additional_vars.entries = v;
    612612        if (feof(fin)) {
    613             log_msg(1, "No more records.");
     613            mr_msg(1, "No more records.");
    614614            continue;
    615615        }
    616         log_msg(2, "Record #%d (%s) found", items, value);
     616        mr_msg(2, "Record #%d (%s) found", items, value);
    617617        raidlist->el[items].raid_device = value;
    618618        for (get_next_raidtab_line(fin, label, value);
     
    625625    paranoid_fclose(fin);
    626626    raidlist->entries = items;
    627     log_msg(1, "Raidtab loaded successfully.");
    628     log_msg(1, "%d RAID devices in raidtab", items);
     627    mr_msg(1, "Raidtab loaded successfully.");
     628    mr_msg(1, "%d RAID devices in raidtab", items);
    629629    return (0);
    630630}
     
    686686            raidrec->parity = 3;
    687687        } else {
    688             log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);
     688            mr_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);
    689689        }
    690690    } else if (!strcmp(label, "device")) {
     
    946946  // open file
    947947  if (!(fin = fopen(MDSTAT_FILE, "r"))) {
    948     log_msg(1, "Could not open %s.\n", MDSTAT_FILE);
     948    mr_msg(1, "Could not open %s.\n", MDSTAT_FILE);
    949949    return 1;
    950950  }
     
    990990    token = mr_strtok (string, delims, &lastpos);
    991991    if (!strcmp(token, "inactive")) {
    992       log_msg(1, "RAID device '%s' inactive.\n",
     992      mr_msg(1, "RAID device '%s' inactive.\n",
    993993         raidlist->el[raidlist->entries].raid_device);
    994994      mr_free(string);
     
    10171017      raidlist->el[raidlist->entries].raid_level = 10;
    10181018    } else {
    1019       log_msg(1, "Unknown RAID level '%s'.\n", token);
     1019      mr_msg(1, "Unknown RAID level '%s'.\n", token);
    10201020      mr_free(string);
    10211021      mr_free(token);
     
    10611061        break;
    10621062      default: // error
    1063         log_msg(1, "Unknown device type '%c'\n", type);
     1063        mr_msg(1, "Unknown device type '%c'\n", type);
    10641064        mr_free(string);
    10651065        mr_free(token);
     
    11531153    break;
    11541154      default: // error
    1155     log_msg(1, "Row %d should not occur in record!\n", row);
     1155    mr_msg(1, "Row %d should not occur in record!\n", row);
    11561156    break;
    11571157      }
  • trunk/mondo/src/common/libmondo-stream.c

    r1081 r1086  
    363363            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
    364364        }
    365         log_msg(1, "Got xattr");
     365        mr_msg(1, "Got xattr");
    366366    }
    367367    mr_free(fname);
     
    390390            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
    391391        }
    392         log_msg(1, "Got acl");
     392        mr_msg(1, "Got acl");
    393393    }
    394394    mr_free(fname);
     
    408408    // tarball itself
    409409    res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    410     log_msg(1, "now looking for afioball");
     410    mr_msg(1, "now looking for afioball");
    411411    return (retval);
    412412}
     
    580580
    581581    if (strncmp(tapedev, "/dev/", 5)) {
    582         log_msg(1,
     582        mr_msg(1,
    583583                "Not using 'mt setblk'. This isn't an actual /dev entry.");
    584584        return (0);
     
    910910//    crctt=crc16=0;
    911911            where_I_was_before_tape_change = size;
    912             log_msg(4, "where_I_was_... = %lld",
     912            mr_msg(4, "where_I_was_... = %lld",
    913913                    where_I_was_before_tape_change);
    914914            start_to_read_from_next_tape(bkpinfo);
    915             log_msg(4, "Started reading from next tape.");
     915            mr_msg(4, "Started reading from next tape.");
    916916            skip_incoming_files_until_we_find_this_one(temp_fname);
    917             log_msg(4, "Skipped irrelevant files OK.");
     917            mr_msg(4, "Skipped irrelevant files OK.");
    918918            for (size = orig_size; size > where_I_was_before_tape_change;
    919919                 size -= bytes_to_write) {
     
    921921                    fread(datablock, 1, bytes_to_read, g_tape_stream);
    922922            }
    923             log_msg(4, "'size' is now %lld (should be %lld)", size,
     923            mr_msg(4, "'size' is now %lld (should be %lld)", size,
    924924                    where_I_was_before_tape_change);
    925925            log_to_screen("Successfully re-sync'd tape");
     
    938938#endif
    939939    }
    940     log_msg(6, "Total read from tape for this file = %lld",
     940    mr_msg(6, "Total read from tape for this file = %lld",
    941941            total_read_from_tape_for_this_file);
    942     log_msg(6, ".......................... Should be %lld", orig_size);
     942    mr_msg(6, ".......................... Should be %lld", orig_size);
    943943    g_tape_posK += total_read_from_tape_for_this_file / 1024;
    944944    mr_asprintf(&actual_cksum, "%04x%04x", crc16, crctt);
     
    10271027    }
    10281028    tempblock[i] = '\0';
    1029     log_msg(6, "%s (fname=%s, size=%ld K)",
     1029    mr_msg(6, "%s (fname=%s, size=%ld K)",
    10301030            marker_to_string(*pcontrol_char), tempblock + 1000,
    10311031            (long) (*plen) >> 10);
     
    11411141        pB = the_file_I_was_reading;
    11421142    }
    1143     log_msg(1, "skip_incoming_..(%s)", pB);
    1144     log_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");
     1143    mr_msg(1, "skip_incoming_..(%s)", pB);
     1144    mr_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");
    11451145    ctrl_chr = -1;
    11461146    while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
     
    11511151            break;
    11521152        }
    1153         log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
     1153        mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
    11541154        wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
    1155         log_msg(3, "Still trying to re-sync w/ tape");
     1155        mr_msg(3, "Still trying to re-sync w/ tape");
    11561156        mr_free(temp_fname);
    11571157        temp_fname = (char *)&res;
     
    11641164            break;
    11651165        }
    1166         log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
     1166        mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
    11671167        wrong_marker(BLK_START_FILE, ctrl_chr);
    1168         log_msg(3, "Still trying to re-sync w/ tape");
     1168        mr_msg(3, "Still trying to re-sync w/ tape");
    11691169        /* Do not desallocate when the while condition is met */
    11701170        if (ctrl_chr != BLK_START_FILE) {
     
    11861186    }
    11871187    while (strcmp(pA, pB)) {
    1188         log_msg(6, "Skipping %s (it's not %s)", temp_fname,
     1188        mr_msg(6, "Skipping %s (it's not %s)", temp_fname,
    11891189                the_file_I_was_reading);
    11901190        for (size = temp_size; size > 0; size -= bytes_to_write) {
     
    12301230         */
    12311231    }
    1232     log_msg(2, "Reading %s (it matches %s)", temp_fname,
     1232    mr_msg(2, "Reading %s (it matches %s)", temp_fname,
    12331233            the_file_I_was_reading);
    12341234    mr_free(temp_fname);
     
    12751275        wrong_marker(BLK_START_OF_BACKUP, ctrlchr);
    12761276    } else {
    1277         log_msg(3, "Next tape opened OK. Whoopee!");
     1277        mr_msg(3, "Next tape opened OK. Whoopee!");
    12781278    }
    12791279    return (res);
     
    13501350    char *fname;
    13511351
    1352     log_msg(2, "I am now writing back catalog to tape");
     1352    mr_msg(2, "I am now writing back catalog to tape");
    13531353    last = g_tapecatalog->entries - 1;
    13541354    for (i = 0; i <= last; i++) {
     
    13561356                 g_tapecatalog->el[i].fname);
    13571357        if (!does_file_exist(fname)) {
    1358             log_msg(6, "Can't write %s - it doesn't exist.", fname);
     1358            mr_msg(6, "Can't write %s - it doesn't exist.", fname);
    13591359        } else {
    13601360            write_header_block_to_stream(length_of_file(fname),
    13611361                                         "start-backcatalog-afio-or-slice",
    13621362                                         BLK_START_AN_AFIO_OR_SLICE);
    1363             log_msg(2, "Writing %s", fname);
     1363            mr_msg(2, "Writing %s", fname);
    13641364            if (write_file_to_stream_from_file(bkpinfo, fname)) {
    13651365                res++;
    1366                 log_msg(2, "%s failed", fname);
     1366                mr_msg(2, "%s failed", fname);
    13671367            }
    13681368            if (i != last) {
     
    13741374        mr_free(fname);
    13751375    }
    1376     log_msg(2, "Finished writing back catalog to tape");
     1376    mr_msg(2, "Finished writing back catalog to tape");
    13771377    return (res);
    13781378}
     
    16061606             marker_to_string(control_char), p,
    16071607             (long) length_of_incoming_file >> 10);
    1608     log_msg(6, tmp);
     1608    mr_msg(6, tmp);
    16091609    mr_free(tmp);
    16101610    return (0);
  • trunk/mondo/src/common/libmondo-tools.c

    r1081 r1086  
    232232        }
    233233    }
    234 //  log_msg(1, "tmp = '%s'", tmp);
     234//  mr_msg(1, "tmp = '%s'", tmp);
    235235    d = atof(tmp);
    236236#endif
    237     log_msg(1, "g_kernel_version = %f", d);
     237    mr_msg(1, "g_kernel_version = %f", d);
    238238    return (d);
    239239}
     
    368368        1024;
    369369
    370     log_msg(1, "Foo");
     370    mr_msg(1, "Foo");
    371371    if (bkpinfo->backup_media_type == tape) {
    372         log_msg(1, "Bar");
     372        mr_msg(1, "Bar");
    373373        mr_asprintf(&tmp, "mt -f %s status", bkpinfo->media_device);
    374         log_msg(1, "tmp = '%s'", tmp);
     374        mr_msg(1, "tmp = '%s'", tmp);
    375375        if (run_program_and_log_output(tmp, 3)) {
    376376            fatal_error
     
    496496            mr_free(command);
    497497        }
    498         log_msg(2, "call_make_iso (DVD res) is ... %s",
     498        mr_msg(2, "call_make_iso (DVD res) is ... %s",
    499499                bkpinfo->call_make_iso);
    500500    }                           // end of DVD code
     
    739739    int i = 0;
    740740
    741     log_msg(1, "Hi");
     741    mr_msg(1, "Hi");
    742742
    743743    assert(bkpinfo != NULL);
     
    10581058         else if (strstr(value, "/dev/") && strstr(value, "t0")
    10591059               && !strcmp(label, "media-dev")) {
    1060         log_msg(2, "FYI, I shan't read new value for %s - already got %s",
     1060        mr_msg(2, "FYI, I shan't read new value for %s - already got %s",
    10611061                label, value);
    10621062        return (0);
     
    11141114    char *command;
    11151115
    1116     log_msg(1, "Started sub");
    1117     log_msg(4, "Setting command to something");
     1116    mr_msg(1, "Started sub");
     1117    mr_msg(4, "Setting command to something");
    11181118    mr_asprintf(&command,
    11191119             "grep -v ':' /etc/fstab | grep -vE '^#.*$' | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    1120     log_msg(4, "Cool. Command = '%s'", command);
     1120    mr_msg(4, "Cool. Command = '%s'", command);
    11211121    tmp = call_program_and_get_last_line_of_output(command);
    11221122    mr_free(command);
    11231123
    1124     log_msg(4, "tmp = '%s'", tmp);
     1124    mr_msg(4, "tmp = '%s'", tmp);
    11251125    if (tmp) {
    11261126        log_it("/boot is at %s according to /etc/fstab", tmp);
     
    11291129                mr_free(g_boot_mountpt);
    11301130                mr_asprintf(&g_boot_mountpt, "/boot");
    1131                 log_msg(1, "Mounted /boot");
     1131                mr_msg(1, "Mounted /boot");
    11321132            } else {
    11331133                log_it("...ignored cos it's a label :-)");
     
    11351135        } else {
    11361136            mr_asprintf(&command, "mount | grep -E '^%s'", tmp);
    1137             log_msg(3, "command = %s", command);
     1137            mr_msg(3, "command = %s", command);
    11381138            if (run_program_and_log_output(command, 5)) {
    11391139                mr_free(g_boot_mountpt);
     
    11511151                    mr_asprintf(&g_boot_mountpt, " ");
    11521152                    */
    1153                     log_msg(1, "Plan B");
     1153                    mr_msg(1, "Plan B");
    11541154                    if (!run_program_and_log_output("mount /boot", 5)) {
    11551155                        mr_free(g_boot_mountpt);
    11561156                        mr_asprintf(&g_boot_mountpt, "/boot");
    1157                         log_msg(1, "Plan B worked");
     1157                        mr_msg(1, "Plan B worked");
    11581158                    } else {
    1159                         log_msg(1,
     1159                        mr_msg(1,
    11601160                                "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition.");
    11611161                    }
     
    11671167    }
    11681168    mr_free(tmp);
    1169     log_msg(1, "Ended sub");
     1169    mr_msg(1, "Ended sub");
    11701170}
    11711171
     
    11781178    char *tmp;
    11791179
    1180     log_msg(3, "starting");
     1180    mr_msg(3, "starting");
    11811181    if (g_boot_mountpt != NULL) {
    11821182        mr_asprintf(&tmp, "umount %s", g_boot_mountpt);
     
    11861186        mr_free(tmp);
    11871187    }
    1188     log_msg(3, "leaving");
     1188    mr_msg(3, "leaving");
    11891189}
    11901190
     
    12911291           ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99");
    12921292    if (g_magicdev_command) {
    1293         log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
     1293        mr_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
    12941294        paranoid_system("killall magicdev");
    12951295    }
  • trunk/mondo/src/common/libmondo-verify.c

    r1081 r1086  
    7171*/
    7272
    73     log_msg(1, "Now scanning log file for 'afio: ' stuff");
     73    mr_msg(1, "Now scanning log file for 'afio: ' stuff");
    7474    mr_asprintf(&command,
    7575             "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
    7676             stderr_fname, afio_found_changes);
    77     log_msg(2, command);
     77    mr_msg(2, command);
    7878    res = system(command);
    7979    mr_free(command);
    8080    if (res) {
    81         log_msg(2, "Warning - failed to think");
    82     }
    83 
    84     log_msg(1, "Now scanning log file for 'star: ' stuff");
     81        mr_msg(2, "Warning - failed to think");
     82    }
     83
     84    mr_msg(1, "Now scanning log file for 'star: ' stuff");
    8585    mr_asprintf(&command,
    8686             "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    8787             stderr_fname, afio_found_changes);
    88     log_msg(2, command);
     88    mr_msg(2, command);
    8989    res = system(command);
    9090    mr_free(command);
    9191    if (res) {
    92         log_msg(2, "Warning - failed to think");
     92        mr_msg(2, "Warning - failed to think");
    9393    }
    9494//  exclude_nonexistent_files (afio_found_changes);
     
    9898             ignorefiles_fname, afio_found_changes, afio_found_changes,
    9999             changedfiles_fname);
    100     log_msg(2, command);
     100    mr_msg(2, command);
    101101    paranoid_system(command);
    102102    mr_free(command);
     
    144144    if (g_last_afioball_number != set_number - 1) {
    145145        if (set_number == 0) {
    146             log_msg(1,
     146            mr_msg(1,
    147147                    "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more");
    148148        } else {
     
    163163         does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets));
    164164         total_sets++) {
    165         log_msg(1, "total_sets = %d", total_sets);
     165        mr_msg(1, "total_sets = %d", total_sets);
    166166    }
    167167    for (;
     
    172172                                                           g_last_afioball_number);
    173173        update_evalcall_form(percentage);
    174         log_msg(1, "set = %d", set_number);
     174        mr_msg(1, "set = %d", set_number);
    175175        retval +=
    176176            verify_an_afioball_from_CD(bkpinfo,
     
    270270        // handle slices until end of CD
    271271        if (slice_num == 0) {
    272             log_msg(2, "ISO=%d  bigfile=%ld --START--",
     272            mr_msg(2, "ISO=%d  bigfile=%ld --START--",
    273273                    g_current_media_number, bigfile_num);
    274274            if (!(fin = fopen(tmp1,"r"))) {
    275                 log_msg(2, "Cannot open bigfile's info file");
     275                mr_msg(2, "Cannot open bigfile's info file");
    276276            } else {
    277277                if (fread
    278278                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    279279                     fin) < sizeof(biggiestruct)) {
    280                     log_msg(2, "Unable to get biggiestruct");
     280                    mr_msg(2, "Unable to get biggiestruct");
    281281                }
    282282                paranoid_fclose(fin);
     
    284284            mr_asprintf(&tmp2, "%s/%s", bkpinfo->restore_path,
    285285                     biggiestruct.filename);
    286             log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2);
     286            mr_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2);
    287287            if (!(forig = fopen(tmp2, "r"))) {
    288                 log_msg(2, "Failed to open bigfile. Darn.");
     288                mr_msg(2, "Failed to open bigfile. Darn.");
    289289                retval++;
    290290            }
     
    293293            slice_num++;
    294294        } else if (does_file_exist(tmp1)) {
    295             log_msg(2, "ISO=%d  bigfile=%ld ---END---",
     295            mr_msg(2, "ISO=%d  bigfile=%ld ---END---",
    296296                    g_current_media_number, bigfile_num);
    297297            bigfile_num++;
     
    299299            slice_num = 0;
    300300        } else {
    301             log_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
     301            mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
    302302                    g_current_media_number, bigfile_num, slice_num);
    303303            if (bkpinfo->compression_level > 0) {
     
    327327                paranoid_pclose(pin);
    328328                if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) {
    329                     log_msg(3,
     329                    mr_msg(3,
    330330                            "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
    331331                            biggiestruct.filename);
    332                     log_msg(3,
     332                    mr_msg(3,
    333333                            "If you really want verification for %s, please contact the devteam and offer an incentive.",
    334334                            biggiestruct.filename);
     
    336336                }
    337337                if (res) {
    338                     log_msg(0,
     338                    mr_msg(0,
    339339                            "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c",
    340340                            biggiestruct.filename);
     
    405405    if (strstr(tarball_fname, ".lzo")
    406406        && strcmp(bkpinfo->zip_suffix, "lzo")) {
    407         log_msg(2, "OK, I'm going to start using lzop.");
     407        mr_msg(2, "OK, I'm going to start using lzop.");
    408408        mr_allocstr(bkpinfo->zip_exe, "lzop");
    409409        mr_allocstr(bkpinfo->zip_suffix, "lzo");
     
    413413    if (strstr(tarball_fname, ".gz")
    414414        && strcmp(bkpinfo->zip_suffix, "gz")) {
    415         log_msg(2, "OK, I'm going to start using gzip.");
     415        mr_msg(2, "OK, I'm going to start using gzip.");
    416416        strcpy(bkpinfo->zip_exe, "gzip");
    417417        strcpy(bkpinfo->zip_suffix, "gz");
     
    421421    if (strstr(tarball_fname, ".bz2")
    422422        && strcmp(bkpinfo->zip_suffix, "bz2")) {
    423         log_msg(2, "OK, I'm going to start using bzip2.");
     423        mr_msg(2, "OK, I'm going to start using bzip2.");
    424424        mr_allocstr(bkpinfo->zip_exe, "bzip2");
    425425        mr_allocstr(bkpinfo->zip_suffix, "bz2");
     
    441441                 bkpinfo->zip_exe, tarball_fname, outlog, outlog);
    442442    }
    443     log_msg(6, "command=%s", command);
     443    mr_msg(6, "command=%s", command);
    444444    paranoid_system(command);
    445445    mr_free(command);
     
    462462                        if (strchr(tmp, '/')) {
    463463                            if (!diffs) {
    464                                 log_msg(0, "'%s' - differences found",
     464                                mr_msg(0, "'%s' - differences found",
    465465                                        tarball_fname);
    466466                            }
    467                             log_msg(0, "star: /%s",
     467                            mr_msg(0, "star: /%s",
    468468                                    strip_afio_output_line(tmp));
    469469                            diffs++;
     
    472472                } else {
    473473                    if (!diffs) {
    474                         log_msg(0, "'%s' - differences found",
     474                        mr_msg(0, "'%s' - differences found",
    475475                                tarball_fname);
    476476                    }
    477                     log_msg(0, "afio: /%s", strip_afio_output_line(tmp));
     477                    mr_msg(0, "afio: /%s", strip_afio_output_line(tmp));
    478478                    diffs++;
    479479                }
     
    515515    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    516516
    517     log_msg(1, "Verifying %s", tarball_fname);
     517    mr_msg(1, "Verifying %s", tarball_fname);
    518518    if (!does_file_exist(tarball_fname)) {
    519519        fatal_error("Cannot verify nonexistent afioball");
     
    575575                 "Afioball '%s' no longer matches your live filesystem",
    576576                 p);
    577         log_msg(0, tmp);
     577        mr_msg(0, tmp);
    578578        mr_free(tmp);
    579579        retval++;
     
    648648                                          &ctrl_chr);
    649649        if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
    650             log_msg(2, "test_file = %s", test_file);
     650            mr_msg(2, "test_file = %s", test_file);
    651651            wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
    652652        }
     
    666666            mr_asprintf(&tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum,
    667667                     orig_cksum);
    668             log_msg(2, tmp);
     668            mr_msg(2, tmp);
    669669            mr_free(tmp);
    670670
     
    795795        fname = (char *) &res;
    796796    }
    797     log_msg(1, "All done with afioballs");
     797    mr_msg(1, "All done with afioballs");
    798798    close_progress_form();
    799799    mr_free(fname);
     
    867867    }
    868868    noof_biggiefiles = (long) size;
    869     log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
     869    mr_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
    870870    open_progress_form(_("Verifying big files"), comment,
    871871                       _("Please wait. This may take some time."), "",
     
    956956                 "%s not found; assuming you backed up to CD; verifying CD...",
    957957                 fname);
    958         log_msg(2, tmp);
     958        mr_msg(2, tmp);
    959959        mr_free(tmp);
    960960
     
    995995        mr_free(command);
    996996    }
    997     log_msg(2, "OK, I've mounted the ISO/CD\n");
     997    mr_msg(2, "OK, I've mounted the ISO/CD\n");
    998998    mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint);
    999999    if (!does_file_exist(tmp)) {
    1000         log_msg
     1000        mr_msg
    10011001            (2,
    10021002             "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE.");
     
    10331033        retval++;
    10341034    } else {
    1035         log_msg(2, "OK, I've unmounted the ISO file\n");
     1035        mr_msg(2, "OK, I've unmounted the ISO file\n");
    10361036    }
    10371037    mr_free(command);
     
    10451045        if (!bkpinfo->please_dont_eject
    10461046            && eject_device(bkpinfo->media_device)) {
    1047             log_msg(2, "Failed to eject CD-ROM drive");
     1047            mr_msg(2, "Failed to eject CD-ROM drive");
    10481048        }
    10491049    }
     
    10751075    assert(bkpinfo != NULL);
    10761076
    1077     log_msg(3, "verify_tape_backups --- starting");
     1077    mr_msg(3, "verify_tape_backups --- starting");
    10781078    log_to_screen(_("Verifying backups"));
    10791079    openin_tape(bkpinfo);
     
    10981098             (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    10991099             changed_files_fname);
    1100     log_msg(2, "Running command to derive list of changed files");
    1101     log_msg(2, tmp);
     1100    mr_msg(2, "Running command to derive list of changed files");
     1101    mr_msg(2, tmp);
    11021102    if (system(tmp)) {
    11031103        if (does_file_exist(changed_files_fname)
     
    11261126                 "%ld files differed from live filesystem; type less %s or less %s to see",
    11271127                 diffs, changed_files_fname, "/tmp/changed.files");
    1128         log_msg(0, tmp);
     1128        mr_msg(0, tmp);
    11291129        mr_free(tmp);
    11301130
  • trunk/mondo/src/common/newt-specific.c

    r1081 r1086  
    199199        usleep(500000);
    200200        if (g_text_mode) {
    201             log_msg(2, "Closing evalcall form");
     201            mr_msg(2, "Closing evalcall form");
    202202            return;
    203203        }
     
    219219        }
    220220        if (g_current_progress == -999) {
    221             log_msg(2,
     221            mr_msg(2,
    222222                    "Trying to close the progress form when it ain't open!");
    223223            return;
     
    227227        sleep(1);
    228228        if (g_text_mode) {
    229             log_msg(2, "Closing progress form");
     229            mr_msg(2, "Closing progress form");
    230230            return;
    231231        }
     
    270270        set_signals(FALSE);     // link to external func
    271271        g_exiting = TRUE;
    272         log_msg(1, "%s - '%s'", fatalstr, error_string);
     272        mr_msg(1, "%s - '%s'", fatalstr, error_string);
    273273        printf("%s - %s\n", fatalstr, error_string);
    274274        if (getpid() == g_mastermind_pid) {
    275             log_msg(2, "mastermind %d is exiting", (int) getpid());
     275            mr_msg(2, "mastermind %d is exiting", (int) getpid());
    276276            kill(g_main_pid, SIGTERM);
    277277            finish(1);
     
    280280        if (getpid() != g_main_pid) {
    281281            if (g_mastermind_pid != 0 && getpid() != g_mastermind_pid) {
    282                 log_msg(2, "non-m/m %d is exiting", (int) getpid());
     282                mr_msg(2, "non-m/m %d is exiting", (int) getpid());
    283283                kill(g_main_pid, SIGTERM);
    284284                finish(1);
     
    286286        }
    287287
    288         log_msg(3, "OK, I think I'm the main PID.");
     288        mr_msg(3, "OK, I think I'm the main PID.");
    289289        if (already_exiting) {
    290             log_msg(3, "...I'm already exiting. Give me time, Julian!");
     290            mr_msg(3, "...I'm already exiting. Give me time, Julian!");
    291291            finish(1);
    292292        }
    293293
    294294        already_exiting = TRUE;
    295         log_msg(2, "I'm going to do some cleaning up now.");
     295        mr_msg(2, "I'm going to do some cleaning up now.");
    296296        paranoid_system("killall mindi 2> /dev/null");
    297297        kill_anything_like_this("/mondo/do-not");
     
    303303            chdir("/");
    304304            for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) {
    305                 log_msg(2, "Waiting for child processes to terminate");
     305                mr_msg(2, "Waiting for child processes to terminate");
    306306                sleep(1);
    307307                run_program_and_log_output(tmp, 5);
     
    323323
    324324        if (!g_text_mode) {
    325             log_msg(0, fatalstr);
    326             log_msg(0, error_string);
     325            mr_msg(0, fatalstr);
     326            mr_msg(0, error_string);
    327327            newtFinished();
    328328        }
     
    337337        register_pid(0, "mondo");   // finish() does this too, FYI
    338338        if (!g_main_pid) {
    339             log_msg(3, "FYI - g_main_pid is blank");
     339            mr_msg(3, "FYI - g_main_pid is blank");
    340340        }
    341341        finish(254);
     
    371371        if (!g_text_mode) {
    372372            if (does_file_exist("/THIS-IS-A-RAMDISK")) {
    373                 log_msg(1, "Calling newtFinished()");
     373                mr_msg(1, "Calling newtFinished()");
    374374                newtFinished();
    375375            } else {
    376                 log_msg(1, "Calling newtSuspend()");
     376                mr_msg(1, "Calling newtSuspend()");
    377377                newtSuspend();
    378378            }
     
    465465        va_start(args, fmt);
    466466        mr_asprintf(&output, fmt, args);
    467         log_msg(0, output);
     467        mr_msg(0, output);
    468468        if (strlen(output) > 80) {
    469469            output[80] = '\0';
     
    508508     mvaddstr_and_log_it(int y, int x, char *output) {
    509509        assert_string_is_neither_NULL_nor_zerolength(output);
    510         log_msg(0, output);
     510        mr_msg(0, output);
    511511        if (g_text_mode) {
    512512            printf("%s\n", output);
     
    541541        //  center_string (title, 80);
    542542        if (g_text_mode) {
    543             log_msg(0, title);
     543            mr_msg(0, title);
    544544        } else {
    545545            mr_asprintf(&tmp, title);
     
    553553        g_isoform_starttime = get_time();
    554554        if (g_text_mode) {
    555             log_msg(0, g_isoform_header_str);
     555            mr_msg(0, g_isoform_header_str);
    556556        } else {
    557557            g_isoform_header = newtLabel(1, 1, g_isoform_header_str);
     
    618618        mr_asprintf(&g_blurb_str_3, blurb2);
    619619        if (g_text_mode) {
    620             log_msg(0, blurb1);
    621             log_msg(0, blurb2);
    622             log_msg(0, blurb3);
     620            mr_msg(0, blurb1);
     621            mr_msg(0, blurb2);
     622            mr_msg(0, blurb3);
    623623        } else {
    624624            g_blurb1 = newtLabel(2, 1, blurb1);
     
    654654        assert_string_is_neither_NULL_nor_zerolength(prompt);
    655655
    656         log_msg(0, prompt);
     656        mr_msg(0, prompt);
    657657        if (g_text_mode) {
    658658            printf
     
    10541054        char *p;
    10551055
    1056 //  log_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);
     1056//  mr_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);
    10571057        if (!g_text_mode) {
    10581058            assert(blurb1 != NULL);
     
    10721072                         blurb1, blurb2, blurb3, g_current_progress,
    10731073                         g_maximum_progress);
    1074                 log_msg(0, tmp);
     1074                mr_msg(0, tmp);
    10751075                mr_free(tmp);
    10761076                g_current_progress = g_maximum_progress;
     
    11231123
    11241124            if (percentage > 100) {
    1125                 log_msg(2, _("percentage = %d"), percentage);
     1125                mr_msg(2, _("percentage = %d"), percentage);
    11261126            }
    11271127            mr_asprintf(&taskprogress,
     
    13401340        if (!(fin = fopen(source_file, "r"))) {
    13411341            log_OS_error(source_file);
    1342             log_msg(2, "Can't open %s; therefore, cannot popup list",
     1342            mr_msg(2, "Can't open %s; therefore, cannot popup list",
    13431343                    source_file);
    13441344            return (1);
    13451345        }
    1346         log_msg(2, "Loading %s", source_file);
     1346        mr_msg(2, "Loading %s", source_file);
    13471347        for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM;
    13481348             filelist->entries++) {
     
    14041404                           (void *) &dummy_fle,
    14051405                           sizeof(struct s_filelist_entry));
    1406                     log_msg(2, "Swapping %s and %s",
     1406                    mr_msg(2, "Swapping %s and %s",
    14071407                            filelist->el[i].filename,
    14081408                            filelist->el[i + 1].filename);
     
    14781478        assert_string_is_neither_NULL_nor_zerolength(source_file);
    14791479        if (g_text_mode) {
    1480             log_msg(2, "Text mode. Therefore, no popup list.");
     1480            mr_msg(2, "Text mode. Therefore, no popup list.");
    14811481            return;
    14821482        }
    1483         log_msg(2, "Examining file %s", source_file);
     1483        mr_msg(2, "Examining file %s", source_file);
    14841484
    14851485        lng = count_lines_in_file(source_file);
    14861486        if (lng < 1) {
    1487             log_msg(2, "No lines in file. Therefore, no popup list.");
     1487            mr_msg(2, "No lines in file. Therefore, no popup list.");
    14881488            return;
    14891489        } else if (lng >= ARBITRARY_MAXIMUM) {
    1490             log_msg(2, "Too many files differ for me to list.");
     1490            mr_msg(2, "Too many files differ for me to list.");
    14911491            return;
    14921492        }
     
    14981498
    14991499        if (load_filelist_into_array(filelist, source_file)) {
    1500             log_msg(2, "Can't open %s; therefore, cannot popup list",
     1500            mr_msg(2, "Can't open %s; therefore, cannot popup list",
    15011501                    source_file);
    15021502            return;
    15031503        }
    1504         log_msg(2, "%d files loaded into filelist array",
     1504        mr_msg(2, "%d files loaded into filelist array",
    15051505                filelist->entries);
    15061506        for (i = 0; i < filelist->entries; i++) {
  • trunk/mondo/src/mondoarchive/main.c

    r1081 r1086  
    5353void welcome_to_mondoarchive()
    5454{
    55     log_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",
     55    mr_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",
    5656            PACKAGE_VERSION);
    57     log_msg(0, "running on %s architecture", get_architecture());
    58     log_msg(0,
     57    mr_msg(0, "running on %s architecture", get_architecture());
     58    mr_msg(0,
    5959            "-----------------------------------------------------------");
    60     log_msg(0,
     60    mr_msg(0,
    6161            "NB: Mondo logs almost everything, so don't panic if you see");
    62     log_msg(0,
     62    mr_msg(0,
    6363            "some error messages.  Please read them carefully before you");
    64     log_msg(0,
     64    mr_msg(0,
    6565            "decide to break out in a cold sweat.    Despite (or perhaps");
    66     log_msg(0,
     66    mr_msg(0,
    6767            "because of) the wealth of messages. some users are inclined");
    68     log_msg(0,
     68    mr_msg(0,
    6969            "to stop reading this log. If Mondo stopped for some reason,");
    70     log_msg(0,
     70    mr_msg(0,
    7171            "chances are it's detailed here.  More than likely there's a");
    72     log_msg(0,
     72    mr_msg(0,
    7373            "message at the very end of this log that will tell you what");
    74     log_msg(0,
     74    mr_msg(0,
    7575            "is wrong. Please read it!                          -Devteam");
    76     log_msg(0,
     76    mr_msg(0,
    7777            "-----------------------------------------------------------");
    7878
    79     log_msg(0, "Zero...");
    80     log_msg(1, "One...");
    81     log_msg(2, "Two...");
    82     log_msg(3, "Three...");
    83     log_msg(4, "Four...");
    84     log_msg(5, "Five...");
    85     log_msg(6, "Six...");
    86     log_msg(7, "Seven...");
    87     log_msg(8, "Eight...");
     79    mr_msg(0, "Zero...");
     80    mr_msg(1, "One...");
     81    mr_msg(2, "Two...");
     82    mr_msg(3, "Three...");
     83    mr_msg(4, "Four...");
     84    mr_msg(5, "Five...");
     85    mr_msg(6, "Six...");
     86    mr_msg(7, "Seven...");
     87    mr_msg(8, "Eight...");
    8888    printf("See %s for details of backup run.\n", MONDO_LOGFILE);
    8989}
     
    9696void distro_specific_kludges_at_start_of_mondoarchive()
    9797{
    98     log_msg(2, "Unmounting old ramdisks if necessary");
     98    mr_msg(2, "Unmounting old ramdisks if necessary");
    9999    stop_magicdev_if_necessary();   // for RH+Gnome users
    100100    run_program_and_log_output
     
    111111void distro_specific_kludges_at_end_of_mondoarchive()
    112112{
    113     log_msg(2, "Restarting magicdev if necessary");
     113    mr_msg(2, "Restarting magicdev if necessary");
    114114    sync();
    115115    restart_magicdev_if_necessary();    // for RH+Gnome users
    116116
    117     log_msg(2, "Restarting supermounts if necessary");
     117    mr_msg(2, "Restarting supermounts if necessary");
    118118    sync();
    119119    remount_supermounts_if_necessary(); // for Mandrake users
    120120
    121     log_msg(2, "Unmounting /boot if necessary");
     121    mr_msg(2, "Unmounting /boot if necessary");
    122122    sync();
    123123    unmount_boot_if_necessary();    // for Gentoo users
     
    181181    /* initialize log file with time stamp */
    182182    unlink(MONDO_LOGFILE);
    183     log_msg(0, "Time started: %s", mr_date());
     183    mr_msg_init(MONDO_LOGFILE,4);
     184    mr_msg(0, "Time started: %s", mr_date());
    184185
    185186    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     
    196197    /* Configure the bkpinfo structure, global file paths, etc. */
    197198    g_main_pid = getpid();
    198     log_msg(9, "This");
     199    mr_msg(9, "This");
    199200
    200201    register_pid(g_main_pid, "mondo");
     
    203204    run_program_and_log_output("dmesg -n1", TRUE);
    204205
    205     log_msg(9, "Next");
     206    mr_msg(9, "Next");
    206207    welcome_to_mondoarchive();
    207208    distro_specific_kludges_at_start_of_mondoarchive();
     
    324325                (_("Errors were detected in the command line you supplied.\n"));
    325326            printf(_("Please review the log file - %s \n"),MONDO_LOGFILE);
    326             log_msg(1, "Mondoarchive will now exit.");
     327            mr_msg(1, "Mondoarchive will now exit.");
    327328            finish(1);
    328329        }
     
    388389                (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    389390        } else {
    390             log_msg(1,
     391            mr_msg(1,
    391392                    _("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    392             log_msg(2, "Calling popup_changelist_from_file()");
     393            mr_msg(2, "Calling popup_changelist_from_file()");
    393394            popup_changelist_from_file("/tmp/changed.files");
    394             log_msg(2, "Returned from popup_changelist_from_file()");
     395            mr_msg(2, "Returned from popup_changelist_from_file()");
    395396        }
    396397    } else {
     
    431432
    432433    /* finalize log file with time stamp */
    433     log_msg(0, "Time finished: %s", mr_date());
     434    mr_msg(0, "Time finished: %s", mr_date());
    434435
    435436    if (!g_text_mode) {
  • trunk/mondo/src/mondoarchive/mondo-cli.c

    r1081 r1086  
    9292    {
    9393*/
    94     log_msg(3, "Switches:-");
     94    mr_msg(3, "Switches:-");
    9595    for (i = 0; i < 128; i++) {
    9696        if (flag_set[i]) {
    9797            mr_asprintf(&tmp, "-%c %s", i, flag_val[i]);
    98             log_msg(3, tmp);
     98            mr_msg(3, tmp);
    9999            mr_free(tmp);
    100100        }
     
    162162        mr_asprintf(&comment, "media_size[%d] = %ld", j,
    163163                bkpinfo->media_size[j]);
    164         log_msg(3, comment);
     164        mr_msg(3, comment);
    165165        mr_free(comment);
    166166    }
     
    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        }
     
    252252        if (tmp1) {
    253253            flag_set['R'] = TRUE;
    254             log_msg(1, "Using star instead of afio");
     254            mr_msg(1, "Using star instead of afio");
    255255        } else {
    256256            fatal_error
     
    286286    if (flag_set['I']) {
    287287        if (!strcmp(bkpinfo->include_paths, "/")) {
    288             log_msg(2, "'/' is pleonastic.");
     288            mr_msg(2, "'/' is pleonastic.");
    289289            bkpinfo->include_paths = NULL;
    290290        }
     
    299299                *q = '\0';
    300300                if (stat(p, &buf) != 0) {
    301                     log_msg(1, "ERROR ! %s doesn't exist", p);
     301                    mr_msg(1, "ERROR ! %s doesn't exist", p);
    302302                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    303303                }
     
    305305            } else {
    306306                if (stat(p, &buf) != 0) {
    307                     log_msg(1, "ERROR ! %s doesn't exist", p);
     307                    mr_msg(1, "ERROR ! %s doesn't exist", p);
    308308                    fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    309309                }
     
    321321        mr_free(tmp1);
    322322
    323         log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     323        mr_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
    324324        if (bkpinfo->include_paths[0] == '-') {
    325325            retval++;
     
    373373            }
    374374        } else {
    375             log_msg(3, "flag_val['c'] = %s", flag_val['c']);
    376             log_msg(3, "flag_val['w'] = %s", flag_val['w']);
     375            mr_msg(3, "flag_val['c'] = %s", flag_val['c']);
     376            mr_msg(3, "flag_val['w'] = %s", flag_val['w']);
    377377            if (flag_set['c']) {
    378378                bkpinfo->cdrw_speed = atoi(flag_val['c']);
     
    492492            log_to_screen(_("NFS share is not mounted. Please mount it.\n"));
    493493        }
    494         log_msg(3, "mount = %s", bkpinfo->nfs_mount);
    495         log_msg(3, "isodir= %s", bkpinfo->isodir);
     494        mr_msg(3, "mount = %s", bkpinfo->nfs_mount);
     495        mr_msg(3, "isodir= %s", bkpinfo->isodir);
    496496    }
    497497
     
    556556                /* End of bug fix */
    557557                if (stat(p, &buf) != 0) {
    558                     log_msg(1, "WARNING ! %s doesn't exist", p);
     558                    mr_msg(1, "WARNING ! %s doesn't exist", p);
    559559                }
    560560                p = q+1 ;
    561561            } else {
    562562                if (stat(p, &buf) != 0) {
    563                     log_msg(1, "WARNING ! %s doesn't exist", p);
     563                    mr_msg(1, "WARNING ! %s doesn't exist", p);
    564564                }
    565565                p = NULL;
     
    593593        mr_free(tmp1);
    594594
    595         log_msg(3, "-N means we're now excluding %s",
     595        mr_msg(3, "-N means we're now excluding %s",
    596596                bkpinfo->exclude_paths);
    597597    }
     
    599599    if (flag_set['b']) {
    600600        mr_asprintf(&psz, flag_val['b']);
    601         log_msg(1, "psz = '%s'", psz);
     601        mr_msg(1, "psz = '%s'", psz);
    602602        if (psz[strlen(psz) - 1] == 'k') {
    603603            psz[strlen(psz) - 1] = '\0';
     
    608608        mr_free(psz);
    609609
    610         log_msg(1, "'%s' --> %ld", flag_val['b'], itbs);
    611         log_msg(1, "Internal tape block size is now %ld bytes", itbs);
     610        mr_msg(1, "'%s' --> %ld", flag_val['b'], itbs);
     611        mr_msg(1, "Internal tape block size is now %ld bytes", itbs);
    612612        if (itbs % 512 != 0 || itbs < 256 || itbs > 1024L * 1024) {
    613613            fatal_error
     
    776776            (BOOT_LOADER_CHARS,
    777777             (bkpinfo->boot_loader = flag_val['l'][0]))) {
    778             log_msg(1, "%c? What is %c? I need G, L, E or R.",
     778            mr_msg(1, "%c? What is %c? I need G, L, E or R.",
    779779                    bkpinfo->boot_loader, bkpinfo->boot_loader);
    780780            fatal_error
     
    795795        }
    796796        i = which_boot_loader(tmp);
    797         log_msg(3, "boot loader is %c, residing at %s", i, tmp);
     797        mr_msg(3, "boot loader is %c, residing at %s", i, tmp);
    798798        printf(_("boot loader is %c, residing at %s\n"), i, tmp);
    799799        mr_free(tmp);
     
    973973void help_screen()
    974974{
    975     log_msg(1, "Type 'man mondo-archive' for more information\n");
     975    mr_msg(1, "Type 'man mondo-archive' for more information\n");
    976976    exit(1);
    977977}
     
    10651065void termination_in_progress(int sig)
    10661066{
    1067     log_msg(1, "Termination in progress");
     1067    mr_msg(1, "Termination in progress");
    10681068    usleep(1000);
    10691069    pthread_exit(0);
  • trunk/mondo/src/mondorestore/mondo-prep.c

    r1081 r1086  
    6868                     drivelist->el[lino].device, MONDO_WAS_HERE);
    6969            if (!run_program_and_log_output(command, 1)) {
    70                 log_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",
     70                mr_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",
    7171                        lino, drivelist->el[lino].device);
    7272                mr_free(command);
     
    9090                fout = fopen(drivelist->el[lino].device, "w+");
    9191                if (!fout) {
    92                     log_msg(1, "Unable to open+wipe %s",
     92                    mr_msg(1, "Unable to open+wipe %s",
    9393                            drivelist->el[lino].device);
    9494                } else {
    9595                    if (1 != fwrite(buf, strlen(buf)+1, 1, fout)) {
    96                         log_msg(1, "Failed to wipe %s",
     96                        mr_msg(1, "Failed to wipe %s",
    9797                                drivelist->el[lino].device);
    9898                    } else {
    99                         log_msg(1, "Successfully wiped %s",
     99                        mr_msg(1, "Successfully wiped %s",
    100100                                drivelist->el[lino].device);
    101101                    }
     
    114114    }
    115115// Still here? Cool!
    116     log_msg(1, "Cool. I didn't have to wipe anything.");
     116    mr_msg(1, "Cool. I didn't have to wipe anything.");
    117117}
    118118
     
    126126        return (-1);
    127127    }
    128     log_msg(5, "Writing string '%s', one char at a time", str);
     128    mr_msg(5, "Writing string '%s', one char at a time", str);
    129129    j = strlen(str);
    130130    for (i = 0; i < j; i++) {
    131         log_msg(6, "Writing %d ('%c')", str[i], str[i]);
     131        mr_msg(6, "Writing %d ('%c')", str[i], str[i]);
    132132        if ((fq = fopen(FDISK_LOG, "a+"))) {
    133133            fputc(str[i], fq);
     
    141141        }
    142142    }
    143     log_msg(5, "Returning");
     143    mr_msg(5, "Returning");
    144144
    145145    return (i);
     
    198198
    199199    iamhere("STARTING");
    200     log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");
     200    mr_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");
    201201    tmp = find_home_of_exe("lvm");
    202202    if (tmp)    // found it :) cool
     
    239239    if (just_erase_existing_volumes) {
    240240        paranoid_fclose(fin);
    241         log_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");
     241        mr_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");
    242242        sync();
    243243        sync();
     
    245245        sleep(1);
    246246        iamhere("ENDING");
    247         log_msg(1, "Not many errors. Returning 0.");
     247        mr_msg(1, "Not many errors. Returning 0.");
    248248        return (0);
    249249    }
    250250
    251     log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");
     251    mr_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");
    252252    rewind(fin);
    253253    for (mr_getline(&incoming, &n1, fin); !feof(fin); mr_getline(&incoming, &n1, fin)) {
     
    286286            for (q = tmp1; *q > 32; q++);
    287287            *q = '\0';
    288             log_msg(1, "Deleting old entries at /dev/%s", tmp1);
     288            mr_msg(1, "Deleting old entries at /dev/%s", tmp1);
    289289            mr_asprintf(&tmp, "rm -Rf /dev/%s", tmp1);
    290290            mr_free(tmp1);
     
    295295            run_program_and_log_output(vgscan_sz, 1);
    296296            run_program_and_log_output(pvscan_sz, 1);
    297             log_msg(3,
     297            mr_msg(3,
    298298                    "After working around potentially broken i-want-my-lvm, incoming[] is now '%s'",
    299299                    incoming);
     
    311311            res = run_program_and_log_output(command, 5);
    312312        }
    313         log_msg(0, "%s --> %d", command, res);
     313        mr_msg(0, "%s --> %d", command, res);
    314314        if (res > 0) {
    315315            res = 1;
     
    333333            for (p = tmp; *p != '\0' && !isdigit(*p); p++);
    334334            extents = atol(p);
    335             log_msg(5, "p='%s' --> extents=%ld", p, extents);
     335            mr_msg(5, "p='%s' --> extents=%ld", p, extents);
    336336            mr_free(tmp);
    337337
    338338            p = strstr(command, "-L");
    339339            if (!p) {
    340                 log_msg(0, "Fiddlesticks. '%s' returned %d", command, res);
     340                mr_msg(0, "Fiddlesticks. '%s' returned %d", command, res);
    341341            } else {
    342342                if (lvmversion == 2) {
     
    363363                    *(p + i) = ' ';
    364364                }
    365                 log_msg(5, "Retrying with '%s'", command);
     365                mr_msg(5, "Retrying with '%s'", command);
    366366                res = run_program_and_log_output(command, 5);
    367367                if (res > 0) {
     
    371371                    fprintf(g_fprep, "%s\n", command);
    372372                }
    373                 log_msg(0, "%s --> %d", command, res);
     373                mr_msg(0, "%s --> %d", command, res);
    374374                if (!res) {
    375                     log_msg(5, "YAY! This time, it succeeded.");
     375                    mr_msg(5, "YAY! This time, it succeeded.");
    376376                }
    377377            }
    378378        }
    379379        if (strstr(command, "vgcreate")) {
    380             log_msg(0, "In case you're interested...");
     380            mr_msg(0, "In case you're interested...");
    381381            run_program_and_log_output(vgscan_sz, 1);
    382382            run_program_and_log_output(pvscan_sz, 1);
     
    396396    mr_free(incoming);
    397397
    398     log_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");
     398    mr_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");
    399399    sync();
    400400    sync();
     
    403403    iamhere("ENDING");
    404404    if (retval > 2) {
    405         log_msg(1, "%d errors. I'm reporting this.", retval);
     405        mr_msg(1, "%d errors. I'm reporting this.", retval);
    406406        return (retval);
    407407    } else {
    408         log_msg(1, "Not many errors. Returning 0.");
     408        mr_msg(1, "Not many errors. Returning 0.");
    409409        return (0);
    410410    }
     
    550550  // leave straight away if raidlist is initial or has no entries
    551551  if (!raidlist || raidlist->entries == 0) {
    552     log_msg(1, "No RAID arrays found.");
     552    mr_msg(1, "No RAID arrays found.");
    553553    return 1;
    554554  } else {
    555     log_msg(1, "%d RAID arrays found.", raidlist->entries);
     555    mr_msg(1, "%d RAID arrays found.", raidlist->entries);
    556556  }
    557557  // find raidlist entry for requested device
     
    561561  // check whether RAID device was found in raidlist
    562562  if (i == raidlist->entries) {
    563     log_msg(1, "RAID device %s not found in list.", device);
     563    mr_msg(1, "RAID device %s not found in list.", device);
    564564    return 1;
    565565  }
     
    805805        */
    806806
    807         log_msg(1, "Making %s", device);
     807        mr_msg(1, "Making %s", device);
    808808        // use mkraid if it exists, otherwise use mdadm
    809809        if (run_program_and_log_output("which mkraid", FALSE)) {
    810810            res = create_raid_device_via_mdadm(raidlist, device);
    811             log_msg(1, "Creating RAID device %s via mdadm returned %d",
     811            mr_msg(1, "Creating RAID device %s via mdadm returned %d",
    812812                    device, res);
    813813        } else {
    814814            mr_asprintf(&program, "mkraid --really-force %s", device);
    815815            res = run_program_and_log_output(program, 1);
    816             log_msg(1, "%s returned %d", program, res);
     816            mr_msg(1, "%s returned %d", program, res);
    817817            sync();
    818818            sleep(3);
     
    834834
    835835    if (!strcmp(format, "lvm")) {
    836         log_msg(1, "Don't format %s - it's part of an lvm volume", device);
     836        mr_msg(1, "Don't format %s - it's part of an lvm volume", device);
    837837        return (0);
    838838    }
     
    937937// start soft-raids now (because LVM might depend on them)
    938938// ...and for simplicity's sake, let's format them at the same time :)
    939     log_msg(1, "Stopping all RAID devices");
     939    mr_msg(1, "Stopping all RAID devices");
    940940    stop_all_raid_devices(mountlist);
    941941    sync();
     
    943943    sync();
    944944    sleep(2);
    945     log_msg(1, "Prepare soft-RAIDs");   // prep and format too
     945    mr_msg(1, "Prepare soft-RAIDs");    // prep and format too
    946946    for (lino = 0; lino < mountlist->entries; lino++) {
    947947        me = &mountlist->el[lino];  // the current mountlist entry
    948         log_msg(2, "Examining %s", me->device);
     948        mr_msg(2, "Examining %s", me->device);
    949949        if (!strncmp(me->device, "/dev/md", 7)) {
    950950            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);
     
    997997// do regulars at last
    998998    sleep(2);                   // woo!
    999     log_msg(1, "Formatting regulars");
     999    mr_msg(1, "Formatting regulars");
    10001000    for (lino = 0; lino < mountlist->entries; lino++) {
    10011001        me = &mountlist->el[lino];  // the current mountlist entry
     
    16771677        sync();
    16781678        paranoid_pclose(pout_to_fdisk);
    1679         log_msg(0,
     1679        mr_msg(0,
    16801680                "------------------- fdisk.log looks like this ------------------");
    16811681        mr_asprintf(&tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE);
     
    16831683        mr_free(tmp);
    16841684
    1685         log_msg(0,
     1685        mr_msg(0,
    16861686                "------------------- end of fdisk.log... word! ------------------");
    16871687        mr_asprintf(&tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG);
     
    18031803    if (partsize > 0) {
    18041804        if (!strcmp(format, "7")) {
    1805             log_msg(1, "Adding 512K, just in case");
     1805            mr_msg(1, "Adding 512K, just in case");
    18061806            partsize += 512;
    18071807        }
     
    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        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        }
     
    18441844
    18451845        if (!retval) {
    1846             log_msg(1, "Trying to set %s%d's partition type now", drive,
     1846            mr_msg(1, "Trying to set %s%d's partition type now", drive,
    18471847                    partno);
    18481848            retval =
     
    18501850                                   partsize);
    18511851            if (retval) {
    1852                 log_msg(1, "Failed. Trying again...");
     1852                mr_msg(1, "Failed. Trying again...");
    18531853                retval =
    18541854                    set_partition_type(pout_to_fdisk, drive, partno,
     
    18571857        }
    18581858        if (retval) {
    1859             log_msg(1, "...but failed to set type");
     1859            mr_msg(1, "...but failed to set type");
    18601860        }
    18611861    } else {
     
    19591959        /*      mountlist=&new_mtlist; */
    19601960        /*      extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */
    1961         log_msg(0,
     1961        mr_msg(0,
    19621962                "Mountlist, including the partitions incorporated in RAID devices:-");
    19631963        for (i = 0; i < mountlist->entries; i++) {
    19641964            log_it(mountlist->el[i].device);
    19651965        }
    1966         log_msg(0, "End of mountlist.");
    1967     }
    1968     log_msg(0, "Stopping all LVMs, just in case");
     1966        mr_msg(0, "End of mountlist.");
     1967    }
     1968    mr_msg(0, "Stopping all LVMs, just in case");
    19691969    if (!g_text_mode) {
    19701970        newtSuspend();
     
    19741974        newtResume();
    19751975    }
    1976     log_msg(0, "Stopping all software RAID devices, just in case");
     1976    mr_msg(0, "Stopping all software RAID devices, just in case");
    19771977    stop_all_raid_devices(mountlist);
    1978     log_msg(0, "Done.");
     1978    mr_msg(0, "Done.");
    19791979
    19801980/* 
     
    20962096    mr_free(partition);
    20972097
    2098     log_msg(1, tmp);
     2098    mr_msg(1, tmp);
    20992099    mr_free(tmp);
    21002100    if (partcode[0] != '\0' && strcmp(partcode, "83")) {    /* no need to set type if 83: 83 is default */
     
    21062106            if (partno > 1
    21072107                || strstr(tmp1, " (1-4)")) {
    2108                 log_msg(5, "Specifying partno (%d) - yay", partno);
     2108                mr_msg(5, "Specifying partno (%d) - yay", partno);
    21092109                mr_asprintf(&tmp, "%d\n", partno);
    21102110                fput_string_one_char_at_a_time(pout_to_fdisk, tmp);
     
    21122112                mr_free(tmp1);
    21132113                tmp1 = last_line_of_file(FDISK_LOG);
    2114                 log_msg(5, "A - last line = '%s'", tmp1);
     2114                mr_msg(5, "A - last line = '%s'", tmp1);
    21152115            }
    21162116            mr_free(tmp1);
     
    21202120            mr_free(tmp);
    21212121            tmp1 = last_line_of_file(FDISK_LOG);
    2122             log_msg(5, "B - last line = '%s'",tmp1);
     2122            mr_msg(5, "B - last line = '%s'",tmp1);
    21232123            mr_free(tmp1);
    21242124
    21252125            fput_string_one_char_at_a_time(pout_to_fdisk, "\n");
    21262126            tmp1 = last_line_of_file(FDISK_LOG);
    2127             log_msg(5, "C - last line = '%s'",tmp1);
     2127            mr_msg(5, "C - last line = '%s'",tmp1);
    21282128            mr_free(tmp1);
    21292129
    21302130            tmp = last_line_of_file(FDISK_LOG);
    21312131            if (!strstr(tmp, " (m ")) {
    2132                 log_msg(1, "last line = '%s'; part type set failed", tmp);
     2132                mr_msg(1, "last line = '%s'; part type set failed", tmp);
    21332133                res++;
    21342134                fput_string_one_char_at_a_time(pout_to_fdisk, "\n");
     
    21402140            mr_asprintf(&command, "parted2fdisk %s >> %s 2>> %s", drive,
    21412141                    MONDO_LOGFILE, MONDO_LOGFILE);
    2142             log_msg(5, "output = '%s'", output);
    2143             log_msg(5, "partno=%d; partcode=%s", partno, partcode);
    2144             log_msg(5, "command = '%s'", command);
     2142            mr_msg(5, "output = '%s'", output);
     2143            mr_msg(5, "partno=%d; partcode=%s", partno, partcode);
     2144            mr_msg(5, "command = '%s'", command);
    21452145            fout = popen(command, "w");
    21462146            if (!fout) {
     
    21892189    mr_asprintf(&program, "raidstart %s", raid_device);
    21902190#endif
    2191     log_msg(1, "program = %s", program);
     2191    mr_msg(1, "program = %s", program);
    21922192    res = run_program_and_log_output(program, 1);
    21932193    if (g_fprep) {
     
    21972197
    21982198    if (res) {
    2199         log_msg(1, "Warning - failed to start RAID device %s",
     2199        mr_msg(1, "Warning - failed to start RAID device %s",
    22002200                raid_device);
    22012201    }
     
    22382238    }
    22392239#endif
    2240     log_msg(1, "program = %s", program);
     2240    mr_msg(1, "program = %s", program);
    22412241    res = run_program_and_log_output(program, 1);
    22422242    if (g_fprep) {
     
    22462246
    22472247    if (res) {
    2248         log_msg(1, "Warning - failed to stop RAID device %s", raid_device);
     2248        mr_msg(1, "Warning - failed to stop RAID device %s", raid_device);
    22492249    }
    22502250    retval += res;
     
    22632263            (mountlist->el[i].device, RAID_DEVICE_STUB,
    22642264             strlen(RAID_DEVICE_STUB))) {
    2265             log_msg(1, "Starting %s", mountlist->el[i].device);
     2265            mr_msg(1, "Starting %s", mountlist->el[i].device);
    22662266            res = start_raid_device(mountlist->el[i].device);
    22672267            retval += res;
     
    22692269    }
    22702270    if (retval) {
    2271         log_msg(1, "Started all s/w raid devices OK");
     2271        mr_msg(1, "Started all s/w raid devices OK");
    22722272    } else {
    2273         log_msg(1, "Failed to start some/all s/w raid devices");
     2273        mr_msg(1, "Failed to start some/all s/w raid devices");
    22742274    }
    22752275    return (retval);
     
    23462346    paranoid_fclose(fin);
    23472347    if (retval) {
    2348         log_msg(1, "Warning - unable to stop some RAID devices");
     2348        mr_msg(1, "Warning - unable to stop some RAID devices");
    23492349    }
    23502350    sync();
     
    25482548
    25492549        if (!strcmp(drivemntlist->el[partno]->mountpoint, "image")) {
    2550             log_msg(1, "Skipping %s (%s) because it's an image",
     2550            mr_msg(1, "Skipping %s (%s) because it's an image",
    25512551                    drivemntlist->el[partno]->device,
    25522552                    drivemntlist->el[partno]->mountpoint);
     
    26262626    assert(drivemntlist != NULL);
    26272627
    2628     log_msg(1, "Creating list of partitions for drive %s", drive_name);
     2628    mr_msg(1, "Creating list of partitions for drive %s", drive_name);
    26292629
    26302630    mr_asprintf(&tmp_drive_name,drive_name);
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r1081 r1086  
    155155    int retval = 0, res = 0;
    156156
    157     log_msg(2, "let_user_edit_the_mountlist() --- starting");
     157    mr_msg(2, "let_user_edit_the_mountlist() --- starting");
    158158
    159159    assert(bkpinfo != NULL);
     
    162162    if (!bkpinfo->disaster_recovery) {
    163163        mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
    164         log_msg(2, "I guess you're testing edit_mountlist()");
     164        mr_msg(2, "I guess you're testing edit_mountlist()");
    165165    }
    166166    if (!does_file_exist(g_mountlist_fname)) {
     
    207207    for (i = 0; i < mountlist->entries; i++) {
    208208        if (strstr(mountlist->el[i].format, "ompaq")) {
    209             log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
     209            mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
    210210                    i, mountlist->el[i].device, mountlist->el[i].format);
    211211
     
    286286    if (bkpinfo->backup_media_type == iso) {
    287287        if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) {
    288             log_msg(2,
     288            mr_msg(2,
    289289                    "catchall_mode --- iso_fiddly_bits returned w/ error");
    290290            return (1);
    291291        } else {
    292             log_msg(2, "catchall_mode --- iso_fiddly_bits ok");
     292            mr_msg(2, "catchall_mode --- iso_fiddly_bits ok");
    293293        }
    294294    }
    295295
    296296    if (c == 'I') {
    297         log_msg(2, "IM selected");
     297        mr_msg(2, "IM selected");
    298298        retval += interactive_mode(bkpinfo, mountlist, raidlist);
    299299    } else if (c == 'N') {
    300         log_msg(2, "NM selected");
     300        mr_msg(2, "NM selected");
    301301        retval += nuke_mode(bkpinfo, mountlist, raidlist);
    302302    } else if (c == 'C') {
    303         log_msg(2, "CM selected");
     303        mr_msg(2, "CM selected");
    304304        retval += compare_mode(bkpinfo, mountlist, raidlist);
    305305    }
     
    351351    /* try to partition and format */
    352352
    353     log_msg(2, "interactive_mode --- starting (great, assertions OK)");
     353    mr_msg(2, "interactive_mode --- starting (great, assertions OK)");
    354354
    355355    assert(bkpinfo != NULL);
     
    357357    assert(raidlist != NULL);
    358358
    359     log_msg(2, "interactive_mode --- assertions OK");
     359    mr_msg(2, "interactive_mode --- assertions OK");
    360360
    361361    if (g_text_mode) {
     
    378378#endif
    379379    if (strstr(tmp,"noresize")) {
    380         log_msg(1, "Not resizing mountlist.");
     380        mr_msg(1, "Not resizing mountlist.");
    381381    } else {
    382382        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    400400            paranoid_MR_finish(1);
    401401        }
    402         log_msg(2, "Proceeding...");
     402        mr_msg(2, "Proceeding...");
    403403        save_mountlist_to_disk(mountlist, g_mountlist_fname);
    404404        save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME);
     
    496496                          ("Do you want me to restore all of your data?"))))
    497497    {
    498         log_msg(1, "Restoring all data");
     498        mr_msg(1, "Restoring all data");
    499499        retval += restore_everything(bkpinfo, NULL);
    500500    } else if ((restore_all =
     
    520520                        mr_allocstr(bkpinfo->restore_path, ""); // so we restore to [blank]/file/name :)
    521521                    }
    522                     log_msg(1, "Restoring subset");
     522                    mr_msg(1, "Restoring subset");
    523523                    retval += restore_everything(bkpinfo, filelist);
    524524                    free_filelist(filelist);
     
    626626    assert(raidlist != NULL);
    627627    if (iso_fiddly_bits(bkpinfo, nuke_me_please)) {
    628         log_msg(1, "iso_mode --- returning w/ error");
     628        mr_msg(1, "iso_mode --- returning w/ error");
    629629        return (1);
    630630    } else {
     
    726726    assert(raidlist != NULL);
    727727
    728     log_msg(2, "nuke_mode --- starting");
     728    mr_msg(2, "nuke_mode --- starting");
    729729
    730730    get_cfg_file_from_archive_or_bust(bkpinfo);
     
    736736#endif
    737737    if (strstr(tmp,"noresize")) {
    738         log_msg(2, "Not resizing mountlist.");
     738        mr_msg(2, "Not resizing mountlist.");
    739739    } else {
    740740        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    776776#endif
    777777            if (strstr(tmp,"nopart")) {
    778                 log_msg(2,
     778                mr_msg(2,
    779779                        "Not partitioning drives due to 'nopart' option.");
    780780                res = 0;
     
    829829    retval += restore_everything(bkpinfo, NULL);
    830830    if (!run_boot_loader(FALSE)) {
    831         log_msg(1,
     831        mr_msg(1,
    832832                "Great! Boot loader was installed. No need for msg at end.");
    833833        boot_loader_installed = TRUE;
     
    907907    struct s_node *filelist = NULL;
    908908
    909     log_msg(1, "restore_to_live_filesystem() - starting");
     909    mr_msg(1, "restore_to_live_filesystem() - starting");
    910910    assert(bkpinfo != NULL);
    911911
     
    922922    interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    923923    if (bkpinfo->media_device == NULL) {
    924         log_msg(2, "Warning - failed to find media dev");
     924        mr_msg(2, "Warning - failed to find media dev");
    925925    } else {
    926         log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    927     }
    928 
    929 
    930     log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
     926        mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
     927    }
     928
     929
     930    mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
    931931
    932932    open_evalcall_form(_("Thinking..."));
     
    953953    }
    954954    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    955         log_msg(2,
     955        mr_msg(2,
    956956                "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway.");
    957957    }
     
    10381038    if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) <
    10391039        sizeof(biggiestruct)) {
    1040         log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
     1040        mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
    10411041                bigfileno + 1);
    10421042    }
     
    10481048        mr_asprintf(&tmp, "Warning - bigfile %ld does not have a checksum",
    10491049                bigfileno + 1);
    1050         log_msg(3, tmp);
     1050        mr_msg(3, tmp);
    10511051        mr_free(tmp);
    10521052        /* BERLIOS : Useless ???
     
    10681068        node = find_string_at_node(filelist, biggiestruct.filename);
    10691069        if (!node) {
    1070             log_msg(0, "Skipping %s (name isn't in filelist)",
     1070            mr_msg(0, "Skipping %s (name isn't in filelist)",
    10711071                    biggiestruct.filename);
    10721072            return (pathname_of_last_file_restored);
    10731073        } else if (!(node->selected)) {
    1074             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1074            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    10751075                    biggiestruct.filename);
    10761076            return (pathname_of_last_file_restored);
     
    10791079    /* otherwise, continue */
    10801080
    1081     log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
     1081    mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
    10821082    if (biggiestruct.use_ntfsprog) {
    10831083        if (strncmp(biggiestruct.filename, "/dev/", 5)) {
    1084             log_msg(1,
     1084            mr_msg(1,
    10851085                    "I was in error when I set biggiestruct.use_ntfsprog to TRUE.");
    1086             log_msg(1, "%s isn't even in /dev", biggiestruct.filename);
     1086            mr_msg(1, "%s isn't even in /dev", biggiestruct.filename);
    10871087            biggiestruct.use_ntfsprog = FALSE;
    10881088        }
     
    10941094        g_loglevel = 4;
    10951095        use_ntfsprog_hack = TRUE;
    1096         log_msg(2,
     1096        mr_msg(2,
    10971097                "Calling ntfsclone in background because %s is an NTFS /dev entry",
    10981098                outfile_fname);
     
    11061106            fatal_error("Fork failure");
    11071107        case 0:
    1108             log_msg(3,
     1108            mr_msg(3,
    11091109                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    11101110                    biggiestruct.filename, ntfsprog_fifo);
     
    11121112                feed_outfrom_ntfsprog(biggiestruct.filename,
    11131113                                      ntfsprog_fifo);
    1114 //          log_msg(3, "CHILD - fip - exiting");
     1114//          mr_msg(3, "CHILD - fip - exiting");
    11151115            exit(res);
    11161116            break;
    11171117        default:
    1118             log_msg(3,
     1118            mr_msg(3,
    11191119                    "feed_into_ntfsprog() called in background --- pid=%ld",
    11201120                    (long int) (pid));
     
    11331133    mr_asprintf(&tmp, "Reassembling big file %ld (%s)", bigfileno + 1,
    11341134            outfile_fname);
    1135     log_msg(2, tmp);
     1135    mr_msg(2, tmp);
    11361136    mr_free(tmp);
    11371137
     
    11441144    mr_asprintf(&pathname_of_last_file_restored, biggiestruct.filename);
    11451145
    1146     log_msg(3, "file_to_openout = %s", file_to_openout);
     1146    mr_msg(3, "file_to_openout = %s", file_to_openout);
    11471147    if (!(fout = fopen(file_to_openout, "w"))) {
    11481148        log_to_screen(_("Cannot openout outfile_fname - hard disk full?"));
    11491149        return (pathname_of_last_file_restored);
    11501150    }
    1151     log_msg(3, "Opened out to %s", outfile_fname);  // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
     1151    mr_msg(3, "Opened out to %s", outfile_fname);   // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
    11521152
    11531153    for (sliceno = 1, finished = FALSE; !finished;) {
     
    11601160            !does_file_exist(tmp1) &&
    11611161            !does_file_exist(tmp2)) {
    1162             log_msg(3,
     1162            mr_msg(3,
    11631163                    "Cannot find a data slice or terminator slice on CD %d",
    11641164                    g_current_media_number);
     
    11681168                    bkpinfo->backup_media_string,
    11691169                    g_current_media_number, sliceno);
    1170             log_msg(2, tmp3);
     1170            mr_msg(2, tmp3);
    11711171            mr_free(tmp3);
    11721172
     
    11811181        } else {
    11821182            if (does_file_exist(tmp) && length_of_file(tmp) == 0) {
    1183                 log_msg(2,
     1183                mr_msg(2,
    11841184                        "End of bigfile # %ld (slice %ld is the terminator)",
    11851185                        bigfileno + 1, sliceno);
     
    12071207                    bkpinfo->backup_media_string,
    12081208                    g_current_media_number, bigfileno + 1, sliceno);
    1209             log_msg(2, tmp3);
     1209            mr_msg(2, tmp3);
    12101210            if (!g_text_mode) {
    12111211                newtDrawRootText(0, g_noof_rows - 2, tmp3);
     
    12431243
    12441244    if (use_ntfsprog_hack) {
    1245         log_msg(3, "Waiting for ntfsclone to finish");
     1245        mr_msg(3, "Waiting for ntfsclone to finish");
    12461246        mr_asprintf(&tmp,
    12471247                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    13211321    if (use_ntfsprog == BLK_START_A_PIHBIGGIE) {
    13221322        use_ntfsprog = 1;
    1323         log_msg(1, "%s --- pih=YES", orig_bf_fname);
     1323        mr_msg(1, "%s --- pih=YES", orig_bf_fname);
    13241324    } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) {
    13251325        use_ntfsprog = 0;
    1326         log_msg(1, "%s --- pih=NO", orig_bf_fname);
     1326        mr_msg(1, "%s --- pih=NO", orig_bf_fname);
    13271327    } else {
    13281328        use_ntfsprog = 0;
    1329         log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
     1329        mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
    13301330    }
    13311331
     
    13381338        if (!node) {
    13391339            dummy_restore = TRUE;
    1340             log_msg(1,
     1340            mr_msg(1,
    13411341                    "Skipping big file %ld (%s) - not in biggielist subset",
    13421342                    biggiefile_number + 1, orig_bf_fname);
     
    13441344        } else if (!(node->selected)) {
    13451345            dummy_restore = TRUE;
    1346             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1346            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    13471347                    orig_bf_fname);
    13481348            pathname_of_last_file_restored = NULL;
     
    13521352    if (use_ntfsprog) {
    13531353        if (strncmp(orig_bf_fname, "/dev/", 5)) {
    1354             log_msg(1, "I was in error when I set use_ntfsprog to TRUE.");
    1355             log_msg(1, "%s isn't even in /dev", orig_bf_fname);
     1354            mr_msg(1, "I was in error when I set use_ntfsprog to TRUE.");
     1355            mr_msg(1, "%s isn't even in /dev", orig_bf_fname);
    13561356            use_ntfsprog = FALSE;
    13571357        }
     
    13621362        mr_asprintf(&outfile_fname, orig_bf_fname);
    13631363        use_ntfsprog_hack = TRUE;
    1364         log_msg(2,
     1364        mr_msg(2,
    13651365                "Calling ntfsclone in background because %s is a /dev entry",
    13661366                outfile_fname);
     
    13761376            fatal_error("Fork failure");
    13771377        case 0:
    1378             log_msg(3,
     1378            mr_msg(3,
    13791379                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    13801380                    outfile_fname, ntfsprog_fifo);
    13811381            res = feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo);
    1382 //          log_msg(3, "CHILD - fip - exiting");
     1382//          mr_msg(3, "CHILD - fip - exiting");
    13831383            exit(res);
    13841384            break;
    13851385        default:
    1386             log_msg(3,
     1386            mr_msg(3,
    13871387                    "feed_into_ntfsprog() called in background --- pid=%ld",
    13881388                    (long int) (pid));
     
    14061406        mr_asprintf(&tmp1, "Reassembling big file %ld (%s)",
    14071407                biggiefile_number + 1, orig_bf_fname);
    1408         log_msg(2, tmp1);
     1408        mr_msg(2, tmp1);
    14091409        mr_free(tmp1);
    14101410    }
     
    14221422    }
    14231423    mr_asprintf(&tmp1, "Pipe command = '%s'", command);
    1424     log_msg(3, tmp1);
     1424    mr_msg(3, tmp1);
    14251425    mr_free(tmp1);
    14261426
     
    14391439        mr_asprintf(&tmp1, "Working on file #%ld, slice #%ld    ",
    14401440                biggiefile_number + 1, current_slice_number);
    1441         log_msg(2, tmp1);
     1441        mr_msg(2, tmp1);
    14421442
    14431443        if (!g_text_mode) {
     
    14601460                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    14611461                     fin) < sizeof(biggiestruct)) {
    1462                     log_msg(2,
     1462                    mr_msg(2,
    14631463                            "Warning - unable to get biggiestruct of bigfile #%d",
    14641464                            biggiefile_number + 1);
     
    14811481    paranoid_pclose(pout);
    14821482
    1483     log_msg(1, "pathname_of_last_file_restored is now %s",
     1483    mr_msg(1, "pathname_of_last_file_restored is now %s",
    14841484            pathname_of_last_file_restored);
    14851485
    14861486    if (use_ntfsprog_hack) {
    1487         log_msg(3, "Waiting for ntfsclone to finish");
     1487        mr_msg(3, "Waiting for ntfsclone to finish");
    14881488        mr_asprintf(&tmp,
    14891489                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    14921492        }   
    14931493        mr_free(tmp);
    1494         log_msg(3, "OK, ntfsclone has really finished");
    1495     }
    1496 
    1497     log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
    1498     log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
     1494        mr_msg(3, "OK, ntfsclone has really finished");
     1495    }
     1496
     1497    mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
     1498    mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
    14991499    if (strcmp(outfile_fname, "/dev/null")) {
    15001500        chmod(outfile_fname, biggiestruct.properties.st_mode);
     
    15501550    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    15511551
    1552     log_msg(5, "Entering");
     1552    mr_msg(5, "Entering");
    15531553    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
    15541554    mr_asprintf(&command, "mkdir -p %s/tmp", MNT_RESTORING);
     
    15591559            current_tarball_number);
    15601560    if (length_of_file(filelist_name) <= 2) {
    1561         log_msg(2, "There are _zero_ files in filelist '%s'",
     1561        mr_msg(2, "There are _zero_ files in filelist '%s'",
    15621562                filelist_name);
    1563         log_msg(2,
     1563        mr_msg(2,
    15641564                "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)");
    1565         log_msg(2,
     1565        mr_msg(2,
    15661566                "but it's non-critical. It's cosmetic. Don't worry about it.");
    15671567        retval = 0;
    1568         log_msg(5, "Leaving");
     1568        mr_msg(5, "Leaving");
    15691569        return (retval);
    15701570    }
    15711571    if (count_lines_in_file(filelist_name) <= 0
    15721572        || length_of_file(tarball_fname) <= 0) {
    1573         log_msg(3, "length_of_file(%s) = %llu", tarball_fname,
     1573        mr_msg(3, "length_of_file(%s) = %llu", tarball_fname,
    15741574                length_of_file(tarball_fname));
    15751575        mr_asprintf(&tmp, "Unable to restore fileset #%ld (CD I/O error)",
     
    15781578        mr_free(tmp);
    15791579        retval = 1;
    1580         log_msg(5, "Leaving");
     1580        mr_msg(5, "Leaving");
    15811581        return (retval);
    15821582    }
     
    15911591            <= 0) {
    15921592            mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number);
    1593             log_msg(1, tmp);
     1593            mr_msg(1, tmp);
    15941594            mr_free(tmp);
    15951595        } else {
    1596             log_msg(3, "Saved fileset %ld's subset to %s",
     1596            mr_msg(3, "Saved fileset %ld's subset to %s",
    15971597                    current_tarball_number, filelist_subset_fname);
    15981598        }
     
    16781678
    16791679#undef BUFSIZE
    1680         log_msg(1, "command = '%s'", command);
     1680        mr_msg(1, "command = '%s'", command);
    16811681        unlink(temp_log);
    16821682        res = system(command);
     
    16851685            if (p) {
    16861686                p[0] = p[1] = p[2] = p[3] = ' ';
    1687                 log_msg(1, "new command = '%s'", command);
     1687                mr_msg(1, "new command = '%s'", command);
    16881688                res = system(command);
    16891689            }
     
    16961696
    16971697        if (g_getfattr) {
    1698             log_msg(1, "Setting fattr list %s", xattr_fname);
     1698            mr_msg(1, "Setting fattr list %s", xattr_fname);
    16991699            if (length_of_file(xattr_fname) > 0) {
    17001700                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     
    17031703                        ("Errors occurred while setting extended attributes");
    17041704                } else {
    1705                     log_msg(1, "I set xattr OK");
     1705                    mr_msg(1, "I set xattr OK");
    17061706                }
    17071707                retval += res;
     
    17091709        }
    17101710        if (g_getfacl) {
    1711             log_msg(1, "Setting acl list %s", acl_fname);
     1711            mr_msg(1, "Setting acl list %s", acl_fname);
    17121712            if (length_of_file(acl_fname) > 0) {
    17131713                res = set_acl_list(filelist_subset_fname, acl_fname);
     
    17161716                        ("Errors occurred while setting access control lists");
    17171717                } else {
    1718                     log_msg(1, "I set ACL OK");
     1718                    mr_msg(1, "I set ACL OK");
    17191719                }
    17201720                retval += res;
     
    17251725            system(command);
    17261726            mr_free(command);
    1727             log_msg(2, "Errors occurred while processing fileset #%d",
     1727            mr_msg(2, "Errors occurred while processing fileset #%d",
    17281728                    current_tarball_number);
    17291729        } else {
    1730             log_msg(2, "Fileset #%d processed OK", current_tarball_number);
     1730            mr_msg(2, "Fileset #%d processed OK", current_tarball_number);
    17311731        }
    17321732        unlink(xattr_fname);
     
    17451745    mr_free(acl_fname);
    17461746    mr_free(temp_log);
    1747     log_msg(5, "Leaving");
     1747    mr_msg(5, "Leaving");
    17481748    return (retval);
    17491749}
     
    18001800            bkpinfo->backup_media_string,
    18011801            g_current_media_number);
    1802     log_msg(2, tmp);
     1802    mr_msg(2, tmp);
    18031803    mr_free(tmp);
    18041804    run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE);
     
    18201820    }
    18211821    if (res) {
    1822         log_msg(1, "Warning - error reading afioball from tape");
     1822        mr_msg(1, "Warning - error reading afioball from tape");
    18231823    }
    18241824    if (bkpinfo->compression_level != 0) {
     
    18431843                    executable, afio_fname, filelist_fname, MONDO_LOGFILE);
    18441844        }
    1845         log_msg(1, "command = %s", command);
     1845        mr_msg(1, "command = %s", command);
    18461846        if (system(command)) {
    1847             log_msg(4, "Warning - error occurred while retrieving TOC");
     1847            mr_msg(4, "Warning - error occurred while retrieving TOC");
    18481848        }
    18491849        mr_free(command);
     
    18541854            <= 0 || length_of_file(filelist_subset_fname) < 2) {
    18551855            if (length_of_file(filelist_subset_fname) < 2) {
    1856                 log_msg(1, "No matches found in fileset %ld",
     1856                mr_msg(1, "No matches found in fileset %ld",
    18571857                        current_tarball_number);
    18581858            }
    18591859            mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number);
    1860             log_msg(2, tmp);
     1860            mr_msg(2, tmp);
    18611861            mr_free(tmp);
    18621862            restore_this_fileset = FALSE;
    18631863        } else {
    1864             log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
     1864            mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
    18651865                    matches, current_tarball_number,
    18661866                    filelist_subset_fname);
     
    18921892    // Call if IF there are files to restore (selectively/unconditionally)
    18931893    if (restore_this_fileset) {
    1894         log_msg(1, "Calling command='%s'", command);
     1894        mr_msg(1, "Calling command='%s'", command);
    18951895        paranoid_system(command);
    18961896
     
    18991899            res = set_fattr_list(filelist_subset_fname, xattr_fname);
    19001900            if (res) {
    1901                 log_msg(1, "Errors occurred while setting xattr");
     1901                mr_msg(1, "Errors occurred while setting xattr");
    19021902            } else {
    1903                 log_msg(1, "I set xattr OK");
     1903                mr_msg(1, "I set xattr OK");
    19041904            }
    19051905            retval += res;
     
    19101910            res = set_acl_list(filelist_subset_fname, acl_fname);
    19111911            if (res) {
    1912                 log_msg(1, "Errors occurred while setting ACL");
     1912                mr_msg(1, "Errors occurred while setting ACL");
    19131913            } else {
    1914                 log_msg(1, "I set ACL OK");
     1914                mr_msg(1, "I set ACL OK");
    19151915            }
    19161916            retval += res;
     
    19181918
    19191919    } else {
    1920         log_msg(1, "NOT CALLING '%s'", command);
     1920        mr_msg(1, "NOT CALLING '%s'", command);
    19211921    }
    19221922    mr_free(command);
     
    19701970            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    19711971    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    1972         log_msg(1, "Warning - cannot openout %s",
     1972        mr_msg(1, "Warning - cannot openout %s",
    19731973                biggies_whose_EXATs_we_should_set);
    19741974    }
     
    19831983
    19841984    if (length_of_file(BIGGIELIST) < 6) {
    1985         log_msg(1, "OK, no biggielist; not restoring biggiefiles");
     1985        mr_msg(1, "OK, no biggielist; not restoring biggiefiles");
    19861986        return (0);
    19871987    }
    19881988    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    19891989    if (noof_biggiefiles <= 0) {
    1990         log_msg(2,
     1990        mr_msg(2,
    19911991                "OK, no biggiefiles in biggielist; not restoring biggiefiles");
    19921992        return (0);
     
    19941994    mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives",
    19951995            noof_biggiefiles);
    1996     log_msg(2, tmp);
     1996    mr_msg(2, tmp);
    19971997    mr_free(tmp);
    19981998
     
    20022002                       "", total_slices);
    20032003    for (bigfileno = 0, finished = FALSE; !finished;) {
    2004         log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
     2004        mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
    20052005        tmp = slice_fname(bigfileno, 0, ARCHIVES_PATH, "");
    20062006        if (!does_file_exist(tmp)) {
    2007             log_msg(3,
     2007            mr_msg(3,
    20082008                    "...but its first slice isn't on this CD. Perhaps this was a selective restore?");
    2009             log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
     2009            mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
    20102010                    bigfileno + 1,
    20112011                    bkpinfo->backup_media_string,
    20122012                    g_current_media_number);
    20132013            tmp1 = slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, "");
    2014             log_msg(3, "Slicename would have been %s", tmp1);
     2014            mr_msg(3, "Slicename would have been %s", tmp1);
    20152015            mr_free(tmp1);
    20162016
     
    20182018            if (just_changed_cds) {
    20192019                just_changed_cds = FALSE;
    2020                 log_msg(3,
     2020                mr_msg(3,
    20212021                        "I'll continue to scan this CD for bigfiles to be restored.");
    20222022            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
     
    20312031                just_changed_cds = TRUE;
    20322032            } else {
    2033                 log_msg(2, "There was no bigfile #%ld. That's OK.",
     2033                mr_msg(2, "There was no bigfile #%ld. That's OK.",
    20342034                        bigfileno + 1);
    2035                 log_msg(2, "I'm going to stop restoring bigfiles now.");
     2035                mr_msg(2, "I'm going to stop restoring bigfiles now.");
    20362036                finished = TRUE;
    20372037            }
     
    21222122
    21232123    mvaddstr_and_log_it(g_currentY, 0, _("Restoring from archives"));
    2124     log_msg(2,
     2124    mr_msg(2,
    21252125            "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER");
    21262126    if (g_current_media_number != 1) {
    2127         log_msg(3, "OK, that's jacked up.");
     2127        mr_msg(3, "OK, that's jacked up.");
    21282128        g_current_media_number = 1;
    21292129    }
     
    21992199                    bkpinfo->backup_media_string,
    22002200                    g_current_media_number);
    2201 //    log_msg(3, "progress_str = %s", progress_str);
     2201//    mr_msg(3, "progress_str = %s", progress_str);
    22022202            for (res = 999, attempts = 0; attempts < 3 && res != 0;
    22032203                 attempts++) {
     
    22992299            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    23002300    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2301         log_msg(1, "Warning - cannot openout %s",
     2301        mr_msg(1, "Warning - cannot openout %s",
    23022302                biggies_whose_EXATs_we_should_set);
    23032303    }
     
    23152315    mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives",
    23162316            noof_biggiefiles);
    2317     log_msg(2, tmp);
     2317    mr_msg(2, tmp);
    23182318    mr_free(tmp);
    23192319
     
    23502350                                               current_bigfile_number,
    23512351                                               filelist, ctrl_chr);
    2352         log_msg(1, "I believe I have restored %s",
     2352        mr_msg(1, "I believe I have restored %s",
    23532353                pathname_of_last_biggie_restored);
    23542354        if (fbw && pathname_of_last_biggie_restored[0]) {
     
    23702370                noof_biggiefiles, current_bigfile_number);
    23712371    }
    2372     log_msg(1, tmp);
     2372    mr_msg(1, tmp);
    23732373    mr_free(tmp);
    23742374
     
    23792379            if (g_getfattr) {
    23802380                if (length_of_file(xattr_fname) > 0) {
    2381                     log_msg(1, "set_fattr_List(%s,%s)",
     2381                    mr_msg(1, "set_fattr_List(%s,%s)",
    23822382                        biggies_whose_EXATs_we_should_set, xattr_fname);
    23832383                    set_fattr_list(biggies_whose_EXATs_we_should_set,
     
    23872387            if (g_getfacl) {
    23882388                if (length_of_file(acl_fname) > 0) {
    2389                     log_msg(1, "set_acl_list(%s,%s)",
     2389                    mr_msg(1, "set_acl_list(%s,%s)",
    23902390                            biggies_whose_EXATs_we_should_set, acl_fname);
    23912391                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     
    24692469                       progress_str, max_val);
    24702470
    2471     log_msg(3, "hey");
     2471    mr_msg(3, "hey");
    24722472
    24732473    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    24742474    if (res) {
    2475         log_msg(2, "Warning - error reading afioball from tape");
     2475        mr_msg(2, "Warning - error reading afioball from tape");
    24762476    }
    24772477    retval += res;
     
    24792479        wrong_marker(BLK_START_AFIOBALLS, ctrl_chr);
    24802480    }
    2481     log_msg(2, "ho");
     2481    mr_msg(2, "ho");
    24822482    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    24832483    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
     
    25482548    mr_free(tmp_fname);
    25492549
    2550     log_msg(1, "All done with afioballs");
     2550    mr_msg(1, "All done with afioballs");
    25512551    close_progress_form();
    25522552    if (retval) {
     
    25862586    malloc_string(cwd);
    25872587    malloc_string(newpath);
    2588     log_msg(2, "restore_everything() --- starting");
     2588    mr_msg(2, "restore_everything() --- starting");
    25892589    g_current_media_number = 1;
    25902590    /* BERLIOS: should test return value, or better change the function */
     
    25942594    mr_free(tmp);
    25952595
    2596     log_msg(1, "Changing dir to %s", bkpinfo->restore_path);
     2596    mr_msg(1, "Changing dir to %s", bkpinfo->restore_path);
    25972597    chdir(bkpinfo->restore_path);
    25982598    /* BERLIOS: should test return value, or better change the function */
    25992599    getcwd(newpath, MAX_STR_LEN - 1);
    2600     log_msg(1, "path is now %s", newpath);
    2601     log_msg(1, "restoring everything");
     2600    mr_msg(1, "path is now %s", newpath);
     2601    mr_msg(1, "restoring everything");
    26022602    tmp = find_home_of_exe("petris");
    26032603    if (!tmp && !g_text_mode) {
     
    26422642    }
    26432643    if (length_of_file("/etc/raidtab") > 0) {
    2644         log_msg(2, "Copying local raidtab to restored filesystem");
     2644        mr_msg(2, "Copying local raidtab to restored filesystem");
    26452645        run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING
    26462646                                   "/etc/raidtab", FALSE);
    26472647    }
    26482648    kill_petris();
    2649     log_msg(2, "restore_everything() --- leaving");
     2649    mr_msg(2, "restore_everything() --- leaving");
    26502650    mr_free(cwd);
    26512651    mr_free(newpath);
     
    26902690    sprintf(tmp, "restore_here = '%s'", restore_here);
    26912691
    2692     log_msg(2, tmp);
    2693 
    2694     log_msg(2, "restore_live_from_monitas_server() - starting");
     2692    mr_msg(2, tmp);
     2693
     2694    mr_msg(2, "restore_live_from_monitas_server() - starting");
    26952695    unlink("/tmp/mountlist.txt");
    26962696    unlink("/tmp/filelist.full");
     
    27012701        strcpy(bkpinfo->restore_path, restore_here);
    27022702    }
    2703     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2703    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27042704    sprintf(tmp, "FYI - data will be restored to %s",
    27052705            bkpinfo->restore_path);
    2706     log_msg(3, tmp);
    2707     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2706    mr_msg(3, tmp);
     2707    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27082708    sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d",
    27092709            (int) (random() % 32768));
     
    27562756            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
    27572757    if (system(command)) {
    2758         log_msg(1,
     2758        mr_msg(1,
    27592759                "Error(s) occurred while processing biggielist and wildcard");
    27602760    }
     
    27642764    retval += restore_everything(bkpinfo, filelist);
    27652765    free_filelist(filelist);
    2766     log_msg(2, "--------End of restore_live_from_monitas_server--------");
     2766    mr_msg(2, "--------End of restore_live_from_monitas_server--------");
    27672767    return (retval);
    27682768}
     
    27852785void welcome_to_mondorestore()
    27862786{
    2787     log_msg(0, "-------------- Mondo Restore v%s -------------",
     2787    mr_msg(0, "-------------- Mondo Restore v%s -------------",
    27882788            PACKAGE_VERSION);
    2789     log_msg(0,
     2789    mr_msg(0,
    27902790            "DON'T PANIC! Mondorestore logs almost everything, so please ");
    2791     log_msg(0,
     2791    mr_msg(0,
    27922792            "don't break out in a cold sweat just because you see a few  ");
    2793     log_msg(0,
     2793    mr_msg(0,
    27942794            "error messages in the log. Read them; analyze them; see if  ");
    2795     log_msg(0,
     2795    mr_msg(0,
    27962796            "they are significant; above all, verify your backups! Please");
    2797     log_msg(0,
     2797    mr_msg(0,
    27982798            "attach a compressed copy of this log to any e-mail you send ");
    2799     log_msg(0,
     2799    mr_msg(0,
    28002800            "to the Mondo mailing list when you are seeking technical    ");
    2801     log_msg(0,
     2801    mr_msg(0,
    28022802            "support. Without it, we can't help you.            - DevTeam");
    2803     log_msg(0,
     2803    mr_msg(0,
    28042804            "------------------------------------------------------------");
    2805     log_msg(0,
     2805    mr_msg(0,
    28062806            "BTW, despite (or perhaps because of) the wealth of messages,");
    2807     log_msg(0,
     2807    mr_msg(0,
    28082808            "some users are inclined to stop reading this log.  If Mondo ");
    2809     log_msg(0,
     2809    mr_msg(0,
    28102810            "stopped for some reason, chances are it's detailed here.    ");
    2811     log_msg(0,
     2811    mr_msg(0,
    28122812            "More than likely there's a message near the end of this     ");
    2813     log_msg(0,
     2813    mr_msg(0,
    28142814            "log that will tell you what is wrong.  Please read it!      ");
    2815     log_msg(0,
     2815    mr_msg(0,
    28162816            "------------------------------------------------------------");
    28172817}
     
    28632863    if (strstr(tmp,"textonly")) {
    28642864        g_text_mode = TRUE;
    2865         log_msg(1, "TEXTONLY MODE");
     2865        mr_msg(1, "TEXTONLY MODE");
    28662866    } else {
    28672867        g_text_mode = FALSE;
     
    28962896    g_kernel_version = get_kernel_version();
    28972897
    2898     log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
     2898    mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
    28992899    mkdir(MNT_CDROM, 0x770);
    29002900
     
    29022902    mr_asprintf(&tmp, "%s.orig", g_mountlist_fname);
    29032903    if (!does_file_exist(g_mountlist_fname)) {
    2904         log_msg(2,
     2904        mr_msg(2,
    29052905                "%ld: Warning - g_mountlist_fname (%s) does not exist yet",
    29062906                __LINE__, g_mountlist_fname);
     
    29322932    welcome_to_mondorestore();
    29332933    if (bkpinfo->disaster_recovery) {
    2934         log_msg(1, "I am in disaster recovery mode");
     2934        mr_msg(1, "I am in disaster recovery mode");
    29352935    } else {
    2936         log_msg(1, "I am in normal, live mode");
     2936        mr_msg(1, "I am in normal, live mode");
    29372937    }
    29382938
     
    30193019
    30203020    if (argc == 5 && strcmp(argv[1], "--copy") == 0) {
    3021         log_msg(1, "SCORE");
     3021        mr_msg(1, "SCORE");
    30223022        g_loglevel = 10;
    30233023        if (strstr(argv[2], "save")) {
    3024             log_msg(1, "Saving from %s to %s", argv[3], argv[4]);
     3024            mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
    30253025            fin = fopen(argv[3], "r");
    30263026            fout = fopen(argv[4], "w");
     
    30753075//    return(1);
    30763076        }
    3077         log_msg(1, "I am in normal, live mode.");
    3078         log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
     3077        mr_msg(1, "I am in normal, live mode.");
     3078        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
    30793079        mount_boot_if_necessary();  /* for Gentoo users */
    3080         log_msg(2, "Still here.");
     3080        mr_msg(2, "Still here.");
    30813081        if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {
    30823082            g_restoring_live_from_cd = TRUE;
    30833083        } else {
    3084             log_msg(2, "Calling restore_to_live_filesystem()");
     3084            mr_msg(2, "Calling restore_to_live_filesystem()");
    30853085            retval = restore_to_live_filesystem(bkpinfo);
    30863086        }
    3087         log_msg(2, "Still here. Yay.");
     3087        mr_msg(2, "Still here. Yay.");
    30883088        if (strlen(bkpinfo->tmpdir) > 0) {
    30893089            mr_asprintf(&tmp, "rm -Rf %s/*", bkpinfo->tmpdir);
     
    30953095    } else {
    30963096        /* Disaster recovery mode (must be) */
    3097         log_msg(1, "I must be in disaster recovery mode.");
    3098         log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
     3097        mr_msg(1, "I must be in disaster recovery mode.");
     3098        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
    30993099        if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {
    31003100            log_to_screen(_("Uh, that hasn't been implemented yet."));
     
    31153115            if (bkpinfo->backup_media_type == nfs
    31163116                && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    3117                 log_msg(1, "Mounting nfs dir");
     3117                mr_msg(1, "Mounting nfs dir");
    31183118                mr_allocstr(bkpinfo->isodir, "/tmp/isodir");
    31193119                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
     
    31333133
    31343134
    3135         log_msg(1, "Send in the clowns.");
     3135        mr_msg(1, "Send in the clowns.");
    31363136
    31373137        if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {
    3138             log_msg(0, "Partitioning only.");
     3138            mr_msg(0, "Partitioning only.");
    31393139            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31403140            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31453145
    31463146        if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {
    3147             log_msg(0, "Formatting only.");
     3147            mr_msg(0, "Formatting only.");
    31483148            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31493149            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31543154
    31553155        if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {
    3156             log_msg(0, "Stopping LVM and RAID");
     3156            mr_msg(0, "Stopping LVM and RAID");
    31573157            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31583158            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    32413241// g_I_have_just_nuked is set true by nuke_mode() just before it returns
    32423242    if (!system("which post-nuke > /dev/null 2> /dev/null")) {
    3243       log_msg(1, "post-nuke found; find out whether we should run it...");
     3243      mr_msg(1, "post-nuke found; find out whether we should run it...");
    32443244      if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
    32453245        run_postnuke = TRUE;
    3246         log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
     3246        mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
    32473247      } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) {
    32483248        run_postnuke = TRUE;
    3249         log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
     3249        mr_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
    32503250      } else {
    32513251        run_postnuke = FALSE;
    3252         log_msg(1, "No, will not run post-nuke.");
     3252        mr_msg(1, "No, will not run post-nuke.");
    32533253      }
    32543254    } else {
    3255       log_msg(1, "No post-nuke found.");
     3255      mr_msg(1, "No post-nuke found.");
    32563256    }
    32573257    if (run_postnuke) {
     
    32613261          ("Unable to re-mount partitions for post-nuke stuff");
    32623262      } else {
    3263         log_msg(1, "Re-mounted partitions for post-nuke stuff");
     3263        mr_msg(1, "Re-mounted partitions for post-nuke stuff");
    32643264        sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path,
    32653265            retval);
    3266         log_msg(2, "Calling '%s'", tmp);
     3266        mr_msg(2, "Calling '%s'", tmp);
    32673267        if ((res = run_program_and_log_output(tmp, 0))) {
    32683268          log_OS_error(tmp);
    32693269        }
    3270         log_msg(1, "post-nuke returned w/ res=%d", res);
     3270        mr_msg(1, "post-nuke returned w/ res=%d", res);
    32713271      }
    32723272      unmount_all_devices(mountlist);
  • trunk/mondo/src/mondorestore/mondo-rstr-compare.c

    r1081 r1086  
    5757            insist_on_this_cd_number(bkpinfo, (++g_current_media_number));
    5858        } else {
    59             log_msg(2, "No CD's left. No biggiefiles left. No problem.");
     59            mr_msg(2, "No CD's left. No biggiefiles left. No problem.");
    6060            return (0);
    6161        }
     
    7777    mr_asprintf(&bigfile_fname, biggiestruct.filename);
    7878
    79     log_msg(2, "biggiestruct.filename = %s", bigfile_fname);
    80     log_msg(2, "biggiestruct.checksum = %s", checksum);
     79    mr_msg(2, "biggiestruct.filename = %s", bigfile_fname);
     80    mr_msg(2, "biggiestruct.checksum = %s", checksum);
    8181
    8282    if (!g_text_mode) {
     
    8888    /* BERLIOS: Useless ?
    8989    if (!checksum[0]) {
    90         log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
     90        mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
    9191    } */
    9292    if (!strncmp(bigfile_fname, "/dev/", 5)) {
    93         log_msg(2, _("Ignoring device %s"), bigfile_fname);
     93        mr_msg(2, _("Ignoring device %s"), bigfile_fname);
    9494        return(0);
    9595    } else {
     
    9898                MNT_RESTORING, bigfile_fname);
    9999    }
    100     log_msg(2, command);
     100    mr_msg(2, command);
    101101    paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null");
    102102    if (system(command)) {
     
    108108        mr_free(command);
    109109        if (!(fin = fopen("/tmp/md5sum.txt", "r"))) {
    110             log_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum");
     110            mr_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum");
    111111            mr_free(bigfile_fname);
    112112            return (1);
     
    124124    }
    125125    if (!strcmp(checksum, original_cksum) != 0) {
    126         log_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname);
    127     } else {
    128         log_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname);
     126        mr_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname);
     127    } else {
     128        mr_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname);
    129129        retval++;
    130130    }
     
    162162
    163163    assert(bkpinfo != NULL);
    164     log_msg(1, "Comparing biggiefiles");
     164    mr_msg(1, "Comparing biggiefiles");
    165165
    166166    if (length_of_file(BIGGIELIST) < 6) {
    167         log_msg(1,
     167        mr_msg(1,
    168168                "OK, really teeny-tiny biggielist; not comparing biggiefiles");
    169169        return (0);
     
    171171    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    172172    if (noof_biggiefiles <= 0) {
    173         log_msg(1, "OK, no biggiefiles; not comparing biggiefiles");
     173        mr_msg(1, "OK, no biggiefiles; not comparing biggiefiles");
    174174        return (0);
    175175    }
     
    183183    for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) {
    184184        mr_asprintf(&tmp, "Comparing big file #%ld", bigfileno + 1);
    185         log_msg(1, tmp);
     185        mr_msg(1, tmp);
    186186        update_progress_form(tmp);
    187187        mr_free(tmp);
     
    322322                "Differences found while processing fileset #%d       ",
    323323                current_tarball_number);
    324         log_msg(1, tmp);
     324        mr_msg(1, tmp);
    325325        mr_free(tmp);
    326326    }
     
    402402                       "/archives/slice* > /dev/null 2> /dev/null")
    403403                == 0) {
    404                 log_msg(2, "OK, I think I'm done with tarballs...");
     404                mr_msg(2, "OK, I think I'm done with tarballs...");
    405405                mr_free(tarball_fname);
    406406                break;
    407407            }
    408             log_msg(2, "OK, I think it's time for another CD...");
     408            mr_msg(2, "OK, I think it's time for another CD...");
    409409            g_current_media_number++;
    410410            mr_free(progress_str);
     
    590590            mr_free(tmp);
    591591
    592             log_msg(2, "calling popup_changelist_from_file()");
     592            mr_msg(2, "calling popup_changelist_from_file()");
    593593            popup_changelist_from_file("/tmp/changed.files");
    594             log_msg(2, "Returning from popup_changelist_from_file()");
     594            mr_msg(2, "Returning from popup_changelist_from_file()");
    595595        }
    596596    } else {
     
    650650    if (length_of_file("/tmp/changed.txt") > 2
    651651        && length_of_file("/tmp/changed.files") > 2) {
    652         log_msg(0,
     652        mr_msg(0,
    653653                "Type 'less /tmp/changed.files' to see which files don't match the archives");
    654         log_msg(2, "Calling popup_changelist_from_file()");
     654        mr_msg(2, "Calling popup_changelist_from_file()");
    655655        popup_changelist_from_file("/tmp/changed.files");
    656         log_msg(2, "Returned from popup_changelist_from_file()");
     656        mr_msg(2, "Returned from popup_changelist_from_file()");
    657657    }
    658658
  • trunk/mondo/src/mondorestore/mondo-rstr-newt.c

    r1084 r1086  
    16581658           sizeof(struct raid_device_record));
    16591659    mr_asprintf(&title_of_editraidForm_window, _("Edit %s"), raidrec->raid_device);
    1660     log_msg(2, "Opening newt window");
     1660    mr_msg(2, "Opening newt window");
    16611661    newtOpenWindow(20, 5, 40, 14, title_of_editraidForm_window);
    16621662    mr_free(title_of_editraidForm_window);
    16631663
    16641664    for (;;) {
    1665         log_msg(2, "Main loop");
     1665        mr_msg(2, "Main loop");
    16661666        mr_asprintf(&sz_raid_level,
    16671667               turn_raid_level_number_to_string(raidrec->raid_level));
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.c

    r1084 r1086  
    194194        || (!does_file_exist(output_mountlist_file)
    195195            && does_file_exist(orig_fname))) {
    196         log_msg(2, "Failed to extract %s and/or %s from ramdisk",
     196        mr_msg(2, "Failed to extract %s and/or %s from ramdisk",
    197197                output_cfg_file, output_mountlist_file);
    198198        retval = 1;
     
    257257            "Checking to see if f=%s, file=%s, is in the list of biggiefiles",
    258258            f, file);
    259     log_msg(2, tmp);
     259    mr_msg(2, tmp);
    260260    mr_free(tmp);
    261261
     
    308308        run_program_and_log_output(command, 5);
    309309        mr_free(command);
    310         log_msg(2, "Setting isodir to %s", bkpinfo->isodir);
     310        mr_msg(2, "Setting isodir to %s", bkpinfo->isodir);
    311311    }
    312312
     
    331331                "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?",
    332332                mount_isodir_command);
    333         log_msg(1, tmp);
     333        mr_msg(1, tmp);
    334334        mr_free(tmp);
    335335
     
    352352    mr_asprintf(&tmp, "%s #%d has been mounted via loopback mount",
    353353            bkpinfo->backup_media_string, i);
    354     log_msg(1, tmp);
     354    mr_msg(1, tmp);
    355355    mr_free(tmp);
    356356
     
    360360        retval = 1;
    361361    }
    362     log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
     362    mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,
    363363            bkpinfo->isodir);
    364364    return (retval);
     
    409409    if (!strcmp(mpt, "/1")) {
    410410        mr_asprintf(&mountpoint, "/");
    411         log_msg(3, "Mommm! SME is being a dildo!");
     411        mr_msg(3, "Mommm! SME is being a dildo!");
    412412    } else {
    413413        mr_asprintf(&mountpoint, mpt);
     
    423423    }
    424424    mr_asprintf(&tmp, "Mounting device %s   ", device);
    425     log_msg(1, tmp);
     425    mr_msg(1, tmp);
    426426
    427427    if (writeable) {
     
    465465        mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device,
    466466                additional_parameters, mountdir, MONDO_LOGFILE);
    467         log_msg(2, "command='%s'", command);
     467        mr_msg(2, "command='%s'", command);
    468468    }
    469469    mr_free(additional_parameters);
     
    471471    res = run_program_and_log_output(command, TRUE);
    472472    if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {
    473         log_msg(1, "Re-trying without the fancy extra parameters");
     473        mr_msg(1, "Re-trying without the fancy extra parameters");
    474474        mr_free(command);
    475475
     
    479479    }
    480480    if (res) {
    481         log_msg(1, "Unable to mount device %s (type %s) at %s", device,
     481        mr_msg(1, "Unable to mount device %s (type %s) at %s", device,
    482482                format, mountdir);
    483         log_msg(1, "command was '%s'", command);
     483        mr_msg(1, "command was '%s'", command);
    484484        if (!strcmp(mountpoint, "swap")) {
    485485            log_to_screen(tmp);
    486486        } else {
    487             log_msg(2, "Retrying w/o the '-t' switch");
     487            mr_msg(2, "Retrying w/o the '-t' switch");
    488488            mr_free(command);
    489489
    490490            mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir,
    491491                    MONDO_LOGFILE);
    492             log_msg(2, "2nd command = '%s'", command);
     492            mr_msg(2, "2nd command = '%s'", command);
    493493            res = run_program_and_log_output(command, TRUE);
    494494            if (res == 0) {
    495                 log_msg(1,
     495                mr_msg(1,
    496496                        "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");
    497497            } else {
     
    505505
    506506    if (res && !strcmp(mountpoint, "swap")) {
    507         log_msg(2, "That's ok. It's just a swap partition.");
    508         log_msg(2, "Non-fatal error. Returning 0.");
     507        mr_msg(2, "That's ok. It's just a swap partition.");
     508        mr_msg(2, "Non-fatal error. Returning 0.");
    509509        res = 0;
    510510    }
     
    550550    for (lino = 0; lino < mountlist->entries; lino++) {
    551551        if (!strcmp(mountlist->el[lino].device, "/proc")) {
    552             log_msg(1,
     552            mr_msg(1,
    553553                    "Again with the /proc - why is this in your mountlist?");
    554554        } else if (is_this_device_mounted(mountlist->el[lino].device)) {
     
    649649    if (bkpinfo->backup_media_type == tape
    650650        || bkpinfo->backup_media_type == udev) {
    651         log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
     651        mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
    652652        return 0;
    653653    }
    654654
    655655    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
    656         log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
     656        mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
    657657        return (0);
    658658    }
    659659
    660660    if (bkpinfo->backup_media_type == nfs) {
    661         log_msg(2, "Mounting for NFS thingy");
    662         log_msg(2, "isodir = %s", bkpinfo->isodir);
     661        mr_msg(2, "Mounting for NFS thingy");
     662        mr_msg(2, "isodir = %s", bkpinfo->isodir);
    663663        if ((!bkpinfo->isodir || !strcmp(bkpinfo->isodir, "/"))
    664664            && am_I_in_disaster_recovery_mode()) {
    665665            mr_allocstr(bkpinfo->isodir, "/tmp/isodir");
    666             log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     666            mr_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    667667        }
    668668#ifdef __FreeBSD__
     
    728728
    729729    }
    730     log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
     730    mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
    731731    for (i = 0; i < 2; i++) {
    732732        res = run_program_and_log_output(mount_cmd, FALSE);
     
    734734            break;
    735735        } else {
    736             log_msg(2, "Failed to mount CD-ROM drive.");
     736            mr_msg(2, "Failed to mount CD-ROM drive.");
    737737            sleep(5);
    738738            run_program_and_log_output("sync", FALSE);
     
    742742
    743743    if (res) {
    744         log_msg(2, "Failed, despite %d attempts", i);
    745     } else {
    746         log_msg(2, "Mounted CD-ROM drive OK");
     744        mr_msg(2, "Failed, despite %d attempts", i);
     745    } else {
     746        mr_msg(2, "Mounted CD-ROM drive OK");
    747747    }
    748748    return (res);
     
    830830                /* Check to see if CD is already mounted before mounting it... */
    831831                if (!is_this_device_mounted("/dev/cdrom")) {
    832                     log_msg(2,
     832                    mr_msg(2,
    833833                            "NB: CDROM device not mounted, mounting...");
    834834                    run_program_and_log_output("mount /dev/cdrom "
     
    897897            mr_asprintf(&tmp, "Backup medium is TAPE --- dev=%s",
    898898                    bkpinfo->media_device);
    899             log_msg(2, tmp);
     899            mr_msg(2, tmp);
    900900            mr_free(tmp);
    901901        } else {
     
    903903            bkpinfo->media_size[0] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    904904            bkpinfo->media_size[1] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    905             log_msg(2, "Backup medium is CD-R[W]");
    906         }
    907     } else {
    908         log_msg(2,
     905            mr_msg(2, "Backup medium is CD-R[W]");
     906        }
     907    } else {
     908        mr_msg(2,
    909909                "Not in Disaster Recovery Mode. No need to derive device name from config file.");
    910910    }
     
    913913    if (strstr(value, "yes")) {
    914914        bkpinfo->use_star = TRUE;
    915         log_msg(1, "Goody! ... bkpinfo->use_star is now true.");
     915        mr_msg(1, "Goody! ... bkpinfo->use_star is now true.");
    916916    }
    917917    mr_free(value);
     
    920920    if (strstr(value, "TRUE")) {
    921921        mr_asprintf(&g_getfacl,"setfacl");
    922         log_msg(1, "We will restore ACLs");
     922        mr_msg(1, "We will restore ACLs");
    923923        if (! find_home_of_exe("setfacl")) {
    924             log_msg(1, "Unable to restore ACLs as no setfacl found");
     924            mr_msg(1, "Unable to restore ACLs as no setfacl found");
    925925        }
    926926    }
     
    928928    if (strstr(value, "TRUE")) {
    929929        mr_asprintf(&g_getfattr,"setfattr");
    930         log_msg(1, "We will restore XATTRs");
     930        mr_msg(1, "We will restore XATTRs");
    931931        if (! find_home_of_exe("setfattr")) {
    932             log_msg(1, "Unable to restore XATTRs as no setfattr found");
     932            mr_msg(1, "Unable to restore XATTRs as no setfattr found");
    933933        }
    934934    }
     
    936936    if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) {
    937937        bkpinfo->internal_tape_block_size = atol(value);
    938         log_msg(1, "Internal tape block size has been custom-set to %ld",
     938        mr_msg(1, "Internal tape block size has been custom-set to %ld",
    939939                bkpinfo->internal_tape_block_size);
    940940    } else {
    941941        bkpinfo->internal_tape_block_size =
    942942            DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
    943         log_msg(1, "Internal tape block size = default (%ld)",
     943        mr_msg(1, "Internal tape block size = default (%ld)",
    944944                DEFAULT_INTERNAL_TAPE_BLOCK_SIZE);
    945945    }
     
    980980        bkpinfo->differential = TRUE;
    981981    }
    982     log_msg(2, "differential var = '%s'", value);
     982    mr_msg(2, "differential var = '%s'", value);
    983983    mr_free(value);
    984984
    985985    if (bkpinfo->differential) {
    986         log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
    987     } else {
    988         log_msg(2, "This is a regular (full) backup");
     986        mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP");
     987    } else {
     988        mr_msg(2, "This is a regular (full) backup");
    989989    }
    990990
     
    997997    if ((tmp != NULL) || strstr(tmp1,"donteject")) {
    998998        bkpinfo->please_dont_eject = TRUE;
    999         log_msg(2, "Ok, I shan't eject when restoring! Groovy.");
     999        mr_msg(2, "Ok, I shan't eject when restoring! Groovy.");
    10001000    }
    10011001    mr_free(tmp);
     
    10041004    if (bkpinfo->backup_media_type == nfs) {
    10051005        if (!cfgf) {
    1006             log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    1007             log_msg(2, "nfs_remote_dir remains %s",
     1006            mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
     1007            mr_msg(2, "nfs_remote_dir remains %s",
    10081008                    bkpinfo->nfs_remote_dir);
    1009             log_msg(2,
     1009            mr_msg(2,
    10101010                    "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    10111011        } else {
     
    10161016            read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
    10171017                         bkpinfo->nfs_remote_dir);
    1018             log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
    1019             log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
     1018            mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
     1019            mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    10201020        }
    10211021        if (strstr(call_program_and_get_last_line_of_output
     
    10601060        mr_free(g_isodir_device);
    10611061        read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
    1062         log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device);
     1062        mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device);
    10631063        if (bkpinfo->disaster_recovery) {
    10641064            if (is_this_device_mounted(g_isodir_device)) {
    1065                 log_msg(2, "NB: isodir is already mounted");
     1065                mr_msg(2, "NB: isodir is already mounted");
    10661066                /* Find out where it's mounted */
    10671067                mr_asprintf(&command,
     
    10811081                mr_asprintf(&tmp, "mount %s %s", g_isodir_device, iso_mnt);
    10821082                if (run_program_and_log_output(tmp, 3)) {
    1083                     log_msg(1,
     1083                    mr_msg(1,
    10841084                            "Unable to mount isodir. Perhaps this is really a CD backup?");
    10851085                    bkpinfo->backup_media_type = cdr;
     
    10951095                            ("Unable to mount isodir. Failed to mount CD-ROM as well.");
    10961096                    } else {
    1097                         log_msg(1,
     1097                        mr_msg(1,
    10981098                                "You backed up to disk, then burned some CDs.");
    10991099                    }
     
    11141114        if (g_restoring_live_from_cd) {
    11151115            if (bkpinfo->backup_media_type != media_specified_by_user) {
    1116                 log_msg(2,
     1116                mr_msg(2,
    11171117                        "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    11181118                interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     
    11631163    if (does_file_exist(g_filelist_full)
    11641164        && does_file_exist(g_biggielist_txt)) {
    1165         log_msg(1, "%s exists", g_filelist_full);
    1166         log_msg(1, "%s exists", g_biggielist_txt);
    1167         log_msg(2,
     1165        mr_msg(1, "%s exists", g_filelist_full);
     1166        mr_msg(1, "%s exists", g_biggielist_txt);
     1167        mr_msg(2,
    11681168                "Filelist and biggielist already recovered from media. Yay!");
    11691169    } else {
    11701170        getcwd(tmp, MAX_STR_LEN);
    11711171        chdir(bkpinfo->tmpdir);
    1172         log_msg(1, "chdir(%s)", bkpinfo->tmpdir);
     1172        mr_msg(1, "chdir(%s)", bkpinfo->tmpdir);
    11731173        log_to_screen("Extracting filelist and biggielist from media...");
    11741174        unlink("/tmp/filelist.full");
     
    11831183                    FILELIST_FULL_STUB,
    11841184                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    1185             log_msg(1, "tarcommand = %s", command);
     1185            mr_msg(1, "tarcommand = %s", command);
    11861186            run_program_and_log_output(command, 1);
    11871187            mr_free(command);
    11881188        } else {
    1189             log_msg(2,
     1189            mr_msg(2,
    11901190                    "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    11911191                    bkpinfo->isodir);
    11921192            insist_on_this_cd_number(bkpinfo, 1);
    1193             log_msg(2, "Back from iotcn");
     1193            mr_msg(2, "Back from iotcn");
    11941194            run_program_and_log_output("mount", 1);
    11951195            mr_asprintf(&command,
     
    12011201                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    12021202
    1203             log_msg(1, "tarcommand = %s", command);
     1203            mr_msg(1, "tarcommand = %s", command);
    12041204            run_program_and_log_output(command, 1);
    12051205            mr_free(command);
     
    12211221        mr_asprintf(&command, "cp -f %s/%s %s", bkpinfo->tmpdir,
    12221222                BIGGIELIST_TXT_STUB, g_biggielist_txt);
    1223         log_msg(1, "command = %s", command);
     1223        mr_msg(1, "command = %s", command);
    12241224        paranoid_system(command);
    12251225        mr_free(command);
     
    12271227        mr_asprintf(&command, "ln -sf %s/%s %s", bkpinfo->tmpdir,
    12281228                FILELIST_FULL_STUB, g_filelist_full);
    1229         log_msg(1, "command = %s", command);
     1229        mr_msg(1, "command = %s", command);
    12301230        paranoid_system(command);
    12311231        mr_free(command);
     
    12471247
    12481248    if (!does_file_exist(g_biggielist_txt)) {
    1249         log_msg(1, "Warning - %s not found", g_biggielist_txt);
     1249        mr_msg(1, "Warning - %s not found", g_biggielist_txt);
    12501250    }
    12511251    if (!does_file_exist(g_filelist_full)) {
    1252         log_msg(1, "Warning - %s does not exist", g_filelist_full);
     1252        mr_msg(1, "Warning - %s does not exist", g_filelist_full);
    12531253    }
    12541254//  popup_and_OK("Wonderful.");
    12551255
    1256     log_msg(2, "Forking");
     1256    mr_msg(2, "Forking");
    12571257    pid = fork();
    12581258    switch (pid) {
     
    12841284    close_evalcall_form();
    12851285
    1286     log_msg(3, "loading filelist");
     1286    mr_msg(3, "loading filelist");
    12871287    filelist = load_filelist(g_filelist_full);
    1288     log_msg(3, "deleting original filelist");
     1288    mr_msg(3, "deleting original filelist");
    12891289    unlink(g_filelist_full);
    12901290    if (g_text_mode) {
     
    13021302    }
    13031303    if (res) {
    1304         log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
     1304        mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");
    13051305        free_filelist(filelist);
    13061306        return (NULL);
     
    13701370    read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);
    13711371    mr_asprintf(&tmp, "run_boot_loader: device='%s', name='%s'", device, name);
    1372     log_msg(2, tmp);
     1372    mr_msg(2, tmp);
    13731373    mr_free(tmp);
    13741374
     
    13861386//      else
    13871387//        {
    1388 //    log_msg(1, "Not running run_grub(). Was a bad idea anyway.");
     1388//    mr_msg(1, "Not running run_grub(). Was a bad idea anyway.");
    13891389//    res = 1;
    13901390//  }
     
    14041404            res = run_program_and_log_output(tmp, 3);
    14051405        } else {
    1406             log_msg(1,
     1406            mr_msg(1,
    14071407                    "I'm not running any boot loader. You have a DD boot drive. It's already loaded up.");
    14081408        }
     
    14641464    tmp = find_home_of_exe(output);
    14651465    if (!tmp) {
    1466         log_msg(2, " (find_my_editor) --- warning - %s not found", output);
     1466        mr_msg(2, " (find_my_editor) --- warning - %s not found", output);
    14671467    }
    14681468    mr_free(tmp);
     
    15361536        /* nuke mode */
    15371537        if (!run_program_and_log_output("which grub-MR", FALSE)) {
    1538             log_msg(1, "Yay! grub-MR found...");
     1538            mr_msg(1, "Yay! grub-MR found...");
    15391539            mr_asprintf(&command, "grub-MR %s /tmp/mountlist.txt", bd);
    1540             log_msg(1, "command = %s", command);
     1540            mr_msg(1, "command = %s", command);
    15411541        } else {
    15421542            mr_asprintf(&command, "chroot " MNT_RESTORING " grub-install %s", bd);
    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        mvaddstr_and_log_it(g_currentY,
     
    15661566            (_
    15671567             ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info."));
    1568         log_msg(1, "Type:-");
    1569         log_msg(1, "    mount-me");
    1570         log_msg(1, "    chroot " MNT_RESTORING);
    1571         log_msg(1, "    mount /boot");
    1572         log_msg(1, "    grub-install '(hd0)'");
    1573         log_msg(1, "    exit");
    1574         log_msg(1, "    unmount-me");
    1575         log_msg(1,
     1568        mr_msg(1, "Type:-");
     1569        mr_msg(1, "    mount-me");
     1570        mr_msg(1, "    chroot " MNT_RESTORING);
     1571        mr_msg(1, "    mount /boot");
     1572        mr_msg(1, "    grub-install '(hd0)'");
     1573        mr_msg(1, "    exit");
     1574        mr_msg(1, "    unmount-me");
     1575        mr_msg(1,
    15761576                "If you're really stuck, please e-mail the mailing list.");
    15771577    } else {
     
    18291829                            ("Restoring MBR...                                               "));
    18301830        mr_asprintf(&command, "raw-MR %s /tmp/mountlist.txt", bd);
    1831         log_msg(2, "run_raw_mbr() --- command='%s'", command);
     1831        mr_msg(2, "run_raw_mbr() --- command='%s'", command);
    18321832        res = run_program_and_log_output(command, 3);
    18331833        mr_free(command);
     
    19991999void termination_in_progress(int sig)
    20002000{
    2001     log_msg(1, "Termination in progress");
     2001    mr_msg(1, "Termination in progress");
    20022002    usleep(1000);
    20032003    pthread_exit(0);
     
    20472047         i++) {
    20482048        sleep(1);
    2049         log_msg(2, "Waiting for buffer() to finish");
     2049        mr_msg(2, "Waiting for buffer() to finish");
    20502050    }
    20512051
     
    20542054    if (run_program_and_log_output
    20552055        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) {
    2056         log_msg(1,
     2056        mr_msg(1,
    20572057                "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)");
    20582058    }
    20592059    if (run_program_and_log_output
    20602060        ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) {
    2061         log_msg(1,
     2061        mr_msg(1,
    20622062                "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)");
    20632063    }
     
    20812081                if (!strcmp(mountlist->el[lino].mountpoint, "/1")) {
    20822082                    mr_asprintf(&command, "umount %s/", MNT_RESTORING);
    2083                     log_msg(3,
     2083                    mr_msg(3,
    20842084                            "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight...");
    20852085                } else {
     
    20882088                }
    20892089            }
    2090             log_msg(10, "The 'umount' command is '%s'", command);
     2090            mr_msg(10, "The 'umount' command is '%s'", command);
    20912091            res = run_program_and_log_output(command, 3);
    20922092            mr_free(command);
     
    21052105            log_to_screen(tmp);
    21062106        } else {
    2107             log_msg(2, tmp);
     2107            mr_msg(2, tmp);
    21082108        }
    21092109        mr_free(tmp);
     
    21492149            MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB,
    21502150            BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");
    2151     log_msg(2, "command = '%s'", command);
     2151    mr_msg(2, "command = '%s'", command);
    21522152    res = run_program_and_log_output(command, -1);
    21532153    mr_free(command);
     
    21852185
    21862186    assert(bkpinfo != NULL);
    2187     log_msg(2, "gcffa --- starting");
     2187    mr_msg(2, "gcffa --- starting");
    21882188    log_to_screen(_("I'm thinking..."));
    21892189    mr_asprintf(&mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir);
     
    22022202    mr_asprintf(&mountlist_file, "%s/%s", bkpinfo->tmpdir,
    22032203            MOUNTLIST_FNAME_STUB);
    2204     log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
     2204    mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
    22052205
    22062206    /* Floppy? */
     
    22172217            "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &",
    22182218            command);
    2219     log_msg(1, "tmp = '%s'", tmp);
     2219    mr_msg(1, "tmp = '%s'", tmp);
    22202220    system(tmp);
    22212221    mr_free(tmp);
     
    22332233    } else {
    22342234        try_plan_B = TRUE;
    2235         log_msg(2,
     2235        mr_msg(2,
    22362236                "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does.");
    22372237// NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK.
    2238         log_msg(2, "Processing floppy (plan A?)");
     2238        mr_msg(2, "Processing floppy (plan A?)");
    22392239        mr_asprintf(&ramdisk_fname, "%s/mindi.rdz", mountpt);
    22402240        if (!does_file_exist(ramdisk_fname)) {
     
    22432243        }
    22442244        if (!does_file_exist(ramdisk_fname)) {
    2245             log_msg(2,
     2245            mr_msg(2,
    22462246                    "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    22472247        }
    22482248        if (extract_config_file_from_ramdisk
    22492249            (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) {
    2250             log_msg(2,
     2250            mr_msg(2,
    22512251                    "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
    22522252        }
     
    22592259    }
    22602260    if (!does_file_exist(cfg_file)) {
    2261         log_msg(2, "gcffa --- we don't have cfg file yet.");
     2261        mr_msg(2, "gcffa --- we don't have cfg file yet.");
    22622262        if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    22632263            try_plan_B = TRUE;
    22642264        } else {
    2265             log_msg(2, "gcffa --- calling mount_cdrom now :)");
     2265            mr_msg(2, "gcffa --- calling mount_cdrom now :)");
    22662266            if (!mount_cdrom(bkpinfo)) {
    2267                 log_msg(2,
     2267                mr_msg(2,
    22682268                        "gcffa --- managed to mount CD; so, no need for Plan B");
    22692269                try_plan_B = FALSE;
     
    22772277        }
    22782278        if (try_plan_B) {
    2279             log_msg(2, "gcffa --- OK, switching to Plan B");
     2279            mr_msg(2, "gcffa --- OK, switching to Plan B");
    22802280            chdir(bkpinfo->tmpdir);
    22812281            run_program_and_log_output("mkdir -p tmp", FALSE);
     
    22832283            if (bkpinfo->media_device == NULL) {
    22842284                mr_asprintf(&bkpinfo->media_device, "/dev/st0");
    2285                 log_msg(2, "media_device is blank; assuming %s",
     2285                mr_msg(2, "media_device is blank; assuming %s",
    22862286                        bkpinfo->media_device);
    22872287            }
     
    22982298                        if (extract_cfg_file_and_mountlist_from_tape_dev
    22992299                            (bkpinfo->media_device)) {
    2300                             log_msg(3,
     2300                            mr_msg(3,
    23012301                                    "I tried lots of devices but none worked.");
    23022302                            mr_allocstr(bkpinfo->media_device, sav);
     
    23132313            }
    23142314        } else {
    2315             log_msg(2,
     2315            mr_msg(2,
    23162316                    "gcffa --- looking at mounted CD for mindi-boot.2880.img");
    23172317            /* BERLIOS : Useless ?
     
    23222322            mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file);
    23232323            if (!does_file_exist(mounted_cfgf_path)) {
    2324                 log_msg(2,
     2324                mr_msg(2,
    23252325                        "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz");
    23262326                mr_asprintf(&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
     
    23392339
    23402340    if (does_file_exist(MONDO_CFG_FILE_STUB)) {
    2341         log_msg(1, "gcffa --- great! We've got the config file");
     2341        mr_msg(1, "gcffa --- great! We've got the config file");
    23422342        tmp1 = call_program_and_get_last_line_of_output("pwd");
    23432343        mr_asprintf(&tmp, "%s/%s", tmp1,MONDO_CFG_FILE_STUB);
     
    23472347        if (strcmp(tmp, cfg_file)
    23482348            && run_program_and_log_output(command, 1)) {
    2349             log_msg(1,
     2349            mr_msg(1,
    23502350                    "... but an error occurred when I tried to move it to %s",
    23512351                    cfg_file);
    23522352        } else {
    2353             log_msg(1, "... and I moved it successfully to %s", cfg_file);
     2353            mr_msg(1, "... and I moved it successfully to %s", cfg_file);
    23542354        }
    23552355        mr_free(command);
     
    23622362        if (strcmp(tmp, cfg_file)
    23632363            && run_program_and_log_output(command, 1)) {
    2364             log_msg(1, "Failed to get mountlist");
     2364            mr_msg(1, "Failed to get mountlist");
    23652365        } else {
    2366             log_msg(1, "Got mountlist too");
     2366            mr_msg(1, "Got mountlist too");
    23672367            mr_free(command);
    23682368            mr_asprintf(&command, "cp -f %s %s", mountlist_file,
    23692369                    g_mountlist_fname);
    23702370            if (run_program_and_log_output(command, 1)) {
    2371                 log_msg(1, "Failed to copy mountlist to /tmp");
     2371                mr_msg(1, "Failed to copy mountlist to /tmp");
    23722372            } else {
    2373                 log_msg(1, "Copied mountlist to /tmp as well OK");
     2373                mr_msg(1, "Copied mountlist to /tmp as well OK");
    23742374                mr_free(command);
    23752375                mr_asprintf(&command, "cp -f tmp/i-want-my-lvm /tmp/");
     
    23832383    if (!does_file_exist(cfg_file)) {
    23842384        iamhere(cfg_file);
    2385         log_msg(1, "%s not found", cfg_file);
     2385        mr_msg(1, "%s not found", cfg_file);
    23862386        log_to_screen
    23872387            (_
     
    24482448        if (parse_mdstat(raidlist, "/dev/")) {
    24492449            log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
    2450             log_msg(1, "Sorry, cannot read %s", MDSTAT_FILE);
     2450            mr_msg(1, "Sorry, cannot read %s", MDSTAT_FILE);
    24512451            return;
    24522452        }
     
    24552455            if (raidlist->el[i].progress < wait_for_percentage) {
    24562456                unfinished_mdstat_devices++;
    2457                 log_msg(1, "Sync'ing %s (i=%d)",
     2457                mr_msg(1, "Sync'ing %s (i=%d)",
    24582458                        raidlist->el[i].raid_device, i);
    24592459                mr_asprintf(&screen_message, "Sync'ing %s",
     
    24662466                }
    24672467                while (raidlist->el[i].progress < wait_for_percentage) {
    2468                     log_msg(1, "Percentage sync'ed: %d",
     2468                    mr_msg(1, "Percentage sync'ed: %d",
    24692469                            raidlist->el[i].progress);
    24702470                    update_evalcall_form(raidlist->el[i].progress);
Note: See TracChangeset for help on using the changeset viewer.