Changeset 1107


Ignore:
Timestamp:
Feb 8, 2007, 12:09:34 AM (13 years ago)
Author:
bruno
Message:

log_msg => mr_msg for common files

Location:
branches/stable/mondo/src/common
Files:
12 edited

Legend:

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

    r1093 r1107  
    1010 * This is the main file (at least the longest one) in libmondo.
    1111 */
     12#include <sys/sem.h>
     13#include <sys/types.h>
     14#include <sys/ipc.h>
     15#include <stdarg.h>
     16#include <unistd.h>
    1217
    1318#include "my-stuff.h"
    1419#include "../common/mondostructures.h"
     20#include "mr_conf.h"
     21#include "mr_mem.h"
     22#include "mr_err.h"
     23#include "mr_str.h"
     24#include "mr_file.h"
     25
    1526#include "libmondo-string-EXT.h"
    1627#include "libmondo-stream-EXT.h"
     
    2637#include "lib-common-externs.h"
    2738
    28 #include "mr_mem.h"
    29 #include "mr_str.h"
    30 #include "mr_file.h"
    31 
    32 #include <sys/sem.h>
    33 #include <sys/types.h>
    34 #include <sys/ipc.h>
    35 #include <stdarg.h>
    3639#define DVDRWFORMAT 1
    3740
     
    9194 */
    9295t_bkptype g_backup_media_type = none;
     96char *g_backup_media_string = NULL;
    9397
    9498/**
     
    142146
    143147    if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) {
    144         log_msg(3, "Failed to delete semaphore");
     148        mr_msg(3, "Failed to delete semaphore");
    145149    }
    146150}
     
    159163    sem_b.sem_flg = SEM_UNDO;
    160164    if (semop(g_sem_id, &sem_b, 1) == -1) {
    161         log_msg(3, "semaphore_p failed");
     165        mr_msg(3, "semaphore_p failed");
    162166        return (0);
    163167    }
     
    177181    sem_b.sem_flg = SEM_UNDO;
    178182    if (semop(g_sem_id, &sem_b, 1) == -1) {
    179         log_msg(3, "semaphore_v failed");
     183        mr_msg(3, "semaphore_v failed");
    180184        return (0);
    181185    }
     
    235239    }
    236240    sprintf(command + strlen(command), " 2>> %s", MONDO_LOGFILE);
    237     log_msg(4, "command = '%s'", command);
     241    mr_msg(4, "command = '%s'", command);
    238242
    239243    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    240         log_msg(5, "command='%s'", command);
     244        mr_msg(5, "command='%s'", command);
    241245        res = system(command);
    242246        strcpy(tmp, last_line_of_file(MONDO_LOGFILE));
    243         log_msg(1, "res=%d; tmp='%s'", res, tmp);
     247        mr_msg(1, "res=%d; tmp='%s'", res, tmp);
    244248        if (bkpinfo->use_star && (res == 254 || res == 65024)
    245249            && strstr(tmp, "star: Processed all possible files")
    246250            && tries > 0) {
    247             log_msg(1, "Star returned nonfatal error");
     251            mr_msg(1, "Star returned nonfatal error");
    248252            res = 0;
    249253        }
     
    253257            if (p) {
    254258                p[0] = p[1] = p[2] = p[3] = ' ';
    255                 log_msg(1, "new command = '%s'", command);
     259                mr_msg(1, "new command = '%s'", command);
    256260            } else {
    257                 log_msg(3,
     261                mr_msg(3,
    258262                        "Attempt #%d failed. Pausing 3 seconds and retrying...",
    259263                        tries + 1);
     
    264268    retval += res;
    265269    if (retval) {
    266         log_msg(3, "Failed to write set %d", setno);
     270        mr_msg(3, "Failed to write set %d", setno);
    267271    } else if (tries > 1) {
    268         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     272        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    269273                tries);
    270274    }
     
    344348            strcat(zipparams, tmp);
    345349        } else {
    346             log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
     350            mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);
    347351        }
    348352    } else {
     
    373377
    374378    for (res = 99, tries = 0; tries < 3 && res != 0; tries++) {
    375         log_msg(5, "command='%s'", command);
     379        mr_msg(5, "command='%s'", command);
    376380        res = system(command);
    377381        if (res) {
    378382            log_OS_error(command);
    379             log_msg(3,
     383            mr_msg(3,
    380384                    "Attempt #%d failed. Pausing 3 seconds and retrying...",
    381385                    tries + 1);
     
    385389    retval += res;
    386390    if (retval) {
    387         log_msg(3, "Failed to write set %d", setno);
     391        mr_msg(3, "Failed to write set %d", setno);
    388392    } else if (tries > 1) {
    389         log_msg(3, "Succeeded in writing set %d, on try #%d", setno,
     393        mr_msg(3, "Succeeded in writing set %d, on try #%d", setno,
    390394                tries);
    391395    }
     
    397401            if (free_ramdisk_space > i) {
    398402                free_ramdisk_space = i;
    399                 log_msg(2, "min(free_ramdisk_space) is now %d",
     403                mr_msg(2, "min(free_ramdisk_space) is now %d",
    400404                        free_ramdisk_space);
    401405                if (free_ramdisk_space < 10) {
     
    495499    retval += make_those_slices_phase(bkpinfo); // backup BIG files
    496500    retval += do_that_final_phase(bkpinfo); // clean up
    497     log_msg(1, "Creation of archives... complete.");
     501    mr_msg(1, "Creation of archives... complete.");
    498502    if (bkpinfo->verify_data) {
    499503        sleep(2);
     
    574578            bkpinfo->exclude_paths);
    575579    strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp));
    576     log_msg(2, tmp);
     580    mr_msg(2, tmp);
    577581    mvaddstr_and_log_it(g_currentY, 0,
    578582                        "Calling MINDI to create boot+data disks");
     
    622626            sprintf(tmp, "User specified boot loader. It is '%c'.",
    623627                    bkpinfo->boot_loader);
    624             log_msg(2, tmp);
     628            mr_msg(2, tmp);
    625629        } else {
    626630            bkpinfo->boot_loader = ch;
     
    629633            sprintf(tmp, "User specified boot device. It is '%s'.",
    630634                    bkpinfo->boot_device);
    631             log_msg(2, tmp);
     635            mr_msg(2, tmp);
    632636        } else {
    633637            strcpy(bkpinfo->boot_device, bootdev);
     
    857861            //use_gzip_sz);         // parameter #20 (STRING)
    858862
    859     log_msg(2, command);
     863    mr_msg(2, command);
    860864
    861865    res = run_program_and_log_to_screen(command, "Generating boot+data disks");
     
    866870        log_to_screen("Boot+data disks were created OK");
    867871        sprintf(command, "mkdir -p /var/cache/mindi/");
    868         log_msg(2, command);
     872        mr_msg(2, command);
    869873        run_program_and_log_output(command, FALSE);
    870874        sprintf(command,
    871875                "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
    872876                bkpinfo->scratchdir);
    873         log_msg(2, command);
     877        mr_msg(2, command);
    874878        run_program_and_log_output(command, FALSE);
    875879        if (bkpinfo->nonbootable_backup) {
     
    991995        }
    992996        if (!semaphore_p()) {
    993             log_msg(3, "P sem failed (pid=%d)", (int) getpid());
     997            mr_msg(3, "P sem failed (pid=%d)", (int) getpid());
    994998            fatal_error("Cannot get semaphore P");
    995999        }
     
    10081012                bkpinfo->tmpdir, archiving_set_no);
    10091013        if (!does_file_exist(archiving_filelist_fname)) {
    1010             log_msg(3,
     1014            mr_msg(3,
    10111015                    "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.",
    10121016                    FORTY_SPACES, getpid(), this_thread_no,
     
    10181022                archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix);
    10191023        if (does_file_exist(tmp)) {
    1020             log_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES,
     1024            mr_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES,
    10211025                    getpid(), this_thread_no);
    10221026            while (does_file_exist(tmp)) {
    10231027                sleep(1);
    10241028            }
    1025             log_msg(4, "[%d] - continuing", getpid());
    1026         }
    1027 
    1028         log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
     1029            mr_msg(4, "[%d] - continuing", getpid());
     1030        }
     1031
     1032        mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
    10291033                this_thread_no, archiving_set_no);
    10301034        if (g_getfattr) {
     
    10391043        }
    10401044
    1041         log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
     1045        mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
    10421046                this_thread_no, archiving_set_no);
    10431047        res =
     
    10661070            fatal_error("Cannot get semaphore V");
    10671071        }
    1068         log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
     1072        mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),
    10691073                this_thread_no, archiving_set_no);
    10701074        archiving_set_no++;
     
    10771081        fatal_error("Cannot get semaphore V");
    10781082    }
    1079     log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
     1083    mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),
    10801084            this_thread_no);
    10811085    mr_free(archiving_filelist_fname);
     
    11131117                        "Writing any remaining data to media         ");
    11141118
    1115     log_msg(1, "Closing tape/CD ... ");
     1119    mr_msg(1, "Closing tape/CD ... ");
    11161120    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type))
    11171121        /* write tape/cdstream */
     
    11241128        retval += res;
    11251129        if (res) {
    1126             log_msg(1, "write_final_iso_if_necessary returned an error");
    1127         }
    1128     }
    1129     log_msg(2, "Fork is exiting ... ");
     1130            mr_msg(1, "write_final_iso_if_necessary returned an error");
     1131        }
     1132    }
     1133    mr_msg(2, "Fork is exiting ... ");
    11301134
    11311135    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    11811185    strip_spaces(g_serial_string);
    11821186    strcat(g_serial_string, "...word.");
    1183     log_msg(2, "g_serial_string = '%s'", g_serial_string);
     1187    mr_msg(2, "g_serial_string = '%s'", g_serial_string);
    11841188    assert(strlen(g_serial_string) < MAX_STR_LEN);
    11851189
    11861190    sprintf(tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir);
    11871191    if (write_one_liner_data_file(tmpfile, g_serial_string)) {
    1188         log_msg(1, "%ld: Failed to write serial string", __LINE__);
     1192        mr_msg(1, "%ld: Failed to write serial string", __LINE__);
    11891193    }
    11901194
     
    11991203            fatal_error("Cannot open backup (streaming) device");
    12001204        }
    1201         log_msg(1, "Backup (stream) opened OK");
     1205        mr_msg(1, "Backup (stream) opened OK");
    12021206        write_data_disks_to_stream(data_disks_file);
    12031207    } else {
    1204         log_msg(1, "Backing up to CD's");
     1208        mr_msg(1, "Backing up to CD's");
    12051209    }
    12061210
     
    12751279    sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    12761280            tempfile);
    1277     log_msg(3, command);
     1281    mr_msg(3, command);
    12781282    open_evalcall_form(title);
    12791283    if (!(pin = popen(command, "r"))) {
     
    12891293        trackno = get_trackno_from_logfile(tempfile);
    12901294        if (trackno < 0 || trackno > 80) {
    1291             log_msg(1, "Weird track#");
     1295            mr_msg(1, "Weird track#");
    12921296            continue;
    12931297        }
     
    14401444    int misc_counter_that_is_not_important = 0;
    14411445
    1442     log_msg(8, "here");
     1446    mr_msg(8, "here");
    14431447    assert(bkpinfo != NULL);
    14441448    tmp = mr_malloc(MAX_STR_LEN * 2);
     
    14661470    sprintf(tmp, "%s/archives/filelist.full", bkpinfo->scratchdir);
    14671471    log_to_screen("Archiving regular files");
    1468     log_msg(5, "Go, Shorty. It's your birthday.");
     1472    mr_msg(5, "Go, Shorty. It's your birthday.");
    14691473    open_progress_form("Backing up filesystem",
    14701474                       "I am backing up your live filesystem now.",
     
    14731477                       get_last_filelist_number(bkpinfo) + 1);
    14741478
    1475     log_msg(5, "We're gonna party like it's your birthday.");
     1479    mr_msg(5, "We're gonna party like it's your birthday.");
    14761480
    14771481    srand((unsigned int) getpid());
     
    14861490    }                           // initialize semaphore
    14871491    for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) {
    1488         log_msg(8, "Creating thread #%d", noof_threads);
     1492        mr_msg(8, "Creating thread #%d", noof_threads);
    14891493        (*p_archival_threads_running)++;
    14901494        if ((res =
     
    14961500    }
    14971501
    1498     log_msg(8, "About to enter while() loop");
     1502    mr_msg(8, "About to enter while() loop");
    14991503    while (!done_storing) {
    15001504        if (g_exiting) {
     
    15031507        if (*p_archival_threads_running == 0
    15041508            && *p_last_set_archived == storing_set_no - 1) {
    1505             log_msg(2,
     1509            mr_msg(2,
    15061510                    "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... :-)",
    15071511                    *p_last_set_archived, storing_set_no);
     
    15321536            }
    15331537
    1534             log_msg(2, "Storing set %d", storing_set_no);
     1538            mr_msg(2, "Storing set %d", storing_set_no);
    15351539            while (!does_file_exist(storing_filelist_fname)
    15361540                   || !does_file_exist(storing_afioball_fname)) {
    1537                 log_msg(2,
     1541                mr_msg(2,
    15381542                        "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.",
    15391543                        storing_filelist_fname, storing_afioball_fname);
     
    15981602
    15991603    sprintf(tmp, "Your regular files have been archived ");
    1600     log_msg(2, "Joining background threads to foreground thread");
     1604    mr_msg(2, "Joining background threads to foreground thread");
    16011605    for (i = 0; i < noof_threads; i++) {
    16021606        pthread_join(archival_thread[i], pvp);
    1603         log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
     1607        mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);
    16041608    }
    16051609    del_semvalue();
    1606     log_msg(2, "Done.");
     1610    mr_msg(2, "Done.");
    16071611    if (retval) {
    16081612        strcat(tmp, "(with errors).");
     
    16941698       if (!does_file_exist(tmp))
    16951699       {
    1696        log_msg (2, "Silly bug in Mindi.pl; workaround in progress...");
     1700       mr_msg (2, "Silly bug in Mindi.pl; workaround in progress...");
    16971701       strcpy(fnam, call_program_and_get_last_line_of_output("locate isolinux.bin | tail -n1"));
    16981702       if (strlen(fnam)>0 && does_file_exist(fnam))
     
    17071711       if (res)
    17081712       {
    1709        log_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing");
     1713       mr_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing");
    17101714       }
    17111715       }
     
    17171721    }
    17181722
    1719     log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
     1723    mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",
    17201724            bkpinfo->scratchdir, destfile);
    17211725    (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     
    17411745
    17421746    if (bkpinfo->call_make_iso[0] != '\0') {
    1743         log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
     1747        mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);
    17441748        sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir);
    17451749        sprintf(message_to_screen, "Making an ISO (%s #%d)",
     
    17901794                sprintf(sz_blank_disk, "dvd+rw-format -force %s",
    17911795                        bkpinfo->media_device);
    1792                 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
     1796                mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
    17931797                res =
    17941798                    run_external_binary_with_percentage_indicator_NEW
     
    18431847                media_descriptor_string(bkpinfo->backup_media_type),
    18441848                g_current_media_number);
    1845         log_msg(1, message_to_screen);
     1849        mr_msg(1, message_to_screen);
    18461850        sprintf(result_sz, "Call to mkisofs to make ISO (%s #%d) ",
    18471851                media_descriptor_string(bkpinfo->backup_media_type),
    18481852                g_current_media_number);
    18491853        if (bkpinfo->nonbootable_backup) {
    1850             log_msg(1, "Making nonbootable backup");
     1854            mr_msg(1, "Making nonbootable backup");
    18511855            res =
    18521856                eval_call_to_make_ISO(bkpinfo,
     
    18551859                                      MONDO_LOGFILE, message_to_screen);
    18561860        } else {
    1857             log_msg(1, "Making bootable backup");
     1861            mr_msg(1, "Making bootable backup");
    18581862
    18591863#ifdef __FreeBSD__
     
    18621866
    18631867
    1864             log_msg(1, "make_cd_use_lilo is actually %d",
     1868            mr_msg(1, "make_cd_use_lilo is actually %d",
    18651869                    bkpinfo->make_cd_use_lilo);
    18661870            if (bkpinfo->make_cd_use_lilo) {
    1867                 log_msg(1, "make_cd_use_lilo = TRUE");
     1871                mr_msg(1, "make_cd_use_lilo = TRUE");
    18681872// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    18691873// and add ' .' at end
    18701874#ifdef __IA64__
    1871                 log_msg(1, "IA64 --> elilo");
     1875                mr_msg(1, "IA64 --> elilo");
    18721876                res = eval_call_to_make_ISO(bkpinfo,
    18731877                                            //-b images/mindi-boot.2880.img
     
    18821886// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    18831887// and add ' .' at end
    1884                 log_msg(1, "Non-ia64 --> lilo");
     1888                mr_msg(1, "Non-ia64 --> lilo");
    18851889                res =
    18861890                    eval_call_to_make_ISO(bkpinfo,
     
    18911895#endif
    18921896            } else {
    1893                 log_msg(1, "make_cd_use_lilo = FALSE");
    1894                 log_msg(1, "Isolinux");
     1897                mr_msg(1, "make_cd_use_lilo = FALSE");
     1898                mr_msg(1, "Isolinux");
    18951899                res =
    18961900                    eval_call_to_make_ISO(bkpinfo,
     
    19131917        || bkpinfo->backup_media_type == cdrw) {
    19141918        if (is_this_device_mounted(bkpinfo->media_device)) {
    1915             log_msg(2,
     1919            mr_msg(2,
    19161920                    "Warning - %s mounted. I'm unmounting it before I burn to it.",
    19171921                    bkpinfo->media_device);
     
    19221926
    19231927    if (bkpinfo->call_burn_iso[0] != '\0') {
    1924         log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
     1928        mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);
    19251929        sprintf(message_to_screen, "Burning %s #%d",
    19261930                media_descriptor_string(bkpinfo->backup_media_type),
     
    19591963    chdir(old_pwd);
    19601964    if (retval) {
    1961         log_msg(1, "WARNING - make_iso_fs returned an error");
     1965        mr_msg(1, "WARNING - make_iso_fs returned an error");
    19621966    }
    19631967    mr_free(old_pwd);
     
    19871991            "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1",
    19881992            bigfile_fname);
    1989     log_msg(1, "command = '%s'", command);
     1993    mr_msg(1, "command = '%s'", command);
    19901994    strcpy(tmp, call_program_and_get_last_line_of_output(command));
    1991     log_msg(1, "--> tmp = '%s'", tmp);
     1995    mr_msg(1, "--> tmp = '%s'", tmp);
    19921996    if (strstr(tmp, "NTFS")) {
    19931997        iamhere("TRUE");
     
    20502054        size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
    20512055
    2052     log_msg(1, "size of all biggiefiles = %ld",
     2056    mr_msg(1, "size of all biggiefiles = %ld",
    20532057            size_of_all_biggiefiles_K(bkpinfo));
    2054     log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
     2058    mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
    20552059            size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size,
    20562060            estimated_total_noof_slices);
    20572061
    20582062    if (length_of_file(biggielist_fname) < 6) {
    2059         log_msg(1, "No biggiefiles; fair enough...");
     2063        mr_msg(1, "No biggiefiles; fair enough...");
    20602064        return (0);
    20612065    }
     
    20882092            // Call ntfsclone (formerly partimagehack) if it's a /dev entry
    20892093            // (i.e. a partition to be imaged)
    2090             log_msg(2, "bigfile_fname = %s", bigfile_fname);
     2094            mr_msg(2, "bigfile_fname = %s", bigfile_fname);
    20912095            use_ntfsprog = FALSE;
    20922096            if (!strncmp(bigfile_fname, "/dev/", 5)
    20932097                && is_dev_an_NTFS_dev(bigfile_fname)) {
    20942098                use_ntfsprog = TRUE;
    2095                 log_msg(2,
     2099                mr_msg(2,
    20962100                        "Calling ntfsclone in background because %s is an NTFS partition",
    20972101                        bigfile_fname);
     
    21062110                    fatal_error("Fork failure");
    21072111                case 0:
    2108                     log_msg(2,
     2112                    mr_msg(2,
    21092113                            "CHILD - fip - calling feed_into_ntfsprog(%s, %s)",
    21102114                            bigfile_fname, sz_devfile);
     
    21132117                    break;
    21142118                default:
    2115                     log_msg(2,
     2119                    mr_msg(2,
    21162120                            "feed_into_ntfsprog() called in background --- pid=%ld",
    21172121                            (long int) (pid));
     
    21692173#endif
    21702174    }
    2171     log_msg(1, "Finished backing up bigfiles");
    2172     log_msg(1, "estimated slices = %ld; actual slices = %ld",
     2175    mr_msg(1, "Finished backing up bigfiles");
     2176    mr_msg(1, "estimated slices = %ld; actual slices = %ld",
    21732177            estimated_total_noof_slices, g_current_progress);
    21742178    close_progress_form();
     
    22332237                bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix);
    22342238
    2235         log_msg(1, "EXAT'g set %ld", curr_set_no);
     2239        mr_msg(1, "EXAT'g set %ld", curr_set_no);
    22362240        if (g_getfattr) {
    22372241            sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     
    22452249        }
    22462250
    2247         log_msg(1, "Archiving set %ld", curr_set_no);
     2251        mr_msg(1, "Archiving set %ld", curr_set_no);
    22482252        res =
    22492253            archive_this_fileset(bkpinfo, curr_filelist_fname,
     
    23492353                                     BLK_START_AFIOBALLS);
    23502354#if __FreeBSD__ == 5
    2351         log_msg(1,
     2355        mr_msg(1,
    23522356                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    23532357        res = make_afioballs_and_images_OLD(bkpinfo);
     
    23642368    if (res) {
    23652369        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    2366         log_msg(1, "make_afioballs_and_images returned an error");
     2370        mr_msg(1, "make_afioballs_and_images returned an error");
    23672371    } else {
    23682372        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    24152419    paranoid_system(command);
    24162420    sprintf(blah, "biggielist = %s", biggielist);
    2417     log_msg(2, blah);
     2421    mr_msg(2, blah);
    24182422
    24192423    if (!does_file_exist(biggielist)) {
    2420         log_msg(1, "BTW, the biggielist does not exist");
     2424        mr_msg(1, "BTW, the biggielist does not exist");
    24212425    }
    24222426
     
    24452449    retval += res;
    24462450    if (res) {
    2447         log_msg(1, "make_slices_and_images returned an error");
     2451        mr_msg(1, "make_slices_and_images returned an error");
    24482452        mvaddstr_and_log_it(g_currentY++, 74, "Errors.");
    24492453    } else {
     
    25152519        strcpy(curr_file, cf);
    25162520        if (!does_file_exist(curr_file)) {
    2517             log_msg(1,
     2521            mr_msg(1,
    25182522                    "Warning - you're trying to add a non-existent file - '%s' to the CD",
    25192523                    curr_file);
    25202524        } else {
    2521             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);
    25222526            would_occupy += length_of_file(curr_file) / 1024;
    25232527        }
     
    25322536        retval += res;
    25332537        if (res) {
    2534             log_msg(1, "WARNING - write_iso_and_go_on returned an error");
     2538            mr_msg(1, "WARNING - write_iso_and_go_on returned an error");
    25352539        }
    25362540    }
     
    25482552        retval += res;
    25492553        if (res) {
    2550             log_msg(1, "(move_files_to_cd) '%s' failed", tmp);
     2554            mr_msg(1, "(move_files_to_cd) '%s' failed", tmp);
    25512555        } else {
    2552             log_msg(8, "Moved %s to CD OK", tmp);
     2556            mr_msg(8, "Moved %s to CD OK", tmp);
    25532557        }
    25542558        //      unlink (curr_file);
     
    25572561
    25582562    if (retval) {
    2559         log_msg(1,
     2563        mr_msg(1,
    25602564                "Warning - errors occurred while I was adding files to CD dir");
    25612565    }
     
    26272631        sprintf(bootdisk_dev, "/dev/fd0H1722");
    26282632    } else {
    2629         log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
     2633        mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
    26302634        strcpy(bootdisk_dev, DEFAULT_1722MB_DISK);
    26312635//      return (1);
     
    26332637    strcpy(datadisk_dev, "/dev/fd0");
    26342638    if (!does_device_exist(datadisk_dev)) {
    2635         log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
     2639        mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
    26362640        strcpy(datadisk_dev, "/dev/fd0");
    26372641//      return (1);
     
    26912695                }
    26922696                sprintf(tmp, "cat %s > %s", rootdisk_file, datadisk_dev);
    2693                 log_msg(1, "tmp = '%s'", tmp);
     2697                mr_msg(1, "tmp = '%s'", tmp);
    26942698                res +=
    26952699                    run_external_binary_with_percentage_indicator_NEW
     
    27072711    for (i = 1; i < 99; i++) {
    27082712        sprintf(tmp, "%s/mindi-data-%d.img", imagesdir, i);
    2709         log_msg(3, tmp);
     2713        mr_msg(3, tmp);
    27102714        if (!does_file_exist(tmp)) {
    2711             log_msg(3, "...not found");
     2715            mr_msg(3, "...not found");
    27122716            break;
    27132717        }
     
    28372841        strcpy(curr_file, cf);
    28382842        if (!does_file_exist(curr_file)) {
    2839             log_msg(1,
     2843            mr_msg(1,
    28402844                    "Warning - you're trying to add a non-existent file - '%s' to the tape",
    28412845                    curr_file);
     
    28642868
    28652869    if (retval) {
    2866         log_msg(1,
     2870        mr_msg(1,
    28672871                "Warning - errors occurred while I was adding file to tape");
    28682872    }
     
    29072911        } else {
    29082912            cdrecord[0] = '\0';
    2909             log_msg(2, "Oh well. I guess I'll just pray then.");
     2913            mr_msg(2, "Oh well. I guess I'll just pray then.");
    29102914        }
    29112915        if (cdrecord[0]) {
     
    29192923                        ("Unable to examine CD. Are you sure this is a valid CD-R(W) CD?"))
    29202924                    {
    2921                         log_msg(1, "Well, he insisted...");
     2925                        mr_msg(1, "Well, he insisted...");
    29222926                        break;
    29232927                    }
     
    29902994    if (!find_cdrom_device(cdrom_dev, FALSE)) {
    29912995/* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird
    2992       log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
     2996      mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
    29932997      retract_CD_tray_and_defeat_autorun();
    29942998*/
     
    30033007        if ((attempt_to_mount_returned_this =
    30043008             run_program_and_log_output(tmp, 1))) {
    3005             log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
     3009            mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);
    30063010            log_to_screen("If there's a CD/DVD in the drive, it's blank.");
    30073011            /*
     
    30313035        }
    30323036        run_program_and_log_output(szunmount, 1);
    3033         log_msg(2, "paafcd: cd_number = %d", cd_number);
    3034         log_msg(2, "our serial str = %s; g_serial_string = %s",
     3037        mr_msg(2, "paafcd: cd_number = %d", cd_number);
     3038        mr_msg(2, "our serial str = %s; g_serial_string = %s",
    30353039                our_serial_str, g_serial_string);
    30363040        if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) {
    3037             log_msg(2, "This %s is part of this backup set!",
     3041            mr_msg(2, "This %s is part of this backup set!",
    30383042                    media_descriptor_string(g_backup_media_type));
    30393043            ok_go_ahead_burn_it = FALSE;
     
    30513055        }
    30523056    } else {
    3053         log_msg(2,
     3057        mr_msg(2,
    30543058                "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?",
    30553059                media_descriptor_string(g_backup_media_type));
     
    30793083        goto gotos_make_me_puke;
    30803084    } else {
    3081         log_msg(2, "paafcd: OK, going ahead and burning it.");
    3082     }
    3083 
    3084     log_msg(2,
     3085        mr_msg(2, "paafcd: OK, going ahead and burning it.");
     3086    }
     3087
     3088    mr_msg(2,
    30853089            "paafcd: OK, I assume I have a blank/reusable %s in the drive...",
    30863090            media_descriptor_string(g_backup_media_type));
     
    32413245        file_to_openin = ntfsprog_fifo;
    32423246        strcpy(checksum_line, "IGNORE");
    3243         log_msg(2,
     3247        mr_msg(2,
    32443248                "Not calculating checksum for %s: it would take too long",
    32453249                biggie_filename);
     
    32833287    paranoid_fclose(fout);
    32843288    length = totallength / optimal_set_size / 1024;
    3285     log_msg(1, "Opening in %s; slicing it and writing to CD/tape",
     3289    mr_msg(1, "Opening in %s; slicing it and writing to CD/tape",
    32863290            file_to_openin);
    32873291    if (!(fin = fopen(file_to_openin, "r"))) {
     
    33403344        {
    33413345            if (!does_file_exist(curr_slice_fname_uncompressed)) {
    3342                 log_msg(2,
     3346                mr_msg(2,
    33433347                        "Warning - '%s' doesn't exist. How can I compress slice?",
    33443348                        curr_slice_fname_uncompressed);
     
    33483352                        bkpinfo->compression_level,
    33493353                        curr_slice_fname_uncompressed);
    3350                 log_msg(2, command);
     3354                mr_msg(2, command);
    33513355                if ((res = system(command))) {
    33523356                    log_OS_error(command);
     
    33623366            retval += res;
    33633367            if (res) {
    3364                 log_msg(2, "Failed to compress the slice");
     3368                mr_msg(2, "Failed to compress the slice");
    33653369            }
    33663370            if (bkpinfo->use_lzo
     
    33823386                newtRefresh();
    33833387            } else {
    3384                 log_msg(2, tmp);
     3388                mr_msg(2, tmp);
    33853389            }
    33863390#else
    3387             log_msg(2, tmp);
     3391            mr_msg(2, tmp);
    33883392#endif
    33893393            strcpy(file_to_archive, curr_slice_fname_compressed);
     
    34243428        strcat(tmp, "...OK!");
    34253429    }
    3426     log_msg(1, tmp);
     3430    mr_msg(1, tmp);
    34273431    mr_free(tempblock);
    34283432    mr_free(tmp);
     
    34743478    sprintf(tmp, "rm -f %s/zero", dir);
    34753479    run_program_and_log_output(tmp, FALSE);
    3476     log_msg(1, "Wiped %s's archives", dir);
     3480    mr_msg(1, "Wiped %s's archives", dir);
    34773481    sprintf(tmp, "ls -l %s", dir);
    34783482    run_program_and_log_output(tmp, FALSE);
     
    35113515
    35123516    sprintf(tmp, "Writing the final ISO");
    3513     log_msg(2, tmp);
     3517    mr_msg(2, tmp);
    35143518    center_string(tmp, 80);
    35153519#ifndef _XWIN
     
    35243528    }
    35253529#endif
    3526     log_msg(2, "Returning from writing final ISO (res=%d)", res);
     3530    mr_msg(2, "Returning from writing final ISO (res=%d)", res);
    35273531    mr_free(tmp);
    35283532    return (res);
     
    35823586        using_nfs = FALSE;
    35833587    }
    3584     log_msg(1, "OK, time to make %s #%d",
     3588    mr_msg(1, "OK, time to make %s #%d",
    35853589            media_descriptor_string(bkpinfo->backup_media_type),
    35863590            g_current_media_number);
     
    35963600            bkpinfo->scratchdir);
    35973601    if (run_program_and_log_output(tmp, FALSE)) {
    3598         log_msg(2, "Warning - unable to copy autorun to scratchdir");
     3602        mr_msg(2, "Warning - unable to copy autorun to scratchdir");
    35993603    }
    36003604
     
    36033607    if (last_cd) {
    36043608        unlink(lastcd_fname);
    3605         log_msg(2,
     3609        mr_msg(2,
    36063610                "OK, you're telling me this is the last CD. Fair enough.");
    36073611    } else {
     
    36363640            if (find_cdrom_device(tmp, FALSE))  // make sure find_cdrom_device() finds, records CD-R's loc
    36373641            {
    3638                 log_msg(3, "*Sigh* Mike, I hate your computer.");
     3642                mr_msg(3, "*Sigh* Mike, I hate your computer.");
    36393643                bkpinfo->manual_cd_tray = TRUE;
    36403644            }                   // if it can't be found then force pausing
    36413645            else {
    3642                 log_msg(3, "Great. Found Mike's CD-ROM drive.");
     3646                mr_msg(3, "Great. Found Mike's CD-ROM drive.");
    36433647            }
    36443648        }
     
    36663670                }
    36673671            } else {
    3668                 log_msg(2, "Retrying, at user's request...");
     3672                mr_msg(2, "Retrying, at user's request...");
    36693673                res = 0;
    36703674            }
     
    36873691            bkpinfo->scratchdir, bkpinfo->scratchdir);
    36883692    if (system(tmp)) {
    3689         log_msg
     3693        mr_msg
    36903694            (2,
    36913695             "Error occurred when I tried to delete the redundant IMGs and GZs");
     
    36933697
    36943698    if (last_cd) {
    3695         log_msg(2, "This was your last CD.");
     3699        mr_msg(2, "This was your last CD.");
    36963700    } else {
    3697         log_msg(2, "Continuing to backup your data...");
     3701        mr_msg(2, "Continuing to backup your data...");
    36983702    }
    36993703
     
    37423746        //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr))
    37433747    {
    3744         log_msg(2,
     3748        mr_msg(2,
    37453749                "Not verifying again. Per-CD/ISO verification already carried out.");
    37463750        paranoid_system
     
    37543758        for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) {
    37553759            if (cdno != g_current_media_number) {
    3756                 log_msg(2,
     3760                mr_msg(2,
    37573761                        "Warning - had to change g_current_media_number from %d to %d",
    37583762                        g_current_media_number, cdno);
     
    38573861    }
    38583862    sprintf(tmp, "maxblocks = %d; p=%s", maxblocks, p);
    3859     log_msg(2, tmp);
     3863    mr_msg(2, tmp);
    38603864    /* copy data from image to floppy */
    38613865    if (!(fin = fopen(datafile, "r"))) {
     
    38713875        if (fread(blk, 1, 1024, fin) != 1024) {
    38723876            if (feof(fin)) {
    3873                 log_msg(1,
     3877                mr_msg(1,
    38743878                        "img read err - img ended prematurely - non-fatal error");
    38753879                sleep(3);
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1080 r1107  
    108108    strcpy(tmp, where_is_root_mounted());
    109109    sprintf(comment, "root is mounted at %s\n", tmp);
    110     log_msg(0, comment);
    111     log_msg(0,
     110    mr_msg(0, comment);
     111    mr_msg(0,
    112112            "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().",
    113113            tmp);
     
    141141    mr_free(tmp);
    142142    mr_free(comment);
    143     log_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);
     143    mr_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);
    144144    return (is_this_a_ramdisk);
    145145}
     
    226226#endif
    227227
    228     log_msg(3, "Ejecting %s", dev);
     228    mr_msg(3, "Ejecting %s", dev);
    229229    res2 = run_program_and_log_output(command, 1);
    230230    mr_free(command);
     
    483483    }
    484484    if (res) {
    485         log_msg(1, "mount failed");
    486     } else {
    487         log_msg(1, "mount succeeded with %s", dev);
     485        mr_msg(1, "mount failed");
     486    } else {
     487        mr_msg(1, "mount succeeded with %s", dev);
    488488    }
    489489    mr_free(dev);
     
    521521    if (g_cdrw_drive_is_here[0]) {
    522522        strcpy(cdrw_device, g_cdrw_drive_is_here);
    523         log_msg(3, "Been there, done that. Returning %s", cdrw_device);
     523        mr_msg(3, "Been there, done that. Returning %s", cdrw_device);
    524524        mr_free(comment);
    525525        mr_free(tmp);
     
    529529    }
    530530    if (g_backup_media_type == dvd) {
    531         log_msg(1,
     531        mr_msg(1,
    532532                "This is dumb. You're calling find_cdrw_device() but you're backing up to DVD. WTF?");
    533533        mr_free(comment);
     
    621621    if (g_cdrom_drive_is_here[0] && !isdigit(g_cdrom_drive_is_here[0])) {
    622622        strcpy(output, g_cdrom_drive_is_here);
    623         log_msg(3, "Been there, done that. Returning %s", output);
     623        mr_msg(3, "Been there, done that. Returning %s", output);
    624624        retval = 0;
    625625        goto end_of_find_cdrom_device;
     
    627627    if (the_last_place_i_found_it[0] != '\0' && !try_to_mount) {
    628628        strcpy(output, the_last_place_i_found_it);
    629         log_msg(3,
     629        mr_msg(3,
    630630                "find_cdrom_device() --- returning last found location - '%s'",
    631631                output);
     
    645645    if (!find_home_of_exe(cdr_exe)) {
    646646        strcpy(output, "/dev/cdrom");
    647         log_msg(4, "Can't find cdrecord; assuming %s", output);
     647        mr_msg(4, "Can't find cdrecord; assuming %s", output);
    648648        if (!does_device_exist(output)) {
    649             log_msg(4, "That didn't work. Sorry.");
     649            mr_msg(4, "That didn't work. Sorry.");
    650650            retval = 1;
    651651            goto end_of_find_cdrom_device;
     
    659659    fin = popen(command, "r");
    660660    if (!fin) {
    661         log_msg(4, "command=%s", command);
     661        mr_msg(4, "command=%s", command);
    662662        log_OS_error("Cannot popen command");
    663663        return (1);
     
    690690#ifndef __FreeBSD__
    691691    if (strlen(phrase_two) == 0) {
    692         log_msg(4, "Not running phase two. String is empty.");
     692        mr_msg(4, "Not running phase two. String is empty.");
    693693    } else {
    694694        sprintf(command, "dmesg | grep \"%s\" 2> /dev/null", phrase_two);
    695695        fin = popen(command, "r");
    696696        if (!fin) {
    697             log_msg(4, "Cannot run 2nd command - non-fatal, fortunately");
     697            mr_msg(4, "Cannot run 2nd command - non-fatal, fortunately");
    698698        } else {
    699699            for (fgets(tmp, MAX_STR_LEN, fin); !feof(fin);
    700700                 fgets(tmp, MAX_STR_LEN, fin)) {
    701                 log_msg(5, "--> '%s'", tmp);
     701                mr_msg(5, "--> '%s'", tmp);
    702702                if (tmp[0] != ' ' && tmp[1] != ' ') {
    703703                    p = strchr(tmp, ':');
     
    706706                        if (strstr(tmp, "DVD")) {
    707707                            sprintf(dvd_last_resort, "/dev/%s", tmp);
    708                             log_msg(4,
     708                            mr_msg(4,
    709709                                    "Ignoring '%s' because it's a DVD drive",
    710710                                    tmp);
     
    723723#ifdef __FreeBSD__
    724724    if (!found_it) {
    725         log_msg(4, "OK, approach 2");
     725        mr_msg(4, "OK, approach 2");
    726726        if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) {
    727727            if (!
     
    759759#else
    760760    if (!found_it && strlen(dvd_last_resort) > 0) {
    761         log_msg(4, "Well, I'll use the DVD - %s - as a last resort",
     761        mr_msg(4, "Well, I'll use the DVD - %s - as a last resort",
    762762                dvd_last_resort);
    763763        strcpy(output, dvd_last_resort);
     
    768768                strrchr(output, '/') + 1);
    769769        if (system(tmp) == 0) {
    770             log_msg(4,
     770            mr_msg(4,
    771771                    "%s is not right. It's being SCSI-emulated. Continuing.",
    772772                    output);
     
    777777
    778778    if (found_it) {
    779         log_msg(4, "(find_cdrom_device) --> '%s'", output);
     779        mr_msg(4, "(find_cdrom_device) --> '%s'", output);
    780780        if (!does_device_exist(output)) {
    781781            found_it = FALSE;
    782             log_msg(4, "OK, I was wrong, I haven't found it... yet.");
     782            mr_msg(4, "OK, I was wrong, I haven't found it... yet.");
    783783        }
    784784    }
    785785
    786786    if (!found_it) {
    787         log_msg(4, "OK, approach 2");
     787        mr_msg(4, "OK, approach 2");
    788788        if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/scd0"))) {
    789789            if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/sr0"))) {
     
    828828    if (found_it && try_to_mount) {
    829829        if (mount_CDROM_here(output, mountpoint)) {
    830             log_msg(4, "[Cardigans] I've changed my mind");
     830            mr_msg(4, "[Cardigans] I've changed my mind");
    831831            found_it = FALSE;
    832832        } else {
    833833            sprintf(tmp, "%s/archives", mountpoint);
    834834            if (!does_file_exist(tmp)) {
    835                 log_msg(4, "[Cardigans] I'll take it back");
     835                mr_msg(4, "[Cardigans] I'll take it back");
    836836                found_it = FALSE;
    837837            } else {
    838838                sprintf(command, "umount %s", output);
    839839                paranoid_system(command);
    840                 log_msg(4, "I'm confident the Mondo CD is in %s", output);
     840                mr_msg(4, "I'm confident the Mondo CD is in %s", output);
    841841            }
    842842        }
     
    846846    if (found_it) {
    847847        if (!does_file_exist(output)) {
    848             log_msg(3, "I still haven't found it.");
     848            mr_msg(3, "I still haven't found it.");
    849849            return (1);
    850850        }
    851         log_msg(3, "(find_cdrom_device) --> '%s'", output);
     851        mr_msg(3, "(find_cdrom_device) --> '%s'", output);
    852852        strcpy(the_last_place_i_found_it, output);
    853853        strcpy(g_cdrom_drive_is_here, output);
     
    859859            "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2",
    860860            cdr_exe, g_cdrw_drive_is_here);
    861     log_msg(1, "command=%s", command);
     861    mr_msg(1, "command=%s", command);
    862862    strcpy(tmp, call_program_and_get_last_line_of_output(command));
    863863    if (tmp[0]) {
    864864        strcpy(output, tmp);
    865         log_msg(4, "Finally found it at %s", output);
     865        mr_msg(4, "Finally found it at %s", output);
    866866        retval = 0;
    867867        goto end_of_find_cdrom_device;
    868868    } else {
    869         log_msg(4, "Still couldn't find it.");
     869        mr_msg(4, "Still couldn't find it.");
    870870        retval = 1;
    871871        goto end_of_find_cdrom_device;
     
    897897    if (g_dvd_drive_is_here[0]) {
    898898        strcpy(output, g_dvd_drive_is_here);
    899         log_msg(3, "Been there, done that. Returning %s", output);
     899        mr_msg(3, "Been there, done that. Returning %s", output);
    900900        return (0);
    901901    }
     
    904904            ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1")
    905905        );
    906     log_msg(5, "tmp = '%s'", tmp);
     906    mr_msg(5, "tmp = '%s'", tmp);
    907907    if (!tmp[0])
    908908        sprintf(tmp, call_program_and_get_last_line_of_output
     
    916916        sprintf(output, "/dev/scd%d", devno);
    917917        strcpy(g_dvd_drive_is_here, output);
    918         log_msg(2, "I think DVD is at %s", output);
    919     } else {
    920         log_msg(2, "I cannot find DVD");
     918        mr_msg(2, "I think DVD is at %s", output);
     919    } else {
     920        mr_msg(2, "I cannot find DVD");
    921921        retval = 1;
    922922    }
    923923
    924924    if (try_to_mount) {
    925         log_msg(1, "Ignoring the fact that try_to_mount==TRUE");
     925        mr_msg(1, "Ignoring the fact that try_to_mount==TRUE");
    926926    }
    927927    return (retval);
     
    988988
    989989    if (outvalB <= 0) {
    990         log_msg(1, "Error getting size of %s: %s", drive, strerror(errno));
     990        mr_msg(1, "Error getting size of %s: %s", drive, strerror(errno));
    991991#if linux
    992992        fileid = open(drive, O_RDONLY);
     
    997997                    cylindersize = hdgeo.heads * hdgeo.sectors / 2;
    998998                    outvalA = cylindersize * cylinders / 1024;
    999                     log_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",
     999                    mr_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",
    10001000                            hdgeo.cylinders, hdgeo.heads, hdgeo.sectors);
    10011001                    gotgeo = 1;
    10021002                } else {
    1003                     log_msg(1, "Harddisk geometry wrong");
     1003                    mr_msg(1, "Harddisk geometry wrong");
    10041004                }
    10051005            } else {
    1006                 log_msg(1,
     1006                mr_msg(1,
    10071007                        "Error in ioctl() getting new hard disk geometry (%s), resizing in unsafe mode",
    10081008                        strerror(errno));
     
    10101010            close(fileid);
    10111011        } else {
    1012             log_msg(1, "Failed to open %s for reading: %s", drive,
     1012            mr_msg(1, "Failed to open %s for reading: %s", drive,
    10131013                    strerror(errno));
    10141014        }
    10151015        if (!gotgeo) {
    1016             log_msg(1, "Failed to get harddisk geometry, using old mode");
     1016            mr_msg(1, "Failed to get harddisk geometry, using old mode");
    10171017        }
    10181018/* 
     
    10201020      if (ioctl (fd, HDIO_GETGEO, &hdgeo) != -1)  {
    10211021      close (fd);
    1022       log_msg (2, "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB", drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors, (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024));
     1022      mr_msg (2, "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB", drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors, (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024));
    10231023      if ( hdgeo.cylinders && hdgeo.heads && hdgeo.sectors ) {
    10241024          outvalB = ((long) (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024));
     
    10341034    outvalC = (outvalA > outvalB) ? outvalA : outvalB;
    10351035
    1036 //  log_msg (5, "drive = %s, error = %s", drive, strerror (errno));
     1036//  mr_msg (5, "drive = %s, error = %s", drive, strerror (errno));
    10371037//  fatal_error ("GPSOD: Unable to get size of drive");
    1038     log_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,
     1038    mr_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,
    10391039            outvalC);
    10401040
     
    10771077        close(fd);
    10781078    }
    1079     log_msg(4, "drive = %s, error = %s", drive, strerror(errno));
     1079    mr_msg(4, "drive = %s, error = %s", drive, strerror(errno));
    10801080    fatal_error("GPSOD: Unable to get size of drive");
    10811081#else
     
    10871087        if (ioctl(fd, HDIO_GETGEO, &hdgeo) != -1) {
    10881088            close(fd);
    1089             log_msg(2,
     1089            mr_msg(2,
    10901090                    "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB",
    10911091                    drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors,
     
    11611161    }
    11621162    if (!(p = strstr(tmp, "GB")) && !(p = strstr(tmp, "MB"))) {
    1163         log_msg(3, "Cannot find %s's size: dmesg isn't helping either.",
     1163        mr_msg(3, "Cannot find %s's size: dmesg isn't helping either.",
    11641164                drive);
    11651165        mr_free(tmp);
     
    12801280//  assert_string_is_neither_NULL_nor_zerolength(device_raw);
    12811281    if (device_raw[0] != '/' && !strstr(device_raw, ":/")) {
    1282         log_msg(1, "%s needs to have a '/' prefixed - I'll do it",
     1282        mr_msg(1, "%s needs to have a '/' prefixed - I'll do it",
    12831283                device_raw);
    12841284        sprintf(tmp, "/%s", device_raw);
     
    12861286        strcpy(tmp, device_raw);
    12871287    }
    1288     log_msg(1, "Is %s mounted?", tmp);
     1288    mr_msg(1, "Is %s mounted?", tmp);
    12891289    if (!strcmp(tmp, "/proc") || !strcmp(tmp, "proc")) {
    1290         log_msg(1,
     1290        mr_msg(1,
    12911291                "I don't know how the heck /proc made it into the mountlist. I'll ignore it.");
    12921292        return (0);
     
    13121312    sprintf(tmp, "%s | grep -E \"^%s\" > /dev/null 2> /dev/null",
    13131313            SWAPLIST_COMMAND, device_with_space);
    1314     log_msg(4, "tmp (command) = '%s'", tmp);
     1314    mr_msg(4, "tmp (command) = '%s'", tmp);
    13151315    if (!system(tmp)) {
    13161316        retval = 1;
     
    14341434
    14351435    }
    1436     log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,
     1436    mr_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,
    14371437            mountpoint);
    14381438    /*@ end vars *************************************************** */
     
    14471447#endif
    14481448
    1449     log_msg(4, command);
     1449    mr_msg(4, command);
    14501450    if (strncmp(device, "/dev/", 5) == 0) {
    14511451        retract_CD_tray_and_defeat_autorun();
    14521452    }
    14531453    retval = system(command);
    1454     log_msg(1, "system(%s) returned %d", command, retval);
     1454    mr_msg(1, "system(%s) returned %d", command, retval);
    14551455
    14561456    mr_free(command);
     
    14911491    assert(cd_number_i_want > 0);
    14921492
    1493 //  log_msg(3, "Insisting on CD number %d", cd_number_i_want);
     1493//  mr_msg(3, "Insisting on CD number %d", cd_number_i_want);
    14941494
    14951495    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1496         log_msg(3,
     1496        mr_msg(3,
    14971497                "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO");
    14981498        return;
     
    15041504    if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso
    15051505        || bkpinfo->backup_media_type == nfs) {
    1506         log_msg(3, "Remounting CD");
     1506        mr_msg(3, "Remounting CD");
    15071507        g_ISO_restore_mode = TRUE;
    15081508// FIXME --- I'm tempted to do something about this...
     
    15201520                    cd_number_i_want);
    15211521            if (does_file_exist(tmp)) {
    1522                 log_msg(1,
     1522                mr_msg(1,
    15231523                        "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir",
    15241524                        bkpinfo->isodir);
     
    15261526            }
    15271527        }
    1528         log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
     1528        mr_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
    15291529        if (mount_CDROM_here(tmp, MNT_CDROM)) {
    15301530            fatal_error("Mommy!");
     
    15341534    }
    15351535    if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) {
    1536         log_msg(3, "Currently, we hold %d but we want %d", res,
     1536        mr_msg(3, "Currently, we hold %d but we want %d", res,
    15371537                cd_number_i_want);
    15381538        sprintf(tmp, "Insisting on %s #%d",
     
    15421542                media_descriptor_string(bkpinfo->backup_media_type),
    15431543                cd_number_i_want);
    1544         log_msg(3, tmp);
     1544        mr_msg(3, tmp);
    15451545        while (what_number_cd_is_this(bkpinfo) != cd_number_i_want) {
    15461546            paranoid_system("sync");
     
    15681568            paranoid_system("sync");
    15691569        }
    1570         log_msg(1, "Thankyou. Proceeding...");
     1570        mr_msg(1, "Thankyou. Proceeding...");
    15711571        g_current_media_number = cd_number_i_want;
    15721572    }
     
    16271627        popup_and_OK("Please remove CD/floppy from drive(s)");
    16281628    }
    1629     log_msg(3, "media type = %s",
     1629    mr_msg(3, "media type = %s",
    16301630            bkptype_to_string(bkpinfo->backup_media_type));
    16311631    if (archiving_to_media) {
     
    16641664                strcpy(tmp, "1");
    16651665                sprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE);  // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    1666                 log_msg(1, "Setting to DVD defaults");
     1666                mr_msg(1, "Setting to DVD defaults");
    16671667            } else if (bkpinfo->backup_media_type == usb) {
    16681668                strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE);
     
    16721672                strcpy(tmp, "4");
    16731673                strcpy(sz_size, "650");
    1674                 log_msg(1, "Setting to CD defaults");
     1674                mr_msg(1, "Setting to CD defaults");
    16751675            }
    16761676            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
     
    16991699        if (bkpinfo->disaster_recovery) {
    17001700            strcpy(bkpinfo->media_device, "/dev/cdrom");
    1701             log_msg(2, "CD-ROM device assumed to be at %s",
     1701            mr_msg(2, "CD-ROM device assumed to be at %s",
    17021702                    bkpinfo->media_device);
    17031703        } else if (bkpinfo->restore_data
     
    17061706                strcpy(bkpinfo->media_device, "/dev/cdrom");
    17071707            }                   // just for the heck of it :)
    1708             log_msg(1, "bkpinfo->media_device = %s",
     1708            mr_msg(1, "bkpinfo->media_device = %s",
    17091709                    bkpinfo->media_device);
    17101710            if (bkpinfo->backup_media_type == dvd
    17111711                || find_cdrom_device(bkpinfo->media_device, FALSE)) {
    1712                 log_msg(1, "bkpinfo->media_device = %s",
     1712                mr_msg(1, "bkpinfo->media_device = %s",
    17131713                        bkpinfo->media_device);
    17141714                sprintf(comment,
     
    17231723                }
    17241724            }
    1725             log_msg(2, "%s device found at %s",
     1725            mr_msg(2, "%s device found at %s",
    17261726                    media_descriptor_string(bkpinfo->backup_media_type),
    17271727                    bkpinfo->media_device);
     
    17731773
    17741774        if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) {
    1775             log_msg(3, "Ok, using vanilla scsi tape.");
     1775            mr_msg(3, "Ok, using vanilla scsi tape.");
    17761776            strcpy(bkpinfo->media_device, VANILLA_SCSI_TAPE);
    17771777            if ((fin = fopen(bkpinfo->media_device, "r"))) {
     
    18161816            finish(1);
    18171817        }
    1818         log_msg(4, "sz_size = %s", sz_size);
     1818        mr_msg(4, "sz_size = %s", sz_size);
    18191819        sz_size[0] = '\0';
    18201820/*
     
    18311831                friendly_sizestr_to_sizelong(sz_size) / 2 - 50;
    18321832        }
    1833         log_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);
     1833        mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);
    18341834        if (bkpinfo->media_size[0] <= 0) {
    18351835            bkpinfo->media_size[0] = 0;
     
    19591959            finish(1);
    19601960        }
    1961         log_msg(3, "prefix set to %s", bkpinfo->prefix);
     1961        mr_msg(3, "prefix set to %s", bkpinfo->prefix);
    19621962
    19631963        for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    19641964            bkpinfo->media_size[i] = 650;
    19651965        }
    1966         log_msg(3, "Just set nfs_remote_dir to %s",
     1966        mr_msg(3, "Just set nfs_remote_dir to %s",
    19671967                bkpinfo->nfs_remote_dir);
    1968         log_msg(3, "isodir is still %s", bkpinfo->isodir);
     1968        mr_msg(3, "isodir is still %s", bkpinfo->isodir);
    19691969        break;
    19701970
     
    20072007            finish(1);
    20082008        }
    2009         log_msg(3, "prefix set to %s", bkpinfo->prefix);
     2009        mr_msg(3, "prefix set to %s", bkpinfo->prefix);
    20102010        break;
    20112011    default:
     
    21462146                bkpinfo->nfs_mount);
    21472147//      strcpy(bkpinfo->isodir, call_program_and_get_last_line_of_output(tmp));
    2148         log_msg(3, "I think the NFS mount is mounted at %s",
     2148        mr_msg(3, "I think the NFS mount is mounted at %s",
    21492149                bkpinfo->isodir);
    21502150    }
     
    21692169            fatal_error("Media size is less than zero.");
    21702170        } else {
    2171             log_msg(2, "Warning - media size is less than zero.");
     2171            mr_msg(2, "Warning - media size is less than zero.");
    21722172            bkpinfo->media_size[0] = 0;
    21732173        }
     
    23542354    }
    23552355//  assert_string_is_neither_NULL_nor_zerolength(dev);
    2356     log_msg(10, "Injecting %s", dev);
     2356    mr_msg(10, "Injecting %s", dev);
    23572357    inject_device(dev);
    23582358    if (!does_file_exist(dev)) {
    2359         log_msg(10, "%s doesn't exist. Returning FALSE.", dev);
     2359        mr_msg(10, "%s doesn't exist. Returning FALSE.", dev);
    23602360        return (FALSE);
    23612361    }
     
    23652365        && !run_program_and_log_output(command, FALSE)) {
    23662366        strcpy(output, dev);
    2367         log_msg(4, "Found it - %s", dev);
     2367        mr_msg(4, "Found it - %s", dev);
    23682368        return (TRUE);
    23692369    } else {
    23702370        output[0] = '\0';
    2371         log_msg(4, "It's not %s", dev);
     2371        mr_msg(4, "It's not %s", dev);
    23722372        return (FALSE);
    23732373    }
     
    26462646        lstat(curr_fname, &statbuf);
    26472647        while (S_ISLNK(statbuf.st_mode)) {
    2648             log_msg(1, "curr_fname = %s", curr_fname);
     2648            mr_msg(1, "curr_fname = %s", curr_fname);
    26492649            sprintf(command, "file %s", curr_fname);
    26502650            strcpy(tmp, call_program_and_get_last_line_of_output(command));
     
    26552655            for (p = scratch; *p != '\0' && *p != '\''; p++);
    26562656            *p = '\0';
    2657             log_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp,
     2657            mr_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp,
    26582658                    scratch);
    26592659            if (scratch[0] == '/') {
     
    26982698    malloc_string(command);
    26992699    malloc_string(fdisk);
    2700     log_msg(0, "Looking for partition table format type");
     2700    mr_msg(0, "Looking for partition table format type");
    27012701    sprintf(fdisk, "/sbin/parted2fdisk");
    2702     log_msg(1, "Using %s", fdisk);
     2702    mr_msg(1, "Using %s", fdisk);
    27032703    sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive);
    27042704    strcpy(tmp, call_program_and_get_last_line_of_output(command));
     
    27082708        strcpy(output, "GPT");
    27092709    }
    2710     log_msg(0, "Found %s partition table format type", output);
     2710    mr_msg(0, "Found %s partition table format type", output);
    27112711    mr_free(command);
    27122712    mr_free(tmp);
  • branches/stable/mondo/src/common/libmondo-fifo.c

    r1080 r1107  
    122122                internal_tape_block_size, keych, device);
    123123    }
    124     log_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);
     124    mr_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);
    125125    fres = popen(g_sz_call_to_buffer, sz_dir);
    126126    if (fres) {
    127         log_msg(2, "Successfully opened ('%c') tape device %s", direction,
     127        mr_msg(2, "Successfully opened ('%c') tape device %s", direction,
    128128                device);
    129129    } else {
    130         log_msg(2, "Failed to open ('%c') tape device %s", direction,
     130        mr_msg(2, "Failed to open ('%c') tape device %s", direction,
    131131                device);
    132132    }
     
    134134    sprintf(tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer);
    135135    if (run_program_and_log_output(tmp, 2)) {
    136         log_msg(2, "Warning - I think I failed to open tape, actually.");
     136        mr_msg(2, "Warning - I think I failed to open tape, actually.");
    137137    }
    138138    g_tape_buffer_size_MB = bufsize;
     
    172172    sprintf(command,
    173173            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    174     log_msg(2, "kill_buffer() --- command = %s", command);
     174    mr_msg(2, "kill_buffer() --- command = %s", command);
    175175    strcpy(tmp, call_program_and_get_last_line_of_output(command));
    176176    sprintf(command, "kill %s", tmp);
    177     log_msg(2, "kill_buffer() --- command = %s", command);
     177    mr_msg(2, "kill_buffer() --- command = %s", command);
    178178    if (strlen(tmp) > 0) {
    179179        run_program_and_log_output(command, TRUE);
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1103 r1107  
    165165    int retval = 0;
    166166
    167     log_msg(1, "Sorting file %s", orig_fname);
     167    mr_msg(1, "Sorting file %s", orig_fname);
    168168    malloc_string(tmp_fname);
    169169    malloc_string(command);
     
    179179    retval = system(command);
    180180    if (retval) {
    181         log_msg(2, "Failed to sort %s - oh dear", orig_fname);
     181        mr_msg(2, "Failed to sort %s - oh dear", orig_fname);
    182182    } else {
    183         log_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",
     183        mr_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",
    184184                orig_fname, tmp_fname, orig_fname);
    185185        sprintf(command, "mv -f %s %s", tmp_fname, orig_fname);
    186186        retval += run_program_and_log_output(command, 2);
    187187        if (retval) {
    188             log_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,
     188            mr_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,
    189189                    orig_fname);
    190190        } else {
    191             log_msg(2, "%s was sorted OK.", orig_fname);
     191            mr_msg(2, "%s was sorted OK.", orig_fname);
    192192        }
    193193    }
    194194    mr_free(tmp_fname);
    195195    mr_free(command);
    196     log_msg(1, "Finished sorting file %s", orig_fname);
     196    mr_msg(1, "Finished sorting file %s", orig_fname);
    197197    return (retval);
    198198}
     
    289289        if (i > MAX_STR_LEN - 1) {
    290290            incoming[MAX_STR_LEN - 30] = '\0';
    291             log_msg(1, "Warning - truncating file %s's name", incoming);
     291            mr_msg(1, "Warning - truncating file %s's name", incoming);
    292292            err++;
    293293        }
     
    350350        sprintf(tmp, "Filelist divided into %ld sets", curr_set_no + 1);
    351351    }
    352     log_msg(1, tmp);
     352    mr_msg(1, tmp);
    353353    close_evalcall_form();
    354354    /* This is to work around an obscure bug in Newt; open a form, close it,
     
    435435    pattr = popen(sys_call, "r");
    436436    if (!pattr) {
    437         log_msg(1, "Failed to open fattr() %s", sys_call);
     437        mr_msg(1, "Failed to open fattr() %s", sys_call);
    438438        return (1);
    439439    }
    440440    if (feof(pattr)) {
    441         log_msg(1, "Failed to call fattr() %s", sys_call);
     441        mr_msg(1, "Failed to call fattr() %s", sys_call);
    442442        paranoid_pclose(pattr);
    443443        return (2);
     
    467467
    468468    if (!(fin = fopen(filelist, "r"))) {
    469         log_msg(1, "Cannot openin filelist %s", filelist);
     469        mr_msg(1, "Cannot openin filelist %s", filelist);
    470470        return (1);
    471471    }
     
    473473    sprintf(pout_command, "gzip -c1 > %s", auxlist_fname);
    474474    if (!(pout = popen(pout_command, "w"))) {
    475         log_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);
     475        mr_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);
    476476        fclose(fin);
    477477        mr_free(pout_command);
     
    485485            file_to_analyze[i - 1] = '\0';
    486486        }
    487         log_msg(8, "Analyzing %s", file_to_analyze);
     487        mr_msg(8, "Analyzing %s", file_to_analyze);
    488488        asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\'));
    489489        asprintf(&sys_call, "%s 2>> /dev/null", strtmp);    // " MONDO_LOGFILE);
     
    552552
    553553    malloc_string(command);
    554     log_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,
     554    mr_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,
    555555            original_exat_fname, executable);
    556556    if (!orig_msklist || !orig_msklist[0]
    557557        || !does_file_exist(orig_msklist)) {
    558         log_msg(1,
     558        mr_msg(1,
    559559                "No masklist provided. I shall therefore set ALL attributes.");
    560560        sprintf(command, "gzip -dc %s | %s --restore - 2>> %s",
    561561                original_exat_fname, executable, MONDO_LOGFILE);
    562         log_msg(1, "command = %s", command);
     562        mr_msg(1, "command = %s", command);
    563563        retval = system(command);
    564564        mr_free(command);
    565         log_msg(1, "Returning w/ retval=%d", retval);
     565        mr_msg(1, "Returning w/ retval=%d", retval);
    566566        return (retval);
    567567    }
    568568    if (length_of_file(original_exat_fname) <= 0) {
    569         log_msg(1,
     569        mr_msg(1,
    570570                "original_exat_fname %s is empty or missing, so no need to set EXAT list",
    571571                original_exat_fname);
     
    589589            MONDO_LOGFILE);
    590590
    591     log_msg(1, "syscall_pin = %s", syscall_pin);
    592     log_msg(1, "syscall_pout = %s", syscall_pout);
     591    mr_msg(1, "syscall_pin = %s", syscall_pin);
     592    mr_msg(1, "syscall_pout = %s", syscall_pout);
    593593    pout = popen(syscall_pout, "w");
    594594    if (!pout) {
     
    638638
    639639        i = strcmp(p, q);
    640         log_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);
     640        mr_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);
    641641
    642642//      printf("%s v %s --> %d\n", p, q, i);
    643643
    644644        if (i < 0) {            // read another subset file in.
    645             log_msg(my_depth, "Reading next subset line in\n\n");
     645            mr_msg(my_depth, "Reading next subset line in\n\n");
    646646            fgets(current_subset_file, MAX_STR_LEN, faclin);
    647647            continue;
     
    653653        fgets(incoming, MAX_STR_LEN, pin);
    654654        if (!i) {
    655             log_msg(my_depth, "Copying master %s", q);
     655            mr_msg(my_depth, "Copying master %s", q);
    656656        }
    657657//      if (!i) { printf("Match --- %s\n", q); }
     
    696696        return (set_EXAT_list(masklist, fattr_fname, "setfattr"));
    697697    } else {
    698         log_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");
     698        mr_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");
    699699        return(0);
    700700    }
     
    708708        return (set_EXAT_list(masklist, acl_fname, "setfacl"));
    709709    } else {
    710         log_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");
     710        mr_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");
    711711        return(0);
    712712    }
     
    786786    char_to_add = string_to_add[0];
    787787    if (node->right != NULL && node->ch < char_to_add) {
    788         log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
     788        mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
    789789                char_to_add, node->ch, (node->right)->ch);
    790790        return (add_string_at_node(node->right, string_to_add));
     
    793793/* walk down tree if appropriate */
    794794    if (node->down != NULL && node->ch == char_to_add) {
    795         log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);
     795        mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);
    796796        depth++;
    797797        res = add_string_at_node(node->down, string_to_add + 1);
     
    801801
    802802    if (char_to_add == '\0' && node->ch == '\0') {
    803         log_msg(6, "%s already in tree", original_string);
     803        mr_msg(6, "%s already in tree", original_string);
    804804        return (1);
    805805    }
     
    809809    if (char_to_add < node->ch) // add to the left of node
    810810    {
    811         log_msg(7, "depth=%d char=%c --- adding (left)", depth,
     811        mr_msg(7, "depth=%d char=%c --- adding (left)", depth,
    812812                char_to_add);
    813813        memcpy((void *) newnode, (void *) node, sizeof(struct s_node));
     
    815815    } else if (char_to_add > node->ch)  // add to the right of node
    816816    {
    817         log_msg(7, "depth=%d char=%c --- adding (right)", depth,
     817        mr_msg(7, "depth=%d char=%c --- adding (right)", depth,
    818818                char_to_add);
    819819        newnode->right = node->right;   // newnode is to the RIGHT of node
     
    826826    node->expanded = node->selected = FALSE;
    827827    if (char_to_add == '\0') {
    828         log_msg(6, "Added %s OK", original_string);
     828        mr_msg(6, "Added %s OK", original_string);
    829829        return (0);
    830830    }
    831831// add the rest
    832     log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);
     832    mr_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);
    833833    for (i = 1; i < noof_chars; i++) {
    834834        node->down = (struct s_node *) mr_malloc(sizeof(struct s_node));
    835835        node = node->down;
    836836        char_to_add = string_to_add[i];
    837         log_msg(6, "Adding '%c'", char_to_add);
     837        mr_msg(6, "Adding '%c'", char_to_add);
    838838        node->ch = char_to_add;
    839839        node->right = node->down = NULL;
     
    843843        }
    844844    }
    845     log_msg(6, "Finally - added %s OK", original_string);
     845    mr_msg(6, "Finally - added %s OK", original_string);
    846846    return (0);
    847847}
     
    886886    sprintf(command_to_open_fname, "gzip -dc %s", filelist_fname);
    887887    sprintf(tmp, "zcat %s | wc -l", filelist_fname);
    888     log_msg(6, "tmp = %s", tmp);
     888    mr_msg(6, "tmp = %s", tmp);
    889889    lines_in_filelist =
    890890        atol(call_program_and_get_last_line_of_output(tmp));
     
    949949
    950950    if (depth == 0) {
    951         log_msg(0, "----------------show filelist--------------");
     951        mr_msg(0, "----------------show filelist--------------");
    952952    }
    953953    current_string[depth] = node->ch;
    954954
    955     log_msg(3, "depth=%d", depth);
     955    mr_msg(3, "depth=%d", depth);
    956956    if (node->down) {
    957         log_msg(3, "moving down");
     957        mr_msg(3, "moving down");
    958958        depth++;
    959959        show_filelist(node->down);
     
    962962
    963963    if (!node->ch) {
    964         log_msg(0, "%s\n", current_string);
     964        mr_msg(0, "%s\n", current_string);
    965965    }
    966966
    967967    if (node->right) {
    968         log_msg(3, "moving right");
     968        mr_msg(3, "moving right");
    969969        show_filelist(node->right);
    970970    }
    971971    if (depth == 0) {
    972         log_msg(0, "----------------show filelist--------------");
     972        mr_msg(0, "----------------show filelist--------------");
    973973    }
    974974    return;
     
    10311031    for (node = filelist; node != NULL; node = node->right) {
    10321032        str[depth] = node->ch;
    1033         log_msg(5, "depth=%d ch=%c", depth, node->ch);
     1033        mr_msg(5, "depth=%d ch=%c", depth, node->ch);
    10341034        if (!node->ch) {
    10351035//    if (node->selected)
     
    14031403#endif
    14041404        mr_free(find_excludes);
    1405         log_msg(5, "find command = %s", strtmp);
     1405        mr_msg(5, "find command = %s", strtmp);
    14061406        system(strtmp);
    14071407        mr_free(strtmp);
     
    14131413        find_skeleton_marker[0] = '\0';
    14141414        skeleton_lino = 1;
    1415         log_msg(5, "entries = %ld", g_skeleton_entries);
     1415        mr_msg(5, "entries = %ld", g_skeleton_entries);
    14161416        percentage = 0;
    14171417    } else if (depth <= MAX_SKEL_DEPTH) // update evalcall form if appropriate
     
    14201420                "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir,
    14211421                g_skeleton_filelist, g_skeleton_filelist);
    1422 //    log_msg(0, "fsm = %s", find_skeleton_marker);
     1422//    mr_msg(0, "fsm = %s", find_skeleton_marker);
    14231423        if (!system(find_skeleton_marker)) {
    14241424            percentage = (int) (skeleton_lino * 100 / g_skeleton_entries);
    14251425            skeleton_lino++;
    1426 //        log_msg(5, "Found %s", dir);
    1427 //        log_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);
     1426//        mr_msg(5, "Found %s", dir);
     1427//        mr_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);
    14281428            sprintf(find_skeleton_marker, "mv -f %s.new %s",
    14291429                    g_skeleton_filelist, g_skeleton_filelist);
    1430 //        log_msg(6, "fsm = %s", find_skeleton_marker);
     1430//        mr_msg(6, "fsm = %s", find_skeleton_marker);
    14311431            run_program_and_log_output(find_skeleton_marker, 8);
    14321432            time(&this_time);
     
    14461446    depth++;
    14471447
    1448 //  log_msg(0, "Cataloguing %s", dir);
     1448//  mr_msg(0, "Cataloguing %s", dir);
    14491449    if (sth[0] == ' ') {
    14501450        skip_these = sth;
     
    15131513        mr_free(find_skeleton_marker);
    15141514        unlink(g_skeleton_filelist);
    1515         log_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);
     1515        mr_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);
    15161516    }
    15171517    mr_free(tmp);
     
    15841584    malloc_string(g_skeleton_filelist);
    15851585    exclude_paths = mr_malloc(1000);
    1586     log_msg(3, "Trying to write test string to exclude_paths");
     1586    mr_msg(3, "Trying to write test string to exclude_paths");
    15871587    strcpy(exclude_paths, "/blah /froo");
    1588     log_msg(3, "...Success!");
     1588    mr_msg(3, "...Success!");
    15891589    sprintf(sz_datefile, sz_datefile_wildcard, 0);
    15901590    if (!include_paths && !userdef_filelist) {
     
    16131613                                  ("date +%s"));
    16141614    } else if (lstat(sz_datefile, &statbuf)) {
    1615         log_msg(2,
     1615        mr_msg(2,
    16161616                "Warning - unable to find date of previous backup. Full backup instead.");
    16171617        differential = 0;
     
    16191619    } else {
    16201620        time_of_last_full_backup = statbuf.st_mtime;
    1621         log_msg(2, "Differential backup. Yay.");
     1621        mr_msg(2, "Differential backup. Yay.");
    16221622    }
    16231623
    16241624// use user-specified filelist (if specified)
    16251625    if (userdef_filelist) {
    1626         log_msg(1,
     1626        mr_msg(1,
    16271627                "Using the user-specified filelist - %s - instead of calculating one",
    16281628                userdef_filelist);
     
    16321632        }
    16331633    } else {
    1634         log_msg(2, "include_paths = '%s'", include_paths);
    1635         log_msg(1, "Calculating filelist");
     1634        mr_msg(2, "include_paths = '%s'", include_paths);
     1635        mr_msg(1, "Calculating filelist");
    16361636        sprintf(exclude_paths, " %s %s %s %s %s %s . .. \
    16371637" MNT_CDROM " " MNT_FLOPPY " /media \
    16381638/proc /sys /tmp /root/images/mondo /var/cache/mindi ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
    16391639
    1640         log_msg(2, "Excluding paths = '%s'", exclude_paths);
    1641         log_msg(2,
     1640        mr_msg(2, "Excluding paths = '%s'", exclude_paths);
     1641        mr_msg(2,
    16421642                "Generating skeleton filelist so that we can track our progress");
    16431643        sprintf(g_skeleton_filelist, "%s/tmpfs/skeleton.txt", tmpdir);
    16441644        make_hole_for_file(g_skeleton_filelist);
    1645         log_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);
    1646         log_msg(2, "Opening out filelist to %s", sz_filelist);
     1645        mr_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);
     1646        mr_msg(2, "Opening out filelist to %s", sz_filelist);
    16471647        if (!(fout = fopen(sz_filelist, "w"))) {
    16481648            fatal_error("Cannot openout to sz_filelist");
     
    16501650        i = 0;
    16511651        if (strlen(include_paths) == 0) {
    1652             log_msg(1, "Including only '/' in %s", sz_filelist);
     1652            mr_msg(1, "Including only '/' in %s", sz_filelist);
    16531653            open_and_list_dir("/", exclude_paths, fout,
    16541654                              time_of_last_full_backup);
     
    16571657            while (*p) {
    16581658                q = next_entry(p);
    1659                 log_msg(1, "Including %s in filelist %s", q, sz_filelist);
     1659                mr_msg(1, "Including %s in filelist %s", q, sz_filelist);
    16601660                open_and_list_dir(q, exclude_paths, fout,
    16611661                                  time_of_last_full_backup);
     
    16681668        paranoid_fclose(fout);
    16691669    }
    1670     log_msg(2, "Copying new filelist to scratchdir");
     1670    mr_msg(2, "Copying new filelist to scratchdir");
    16711671    sprintf(command, "mkdir -p %s/archives", scratchdir);
    16721672    paranoid_system(command);
     
    16751675    sprintf(command, "mv -f %s %s", sz_filelist, tmpdir);
    16761676    paranoid_system(command);
    1677     log_msg(2, "Freeing variables");
     1677    mr_msg(2, "Freeing variables");
    16781678    mr_free(sz_filelist);
    16791679    mr_free(command);
     
    16811681    mr_free(tmp);
    16821682    mr_free(g_skeleton_filelist);
    1683     log_msg(2, "Exiting");
     1683    mr_msg(2, "Exiting");
    16841684    return (0);
    16851685}
     
    17201720    noof_chars = strlen(string_to_find) + 1;    /* we include the '\0' */
    17211721
    1722     log_msg(7, "starting --- str=%s", string_to_find);
     1722    mr_msg(7, "starting --- str=%s", string_to_find);
    17231723
    17241724/* walk across tree if necessary */
     
    17261726    char_to_find = string_to_find[0];
    17271727    if (node->right != NULL && node->ch < char_to_find) {
    1728         log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
     1728        mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,
    17291729                char_to_find, node->ch, (node->right)->ch);
    17301730        return (find_string_at_node(node->right, string_to_find));
     
    17331733/* walk down tree if appropriate */
    17341734    if (node->down != NULL && node->ch == char_to_find) {
    1735         log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);
     1735        mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);
    17361736        depth++;
    17371737        node = find_string_at_node(node->down, string_to_find + 1);
     
    17411741
    17421742    if (char_to_find == '\0' && node->ch == '\0') {
    1743         log_msg(7, "%s is in tree", original_string);
     1743        mr_msg(7, "%s is in tree", original_string);
    17441744        return (node);
    17451745    } else {
    1746         log_msg(7, "%s is NOT in tree", original_string);
     1746        mr_msg(7, "%s is NOT in tree", original_string);
    17471747        return (NULL);
    17481748    }
     
    17721772    size_t len = 0;             // Scrub's patch doesn't work without that
    17731773
    1774 //  log_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");
     1774//  mr_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");
    17751775    malloc_string(fname);
    17761776    malloc_string(tmp);
    1777     log_msg(5, "starting");
    1778     log_msg(5, "needles_list_fname = %s", needles_list_fname);
    1779     log_msg(5, "matches_list_fname = %s", matches_list_fname);
     1777    mr_msg(5, "starting");
     1778    mr_msg(5, "needles_list_fname = %s", needles_list_fname);
     1779    mr_msg(5, "matches_list_fname = %s", matches_list_fname);
    17801780    if (!(fin = fopen(needles_list_fname, "r"))) {
    17811781        fatal_error("Cannot openin needles_list_fname");
     
    18081808*/
    18091809
    1810         log_msg(5, "Looking for '%s'", fname);
     1810        mr_msg(5, "Looking for '%s'", fname);
    18111811        found_node = find_string_at_node(filelist, fname);
    18121812        if (found_node) {
     
    18171817                    strcpy(fname, tmp);
    18181818                }
    1819                 log_msg(5, "Found '%s'", fname);
     1819                mr_msg(5, "Found '%s'", fname);
    18201820                turn_wildcard_chars_into_literal_chars(tmp, fname);
    18211821                fprintf(fout, "%s\n", tmp);
     
    18521852
    18531853    malloc_string(tmp);
    1854     log_msg(3, "Adding %s to filelist", list_of_files_fname);
     1854    mr_msg(3, "Adding %s to filelist", list_of_files_fname);
    18551855    if (!(fin = fopen(list_of_files_fname, "r"))) {
    18561856        iamhere(list_of_files_fname);
     
    18661866            tmp[strlen(tmp) - 1] = '\0';
    18671867        }
    1868         log_msg(2, "tmp = '%s'", tmp);
     1868        mr_msg(2, "tmp = '%s'", tmp);
    18691869        if (!tmp[0]) {
    18701870            continue;
    18711871        }
    18721872        if ((nod = find_string_at_node(filelist, tmp))) {
    1873             log_msg(5, "Found '%s' in filelist already. Cool.", tmp);
     1873            mr_msg(5, "Found '%s' in filelist already. Cool.", tmp);
    18741874        } else {
    18751875            add_string_at_node(filelist, tmp);
     
    18791879        if (nod && flag_em) {
    18801880            toggle_path_selection(filelist, tmp, TRUE);
    1881             log_msg(5, "Flagged '%s'", tmp);
     1881            mr_msg(5, "Flagged '%s'", tmp);
    18821882        }
    18831883    }
  • branches/stable/mondo/src/common/libmondo-files.c

    r1100 r1107  
    183183    //  assert_string_is_neither_NULL_nor_zerolength(filename);
    184184    if (lstat(filename, &buf)) {
    185         log_msg(20, "%s does not exist", filename);
     185        mr_msg(20, "%s does not exist", filename);
    186186        return (FALSE);
    187187    } else {
    188         log_msg(20, "%s exists", filename);
     188        mr_msg(20, "%s exists", filename);
    189189        return (TRUE);
    190190    }
     
    355355    strcpy(output, incoming);
    356356    if (output[0] != '\0' && does_file_exist(output)) {
    357         log_msg(4, "find_home_of_exe () --- Found %s at %s", fname,
     357        mr_msg(4, "find_home_of_exe () --- Found %s at %s", fname,
    358358                incoming);
    359359    } else {
    360360        output[0] = '\0';
    361         log_msg(4, "find_home_of_exe() --- Could not find %s", fname);
     361        mr_msg(4, "find_home_of_exe() --- Could not find %s", fname);
    362362    }
    363363    mr_free(incoming);
     
    462462        *p = '\0';
    463463    }
    464 //  log_msg(2, "lastline='%s', ", p, lastline);
     464//  mr_msg(2, "lastline='%s', ", p, lastline);
    465465    if (!p) {
    466466        return (0);
     
    789789    strcpy(sz_res, call_program_and_get_last_line_of_output(command));
    790790    file_len_K = atol(sz_res);
    791     log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);
     791    mr_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);
    792792    return (file_len_K);
    793793}
     
    828828            ("Cannot open biggielist. OK, so estimate is based on filesets only.");
    829829    } else {
    830         log_msg(4, "Reading it...");
     830        mr_msg(4, "Reading it...");
    831831        for (fgets(fname, MAX_STR_LEN, fin); !feof(fin);
    832832             fgets(fname, MAX_STR_LEN, fin)) {
     
    853853            if (file_len_K > 0) {
    854854                scratchL += file_len_K;
    855                 log_msg(4, "%s --> %ld K", fname, file_len_K);
     855                mr_msg(4, "%s --> %ld K", fname, file_len_K);
    856856            }
    857857            sprintf(comment,
    858858                    "After adding %s, scratchL+%ld now equals %ld", fname,
    859859                    file_len_K, scratchL);
    860             log_msg(4, comment);
     860            mr_msg(4, comment);
    861861            if (feof(fin)) {
    862862                break;
     
    10741074                        "Copying Mondo's core files to the scratch directory");
    10751075
    1076     log_msg(4, "g_mondo_home='%s'", g_mondo_home);
     1076    mr_msg(4, "g_mondo_home='%s'", g_mondo_home);
    10771077    if (strlen(g_mondo_home) < 2) {
    10781078        find_and_store_mondoarchives_home(g_mondo_home);
     
    10811081            bkpinfo->scratchdir);
    10821082
    1083     log_msg(4, "command = %s", command);
     1083    mr_msg(4, "command = %s", command);
    10841084    if (run_program_and_log_output(command, 1)) {
    10851085        fatal_error("Failed to copy Mondo's stuff to scratchdir");
     
    13931393                "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n");
    13941394        paranoid_fclose(fout);
    1395         log_msg(2, "Created %s", outfile);
     1395        mr_msg(2, "Created %s", outfile);
    13961396        sprintf(tmp, "chmod +x %s", outfile);
    13971397        paranoid_system(tmp);
  • branches/stable/mondo/src/common/libmondo-fork.c

    r1080 r1107  
    102102/*@***********   End Variables ***************************************/
    103103
    104     log_msg(3, "Starting");
     104    mr_msg(3, "Starting");
    105105    assert(bkpinfo != NULL);
    106106    assert_string_is_neither_NULL_nor_zerolength(basic_call);
     
    122122    resolve_naff_tokens(tmp, midway_call, cd_number_str, "_CD#_");
    123123    resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_");
    124     log_msg(4, "basic call = '%s'", basic_call);
    125     log_msg(4, "midway_call = '%s'", midway_call);
    126     log_msg(4, "tmp = '%s'", tmp);
    127     log_msg(4, "ultimate call = '%s'", ultimate_call);
     124    mr_msg(4, "basic call = '%s'", basic_call);
     125    mr_msg(4, "midway_call = '%s'", midway_call);
     126    mr_msg(4, "tmp = '%s'", tmp);
     127    mr_msg(4, "ultimate call = '%s'", ultimate_call);
    128128    sprintf(command, "%s >> %s", ultimate_call, MONDO_LOGFILE);
    129129
    130130    log_to_screen
    131131        ("Please be patient. Do not be alarmed by on-screen inactivity.");
    132     log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
     132    mr_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
    133133            what_i_am_doing);
    134134    strcpy(tmp, command);
     
    150150        }
    151151#endif
    152         log_msg(1, "command = '%s'", command);
     152        mr_msg(1, "command = '%s'", command);
    153153        retval += system(command);
    154154        if (!g_text_mode) {
     
    156156        }
    157157        if (retval) {
    158             log_msg(2, "Basic call '%s' returned an error.", basic_call);
     158            mr_msg(2, "Basic call '%s' returned an error.", basic_call);
    159159            popup_and_OK("Press ENTER to continue.");
    160160            popup_and_OK
     
    164164    /* if text mode then do the above & RETURN; if not text mode, do this... */
    165165    else {
    166         log_msg(3, "command = '%s'", command);
     166        mr_msg(3, "command = '%s'", command);
    167167//      yes_this_is_a_goto:
    168168        retval =
     
    181181  if (bkpinfo->backup_media_type == dvd && !bkpinfo->please_dont_eject_when_restoring)
    182182    {
    183       log_msg(3, "Ejecting DVD device");
     183      mr_msg(3, "Ejecting DVD device");
    184184      eject_device(bkpinfo->media_device);
    185185    }
     
    220220    assert(program != NULL);
    221221    if (!program[0]) {
    222         log_msg(2, "Warning - asked to run zerolength program");
     222        mr_msg(2, "Warning - asked to run zerolength program");
    223223        return (1);
    224224    }
     
    256256    res = system(callstr);
    257257    if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) {
    258         log_msg(0, "running: %s", callstr);
    259         log_msg(0,
     258        mr_msg(0, "running: %s", callstr);
     259        mr_msg(0,
    260260                "--------------------------------start of output-----------------------------");
    261261    }
     
    284284            if ((res == 0 && log_if_success)
    285285                || (res != 0 && log_if_failure)) {
    286                 log_msg(0, incoming);
     286                mr_msg(0, incoming);
    287287            }
    288288        }
     
    291291    unlink("/tmp/mondo-run-prog-thing.tmp");
    292292    if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) {
    293         log_msg(0,
     293        mr_msg(0,
    294294                "--------------------------------end of output------------------------------");
    295295        if (res) {
    296             log_msg(0, "...ran with res=%d", res);
     296            mr_msg(0, "...ran with res=%d", res);
    297297        } else {
    298             log_msg(0, "...ran just fine. :-)");
     298            mr_msg(0, "...ran just fine. :-)");
    299299        }
    300300    }
    301301//  else
    302 //    { log_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }
     302//    { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }
    303303    return (res);
    304304}
     
    340340    open_evalcall_form(what_i_am_doing);
    341341    sprintf(tmp, "Executing %s", basic_call);
    342     log_msg(2, tmp);
     342    mr_msg(2, tmp);
    343343    if (!(fin = popen(command, "r"))) {
    344344        log_OS_error("Unable to popen-in command");
     
    350350        log_to_screen("Waiting for external binary to start");
    351351        for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) {
    352             log_msg(3, "Waiting for lockfile %s to exist", lockfile);
     352            mr_msg(3, "Waiting for lockfile %s to exist", lockfile);
    353353        }
    354354    }
     
    375375    res = pclose(fin);
    376376    /* Log actual pclose errors. */
    377     if (errno) log_msg(5, "pclose err: %d", errno);
     377    if (errno) mr_msg(5, "pclose err: %d", errno);
    378378    /* Check if we have a valid status. If we do, extract the called program's exit code. */
    379379    /* If we don't, highlight this fact by returning -1. */
     
    413413    FILE *ftmp;
    414414
    415     log_msg(5, "Opening.");
     415    mr_msg(5, "Opening.");
    416416    malloc_string(tmp);
    417417    tmp[0] = '\0';
     
    435435                fatal_error("Cannot write introductory block");
    436436            }
    437             log_msg(7,
     437            mr_msg(7,
    438438                    "subslice #%ld --- I have read %ld of %ld bytes in from f_orig",
    439439                    subsliceno, bytes_read_in, bytes_to_be_read);
     
    443443                fatal_error("Cannot write post-thingy block");
    444444            }
    445             log_msg(7, "Subslice #%d written OK", subsliceno);
     445            mr_msg(7, "Subslice #%d written OK", subsliceno);
    446446            subsliceno++;
    447447        }
     
    456456            fatal_error("Cannot read the introductory block");
    457457        }
    458         log_msg(5, "tmp is %s", tmp);
     458        mr_msg(5, "tmp is %s", tmp);
    459459        if (!strstr(tmp, PIMP_START_SZ)) {
    460460            fatal_error("Can't find intro blk");
     
    465465        bytes_to_be_read = atol(tmp);
    466466        while (bytes_to_be_read > 0) {
    467             log_msg(7, "subslice#%ld, bytes=%ld", subsliceno,
     467            mr_msg(7, "subslice#%ld, bytes=%ld", subsliceno,
    468468                    bytes_to_be_read);
    469469            bytes_read_in = fread(buf, 1, bytes_to_be_read, fin);
     
    477477            }
    478478            if (atol(tmp) != subsliceno) {
    479                 log_msg(1, "Wanted subslice %ld but got %ld ('%s')",
     479                mr_msg(1, "Wanted subslice %ld but got %ld ('%s')",
    480480                        subsliceno, atol(tmp), tmp);
    481481            }
    482             log_msg(7, "Subslice #%ld read OK", subsliceno);
     482            mr_msg(7, "Subslice #%ld read OK", subsliceno);
    483483            subsliceno++;
    484484            if (fread(tmp, 1, 64, fin) != 64) {
     
    489489    }
    490490
    491 //  log_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);
     491//  mr_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);
    492492
    493493    if (direction == 'w') {
     
    497497        }
    498498    } else {
    499         log_msg(1, "tmpA is %s", tmp);
     499        mr_msg(1, "tmpA is %s", tmp);
    500500        if (!strstr(tmp, PIMP_END_SZ)) {
    501501            if (fread(tmp, 1, 64, fin) != 64) {
    502502                fatal_error("Can't read the final block");
    503503            }
    504             log_msg(5, "tmpB is %s", tmp);
     504            mr_msg(5, "tmpB is %s", tmp);
    505505            if (!strstr(tmp, PIMP_END_SZ)) {
    506506                ftmp = fopen("/tmp/out.leftover", "w");
    507507                bytes_read_in = fread(tmp, 1, 64, fin);
    508                 log_msg(1, "bytes_read_in = %ld", bytes_read_in);
     508                mr_msg(1, "bytes_read_in = %ld", bytes_read_in);
    509509//      if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); }
    510510                fwrite(tmp, 1, bytes_read_in, ftmp);
    511511                sprintf(tmp, "I am here - %lld", (long long)ftello(fin));
    512 //    log_msg(0, tmp);
     512//    mr_msg(0, tmp);
    513513                fread(tmp, 1, 512, fin);
    514                 log_msg(0, "tmp = '%s'", tmp);
     514                mr_msg(0, "tmp = '%s'", tmp);
    515515                fwrite(tmp, 1, 512, ftmp);
    516516                fclose(ftmp);
     
    522522    mr_free(buf);
    523523    mr_free(tmp);
    524     log_msg(3, "Successfully copied %ld bytes", bytes_written_out);
     524    mr_msg(3, "Successfully copied %ld bytes", bytes_written_out);
    525525    return (retval);
    526526}
     
    588588    sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    589589            tempfile);
    590     log_msg(3, command);
     590    mr_msg(3, command);
    591591    open_evalcall_form(title);
    592592    if (!(pin = popen(command, "r"))) {
     
    599599        pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
    600600        if (pcno < 0 || pcno > 100) {
    601             log_msg(5, "Weird pc#");
     601            mr_msg(5, "Weird pc#");
    602602            continue;
    603603        }
     
    634634    res = 999;
    635635    sz_command = (char *) info;
    636     log_msg(4, "sz_command = '%s'", sz_command);
     636    mr_msg(4, "sz_command = '%s'", sz_command);
    637637    res = system(sz_command);
    638638    if (res > 256 && res != 4444) {
    639639        res = res / 256;
    640640    }
    641     log_msg(4, "child res = %d", res);
     641    mr_msg(4, "child res = %d", res);
    642642    sz_command[0] = '\0';
    643643    pthread_exit((void *) (&res));
     
    675675    strcpy(title, tt);
    676676    sprintf(command, "%s 2>> %s", cmd, MONDO_LOGFILE);
    677     log_msg(3, "command = '%s'", command);
     677    mr_msg(3, "command = '%s'", command);
    678678    if ((res =
    679679         pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit,
     
    682682    }
    683683
    684     log_msg(8, "Parent running");
     684    mr_msg(8, "Parent running");
    685685    open_evalcall_form(title);
    686686    for (sleep(1); command[0] != '\0'; sleep(1)) {
    687687        pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
    688688        if (pcno <= 0 || pcno > 100) {
    689             log_msg(8, "Weird pc#");
     689            mr_msg(8, "Weird pc#");
    690690            continue;
    691691        }
     
    711711        res = 666;
    712712    }
    713     log_msg(3, "Parent res = %d", res);
     713    mr_msg(3, "Parent res = %d", res);
    714714    mr_free(command);
    715715    mr_free(title);
  • branches/stable/mondo/src/common/libmondo-mountlist.c

    r1080 r1107  
    382382        strcat(flaws_str, tmp);
    383383        res++;
    384         log_msg(1, tmp);
     384        mr_msg(1, tmp);
    385385        goto endoffunc;
    386386    } else {
     
    744744                    "Not putting %s in list of drives: it's a virtual drive",
    745745                    drive);
    746             log_msg(8, tmp);
     746            mr_msg(8, tmp);
    747747            continue;
    748748        }
     
    753753                    "Not putting %s in list of drives: it has zero size (maybe an LVM volume)",
    754754                    drive);
    755             log_msg(8, tmp);
     755            mr_msg(8, tmp);
    756756            continue;
    757757        }
     
    771771                "Putting %s with size %lli in list of drives",
    772772                drive, size);
    773         log_msg(8, tmp);
     773        mr_msg(8, tmp);
    774774
    775775        (void) truncate_to_drive_name(drive);
     
    783783    }
    784784    drivelist->entries = noof_drives;
    785     log_msg(8, "Made list of drives");
     785    mr_msg(8, "Made list of drives");
    786786    mr_free(drive);
    787787    mr_free(tmp);
     
    944944            !strcmp(mountlist->el[items].device, "devpts")
    945945            ) {
    946             log_msg(1,
     946            mr_msg(1,
    947947                    "Ignoring %s in mountlist - not loading that line :) ",
    948948                    mountlist->el[items].device);
  • branches/stable/mondo/src/common/libmondo-raid.c

    r1103 r1107  
    633633    get_next_raidtab_line(fin, label, value);
    634634    while (!feof(fin)) {
    635         log_msg(1, "Looking for raid record #%d", items);
     635        mr_msg(1, "Looking for raid record #%d", items);
    636636        initialize_raidrec(&raidlist->el[items]);
    637637        v = 0;
     
    646646        raidlist->el[items].additional_vars.entries = v;
    647647        if (feof(fin)) {
    648             log_msg(1, "No more records.");
     648            mr_msg(1, "No more records.");
    649649            continue;
    650650        }
    651         log_msg(2, "Record #%d (%s) found", items, value);
     651        mr_msg(2, "Record #%d (%s) found", items, value);
    652652        strcpy(raidlist->el[items].raid_device, value);
    653653        for (get_next_raidtab_line(fin, label, value);
     
    660660    paranoid_fclose(fin);
    661661    raidlist->entries = items;
    662     log_msg(1, "Raidtab loaded successfully.");
    663     log_msg(1, "%d RAID devices in raidtab", items);
     662    mr_msg(1, "Raidtab loaded successfully.");
     663    mr_msg(1, "%d RAID devices in raidtab", items);
    664664    mr_free(tmp);
    665665    mr_free(label);
     
    732732            raidrec->parity = 3;
    733733        } else {
    734             log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);
     734            mr_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);
    735735        }
    736736    } else if (!strcmp(label, "device")) {
     
    991991  // open file
    992992  if (!(fin = fopen(MDSTAT_FILE, "r"))) {
    993     log_msg(1, "Could not open %s.\n", MDSTAT_FILE);
     993    mr_msg(1, "Could not open %s.\n", MDSTAT_FILE);
    994994    return 1;
    995995  }
     
    10371037    token = mr_strtok (string, delims, &lastpos);
    10381038    if (!strcmp(token, "inactive")) {
    1039       log_msg(1, "RAID device '%s' inactive.\n",
     1039      mr_msg(1, "RAID device '%s' inactive.\n",
    10401040         raidlist->el[raidlist->entries].raid_device);
    10411041      mr_free(string);
     
    10641064      raidlist->el[raidlist->entries].raid_level = 10;
    10651065    } else {
    1066       log_msg(1, "Unknown RAID level '%s'.\n", token);
     1066      mr_msg(1, "Unknown RAID level '%s'.\n", token);
    10671067      mr_free(string);
    10681068      mr_free(token);
     
    11081108        break;
    11091109      default: // error
    1110         log_msg(1, "Unknown device type '%c'\n", type);
     1110        mr_msg(1, "Unknown device type '%c'\n", type);
    11111111        mr_free(string);
    11121112        mr_free(token);
     
    12001200    break;
    12011201      default: // error
    1202     log_msg(1, "Row %d should not occur in record!\n", row);
     1202    mr_msg(1, "Row %d should not occur in record!\n", row);
    12031203    break;
    12041204      }
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1080 r1107  
    376376            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
    377377        }
    378         log_msg(1, "Got xattr");
     378        mr_msg(1, "Got xattr");
    379379    }
    380380// acl
     
    396396            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
    397397        }
    398         log_msg(1, "Got acl");
     398        mr_msg(1, "Got acl");
    399399    }
    400400// tarball itself
    401401    res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    402     log_msg(1, "now looking for afioball");
     402    mr_msg(1, "now looking for afioball");
    403403    return (retval);
    404404}
     
    590590
    591591    if (strncmp(tapedev, "/dev/", 5)) {
    592         log_msg(1,
     592        mr_msg(1,
    593593                "Not using 'mt setblk'. This isn't an actual /dev entry.");
    594594        return (0);
     
    933933//    crctt=crc16=0;
    934934            where_I_was_before_tape_change = size;
    935             log_msg(4, "where_I_was_... = %lld",
     935            mr_msg(4, "where_I_was_... = %lld",
    936936                    where_I_was_before_tape_change);
    937937            start_to_read_from_next_tape(bkpinfo);
    938             log_msg(4, "Started reading from next tape.");
     938            mr_msg(4, "Started reading from next tape.");
    939939            skip_incoming_files_until_we_find_this_one(temp_fname);
    940             log_msg(4, "Skipped irrelevant files OK.");
     940            mr_msg(4, "Skipped irrelevant files OK.");
    941941            for (size = orig_size; size > where_I_was_before_tape_change;
    942942                 size -= bytes_to_write) {
     
    944944                    fread(datablock, 1, bytes_to_read, g_tape_stream);
    945945            }
    946             log_msg(4, "'size' is now %lld (should be %lld)", size,
     946            mr_msg(4, "'size' is now %lld (should be %lld)", size,
    947947                    where_I_was_before_tape_change);
    948948            log_to_screen("Successfully re-sync'd tape");
     
    961961#endif
    962962    }
    963     log_msg(6, "Total read from tape for this file = %lld",
     963    mr_msg(6, "Total read from tape for this file = %lld",
    964964            total_read_from_tape_for_this_file);
    965     log_msg(6, ".......................... Should be %lld", orig_size);
     965    mr_msg(6, ".......................... Should be %lld", orig_size);
    966966    g_tape_posK += total_read_from_tape_for_this_file / 1024;
    967967    sprintf(actual_cksum, "%04x%04x", crc16, crctt);
     
    10541054    }
    10551055    tempblock[i] = '\0';
    1056     log_msg(6, "%s (fname=%s, size=%ld K)",
     1056    mr_msg(6, "%s (fname=%s, size=%ld K)",
    10571057            marker_to_string(*pcontrol_char), tempblock + 1000,
    10581058            (long) (*plen) >> 10);
     
    11721172        pB = the_file_I_was_reading;
    11731173    }
    1174     log_msg(1, "skip_incoming_..(%s)", pB);
    1175     log_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");
     1174    mr_msg(1, "skip_incoming_..(%s)", pB);
     1175    mr_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");
    11761176    ctrl_chr = -1;
    11771177    while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
     
    11821182            break;
    11831183        }
    1184         log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
     1184        mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
    11851185        wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
    1186         log_msg(3, "Still trying to re-sync w/ tape");
     1186        mr_msg(3, "Still trying to re-sync w/ tape");
    11871187    }
    11881188    while (ctrl_chr != BLK_START_FILE) {
     
    11931193            break;
    11941194        }
    1195         log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
     1195        mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);
    11961196        wrong_marker(BLK_START_FILE, ctrl_chr);
    1197         log_msg(3, "Still trying to re-sync w/ tape");
     1197        mr_msg(3, "Still trying to re-sync w/ tape");
    11981198    }
    11991199    pA = strrchr(temp_fname, '/');
     
    12101210    }
    12111211    while (strcmp(pA, pB)) {
    1212         log_msg(6, "Skipping %s (it's not %s)", temp_fname,
     1212        mr_msg(6, "Skipping %s (it's not %s)", temp_fname,
    12131213                the_file_I_was_reading);
    12141214        for (size = temp_size; size > 0; size -= bytes_to_write) {
     
    12551255        }
    12561256    }
    1257     log_msg(2, "Reading %s (it matches %s)", temp_fname,
     1257    mr_msg(2, "Reading %s (it matches %s)", temp_fname,
    12581258            the_file_I_was_reading);
    12591259    mr_free(temp_fname);
     
    13031303        wrong_marker(BLK_START_OF_BACKUP, ctrlchr);
    13041304    } else {
    1305         log_msg(3, "Next tape opened OK. Whoopee!");
     1305        mr_msg(3, "Next tape opened OK. Whoopee!");
    13061306    }
    13071307    mr_free(sz_msg);
     
    13811381    char *fname;
    13821382
    1383     log_msg(2, "I am now writing back catalog to tape");
     1383    mr_msg(2, "I am now writing back catalog to tape");
    13841384    malloc_string(fname);
    13851385    last = g_tapecatalog->entries - 1;
     
    13881388                g_tapecatalog->el[i].fname);
    13891389        if (!does_file_exist(fname)) {
    1390             log_msg(6, "Can't write %s - it doesn't exist.", fname);
     1390            mr_msg(6, "Can't write %s - it doesn't exist.", fname);
    13911391        } else {
    13921392            write_header_block_to_stream(length_of_file(fname),
    13931393                                         "start-backcatalog-afio-or-slice",
    13941394                                         BLK_START_AN_AFIO_OR_SLICE);
    1395             log_msg(2, "Writing %s", fname);
     1395            mr_msg(2, "Writing %s", fname);
    13961396            if (write_file_to_stream_from_file(bkpinfo, fname)) {
    13971397                res++;
    1398                 log_msg(2, "%s failed", fname);
     1398                mr_msg(2, "%s failed", fname);
    13991399            }
    14001400            if (i != last) {
     
    14061406    }
    14071407    mr_free(fname);
    1408     log_msg(2, "Finished writing back catalog to tape");
     1408    mr_msg(2, "Finished writing back catalog to tape");
    14091409    return (res);
    14101410}
     
    16461646            marker_to_string(control_char), p,
    16471647            (long) length_of_incoming_file >> 10);
    1648     log_msg(6, tmp);
     1648    mr_msg(6, tmp);
    16491649/*  log_tape_pos(); */
    16501650    return (0);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1095 r1107  
    229229        }
    230230    }
    231 //  log_msg(1, "tmp = '%s'", tmp);
     231//  mr_msg(1, "tmp = '%s'", tmp);
    232232    d = atof(tmp);
    233233#endif
    234     log_msg(1, "g_kernel_version = %f", d);
     234    mr_msg(1, "g_kernel_version = %f", d);
    235235    return (d);
    236236}
     
    430430        1024;
    431431
    432     log_msg(1, "Foo");
     432    mr_msg(1, "Foo");
    433433    if (bkpinfo->backup_media_type == tape) {
    434         log_msg(1, "Bar");
     434        mr_msg(1, "Bar");
    435435        sprintf(tmp, "mt -f %s status", bkpinfo->media_device);
    436         log_msg(1, "tmp = '%s'", tmp);
     436        mr_msg(1, "tmp = '%s'", tmp);
    437437        if (run_program_and_log_output(tmp, 3)) {
    438438            fatal_error
     
    548548            }       
    549549        }
    550         log_msg(2, "call_make_iso (DVD res) is ... %s",
     550        mr_msg(2, "call_make_iso (DVD res) is ... %s",
    551551                bkpinfo->call_make_iso);
    552552    }                           // end of DVD code
     
    791791    int i;
    792792
    793     log_msg(1, "Hi");
     793    mr_msg(1, "Hi");
    794794    assert(bkpinfo != NULL);
    795795    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
     
    11021102    } else if (strstr(value, "/dev/") && strstr(value, "t0")
    11031103               && !strcmp(label, "media-dev")) {
    1104         log_msg(2, "FYI, I shan't read new value for %s - already got %s",
     1104        mr_msg(2, "FYI, I shan't read new value for %s - already got %s",
    11051105                label, value);
    11061106        return (0);
     
    11841184
    11851185    if (!g_autofs_exe[0]) {
    1186         log_msg(3, "No autofs detected.");
     1186        mr_msg(3, "No autofs detected.");
    11871187    } else {
    1188         log_msg(3, "%s --- autofs detected", g_autofs_exe);
     1188        mr_msg(3, "%s --- autofs detected", g_autofs_exe);
    11891189// FIXME -- only disable it if it's running ---  sprintf(tmp, "%s status", autofs_exe);
    11901190        sprintf(tmp, "%s stop", g_autofs_exe);
     
    12061206
    12071207    if (!g_autofs_stopped || !g_autofs_exe[0]) {
    1208         log_msg(3, "No autofs detected.");
     1208        mr_msg(3, "No autofs detected.");
    12091209        return;
    12101210    }
     
    12271227    char command[MAX_STR_LEN];
    12281228
    1229     log_msg(1, "Started sub");
    1230     log_msg(4, "About to set g_boot_mountpt[0] to '\\0'");
     1229    mr_msg(1, "Started sub");
     1230    mr_msg(4, "About to set g_boot_mountpt[0] to '\\0'");
    12311231    g_boot_mountpt[0] = '\0';
    1232     log_msg(4, "Done. Great. Seeting command to something");
     1232    mr_msg(4, "Done. Great. Seeting command to something");
    12331233    strcpy(command,
    12341234           "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    1235     log_msg(4, "Cool. Command = '%s'", command);
     1235    mr_msg(4, "Cool. Command = '%s'", command);
    12361236    strcpy(tmp, call_program_and_get_last_line_of_output(command));
    1237     log_msg(4, "tmp = '%s'", tmp);
     1237    mr_msg(4, "tmp = '%s'", tmp);
    12381238    if (tmp[0]) {
    12391239        log_it("/boot is at %s according to /etc/fstab", tmp);
     
    12411241            if (!run_program_and_log_output("mount /boot", 5)) {
    12421242                strcpy(g_boot_mountpt, "/boot");
    1243                 log_msg(1, "Mounted /boot");
     1243                mr_msg(1, "Mounted /boot");
    12441244            } else {
    12451245                log_it("...ignored cos it's a label :-)");
     
    12471247        } else {
    12481248            sprintf(command, "mount | grep -E '^%s'", tmp);
    1249             log_msg(3, "command = %s", command);
     1249            mr_msg(3, "command = %s", command);
    12501250            if (run_program_and_log_output(command, 5)) {
    12511251                strcpy(g_boot_mountpt, tmp);
     
    12571257                if (run_program_and_log_output(tmp, 5)) {
    12581258                    g_boot_mountpt[0] = '\0';
    1259                     log_msg(1, "Plan B");
     1259                    mr_msg(1, "Plan B");
    12601260                    if (!run_program_and_log_output("mount /boot", 5)) {
    12611261                        strcpy(g_boot_mountpt, "/boot");
    1262                         log_msg(1, "Plan B worked");
     1262                        mr_msg(1, "Plan B worked");
    12631263                    } else {
    1264                         log_msg(1,
     1264                        mr_msg(1,
    12651265                                "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition.");
    12661266                    }
     
    12691269        }
    12701270    }
    1271     log_msg(1, "Ended sub");
     1271    mr_msg(1, "Ended sub");
    12721272}
    12731273
     
    12801280    char tmp[MAX_STR_LEN];
    12811281
    1282     log_msg(3, "starting");
     1282    mr_msg(3, "starting");
    12831283    if (g_boot_mountpt[0]) {
    12841284        sprintf(tmp, "umount %s", g_boot_mountpt);
     
    12871287        }
    12881288    }
    1289     log_msg(3, "leaving");
     1289    mr_msg(3, "leaving");
    12901290}
    12911291
     
    13361336
    13371337/**
    1338  * The standard log_debug_msg() (log_msg() also due to a macro). Writes some describing
     1338 * The standard log_debug_msg() (mr_msg() also due to a macro). Writes some describing
    13391339 * information to the logfile.
    13401340 */
     
    14441444       for(i=0;list_of_arrays[i];i++)
    14451445       {
    1446        log_msg(5, "Allocating %d", i);
     1446       mr_msg(5, "Allocating %d", i);
    14471447       ppcurr = list_of_arrays[i];
    14481448       if (mal)
     
    14561456       }
    14571457       }
    1458        log_msg(5, "Returning");
     1458       mr_msg(5, "Returning");
    14591459     */
    14601460}
     
    14901490           ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99"));
    14911491    if (g_magicdev_command[0]) {
    1492         log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
     1492        mr_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
    14931493        paranoid_system("killall magicdev");
    14941494    }
  • branches/stable/mondo/src/common/libmondo-verify.c

    r1080 r1107  
    7474*/
    7575
    76     log_msg(1, "Now scanning log file for 'afio: ' stuff");
     76    mr_msg(1, "Now scanning log file for 'afio: ' stuff");
    7777    sprintf(command,
    7878            "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
    7979            stderr_fname, afio_found_changes);
    80     log_msg(2, command);
     80    mr_msg(2, command);
    8181    res = system(command);
    8282    if (res) {
    83         log_msg(2, "Warning - failed to think");
    84     }
    85 
    86     log_msg(1, "Now scanning log file for 'star: ' stuff");
     83        mr_msg(2, "Warning - failed to think");
     84    }
     85
     86    mr_msg(1, "Now scanning log file for 'star: ' stuff");
    8787    sprintf(command,
    8888            "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    8989            stderr_fname, afio_found_changes);
    90     log_msg(2, command);
     90    mr_msg(2, command);
    9191    res = system(command);
    9292    if (res) {
    93         log_msg(2, "Warning - failed to think");
     93        mr_msg(2, "Warning - failed to think");
    9494    }
    9595//  exclude_nonexistent_files (afio_found_changes);
     
    9999            ignorefiles_fname, afio_found_changes, afio_found_changes,
    100100            changedfiles_fname);
    101     log_msg(2, command);
     101    mr_msg(2, command);
    102102    paranoid_system(command);
    103103    mr_free(command);
     
    146146    if (g_last_afioball_number != set_number - 1) {
    147147        if (set_number == 0) {
    148             log_msg(1,
     148            mr_msg(1,
    149149                    "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more");
    150150        } 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,
     
    276276// handle slices until end of CD
    277277        if (slice_num == 0) {
    278             log_msg(2, "ISO=%d  bigfile=%ld --START--",
     278            mr_msg(2, "ISO=%d  bigfile=%ld --START--",
    279279                    g_current_media_number, bigfile_num);
    280280            if (!
     
    282282                 fopen(slice_fname(bigfile_num, slice_num, mountpoint, ""),
    283283                       "r"))) {
    284                 log_msg(2, "Cannot open bigfile's info file");
     284                mr_msg(2, "Cannot open bigfile's info file");
    285285            } else {
    286286                if (fread
    287287                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    288288                     fin) < sizeof(biggiestruct)) {
    289                     log_msg(2, "Unable to get biggiestruct");
     289                    mr_msg(2, "Unable to get biggiestruct");
    290290                }
    291291                paranoid_fclose(fin);
     
    293293            sprintf(tmp, "%s/%s", bkpinfo->restore_path,
    294294                    biggiestruct.filename);
    295             log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp);
     295            mr_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp);
    296296            if (!(forig = fopen(tmp, "r"))) {
    297                 log_msg(2, "Failed to open bigfile. Darn.");
     297                mr_msg(2, "Failed to open bigfile. Darn.");
    298298                retval++;
    299299            }
     
    301301        } else if (does_file_exist
    302302                   (slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
    303             log_msg(2, "ISO=%d  bigfile=%ld ---END---",
     303            mr_msg(2, "ISO=%d  bigfile=%ld ---END---",
    304304                    g_current_media_number, bigfile_num);
    305305            bigfile_num++;
     
    307307            slice_num = 0;
    308308        } else {
    309             log_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
     309            mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
    310310                    g_current_media_number, bigfile_num, slice_num);
    311311            if (bkpinfo->compression_level > 0) {
     
    341341                paranoid_pclose(pin);
    342342                if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) {
    343                     log_msg(3,
     343                    mr_msg(3,
    344344                            "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
    345345                            biggiestruct.filename);
    346                     log_msg(3,
     346                    mr_msg(3,
    347347                            "If you really want verification for %s, please contact the devteam and offer an incentive.",
    348348                            biggiestruct.filename);
     
    350350                }
    351351                if (res) {
    352                     log_msg(0,
     352                    mr_msg(0,
    353353                            "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c",
    354354                            biggiestruct.filename);
     
    422422    if (strstr(tarball_fname, ".lzo")
    423423        && strcmp(bkpinfo->zip_suffix, "lzo")) {
    424         log_msg(2, "OK, I'm going to start using lzop.");
     424        mr_msg(2, "OK, I'm going to start using lzop.");
    425425        strcpy(bkpinfo->zip_exe, "lzop");
    426426        strcpy(bkpinfo->zip_suffix, "lzo");
     
    430430    if (strstr(tarball_fname, ".gz")
    431431        && strcmp(bkpinfo->zip_suffix, "gz")) {
    432         log_msg(2, "OK, I'm going to start using gzip.");
     432        mr_msg(2, "OK, I'm going to start using gzip.");
    433433        strcpy(bkpinfo->zip_exe, "gzip");
    434434        strcpy(bkpinfo->zip_suffix, "gz");
     
    438438    if (strstr(tarball_fname, ".bz2")
    439439        && strcmp(bkpinfo->zip_suffix, "bz2")) {
    440         log_msg(2, "OK, I'm going to start using bzip2.");
     440        mr_msg(2, "OK, I'm going to start using bzip2.");
    441441        strcpy(bkpinfo->zip_exe, "bzip2");
    442442        strcpy(bkpinfo->zip_suffix, "bz2");
     
    458458                bkpinfo->zip_exe, tarball_fname, outlog, outlog);
    459459    }
    460     log_msg(6, "command=%s", command);
     460    mr_msg(6, "command=%s", command);
    461461    paranoid_system(command);
    462462    if (length_of_file(outlog) < 10) {
     
    477477                        if (strchr(tmp, '/')) {
    478478                            if (!diffs) {
    479                                 log_msg(0, "'%s' - differences found",
     479                                mr_msg(0, "'%s' - differences found",
    480480                                        tarball_fname);
    481481                            }
    482                             log_msg(0, "star: /%s",
     482                            mr_msg(0, "star: /%s",
    483483                                    strip_afio_output_line(tmp));
    484484                            diffs++;
     
    487487                } else {
    488488                    if (!diffs) {
    489                         log_msg(0, "'%s' - differences found",
     489                        mr_msg(0, "'%s' - differences found",
    490490                                tarball_fname);
    491491                    }
    492                     log_msg(0, "afio: /%s", strip_afio_output_line(tmp));
     492                    mr_msg(0, "afio: /%s", strip_afio_output_line(tmp));
    493493                    diffs++;
    494494                }
     
    533533    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    534534
    535     log_msg(1, "Verifying %s", tarball_fname);
     535    mr_msg(1, "Verifying %s", tarball_fname);
    536536    if (!does_file_exist(tarball_fname)) {
    537537        fatal_error("Cannot verify nonexistent afioball");
     
    589589        sprintf(tmp,
    590590                "Afioball '%s' no longer matches your live filesystem", p);
    591         log_msg(0, tmp);
     591        mr_msg(0, tmp);
    592592        retval++;
    593593    }
     
    664664                                          &ctrl_chr);
    665665        if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
    666             log_msg(2, "test_file = %s", test_file);
     666            mr_msg(2, "test_file = %s", test_file);
    667667            wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
    668668        }
     
    676676            sprintf(tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum,
    677677                    orig_cksum);
    678             log_msg(2, tmp);
     678            mr_msg(2, tmp);
    679679            sprintf(tmp, "%s has changed on live filesystem",
    680680                    biggie_fname);
     
    793793        }
    794794    }
    795     log_msg(1, "All done with afioballs");
     795    mr_msg(1, "All done with afioballs");
    796796    close_progress_form();
    797797    mr_free(tmp);
     
    868868    }
    869869    noof_biggiefiles = (long) size;
    870     log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
     870    mr_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
    871871    open_progress_form("Verifying big files", comment,
    872872                       "Please wait. This may take some time.", "",
     
    960960                "%s not found; assuming you backed up to CD; verifying CD...",
    961961                fname);
    962         log_msg(2, tmp);
     962        mr_msg(2, tmp);
    963963        if (bkpinfo->manual_cd_tray) {
    964964            popup_and_OK("Please push CD tray closed.");
     
    992992        }
    993993    }
    994     log_msg(2, "OK, I've mounted the ISO/CD\n");
     994    mr_msg(2, "OK, I've mounted the ISO/CD\n");
    995995    sprintf(tmp, "%s/archives/NOT-THE-LAST", mountpoint);
    996996    if (!does_file_exist(tmp)) {
    997         log_msg
     997        mr_msg
    998998            (2,
    999999             "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE.");
     
    10241024        retval++;
    10251025    } else {
    1026         log_msg(2, "OK, I've unmounted the ISO file\n");
     1026        mr_msg(2, "OK, I've unmounted the ISO file\n");
    10271027    }
    10281028    if (!does_file_exist(fname)) {
     
    10311031        if (!bkpinfo->please_dont_eject
    10321032            && eject_device(bkpinfo->media_device)) {
    1033             log_msg(2, "Failed to eject CD-ROM drive");
     1033            mr_msg(2, "Failed to eject CD-ROM drive");
    10341034        }
    10351035    }
     
    10631063    assert(bkpinfo != NULL);
    10641064
    1065     log_msg(3, "verify_tape_backups --- starting");
     1065    mr_msg(3, "verify_tape_backups --- starting");
    10661066    log_to_screen("Verifying backups");
    10671067    openin_tape(bkpinfo);
     
    10831083            (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    10841084            changed_files_fname);
    1085     log_msg(2, "Running command to derive list of changed files");
    1086     log_msg(2, tmp);
     1085    mr_msg(2, "Running command to derive list of changed files");
     1086    mr_msg(2, tmp);
    10871087    if (system(tmp)) {
    10881088        if (does_file_exist(changed_files_fname)
     
    11061106                "%ld files differed from live filesystem; type less %s or less %s to see",
    11071107                diffs, changed_files_fname, "/tmp/changed.files");
    1108         log_msg(0, tmp);
     1108        mr_msg(0, tmp);
    11091109        log_to_screen
    11101110            ("See /tmp/changed.files for a list of nonmatching files.");
  • branches/stable/mondo/src/common/newt-specific.c

    r1103 r1107  
    213213        usleep(500000);
    214214        if (g_text_mode) {
    215             log_msg(2, "Closing evalcall form");
     215            mr_msg(2, "Closing evalcall form");
    216216            return;
    217217        }
     
    233233        }
    234234        if (g_current_progress == -999) {
    235             log_msg(2,
     235            mr_msg(2,
    236236                    "Trying to close the progress form when it ain't open!");
    237237            return;
     
    241241        sleep(1);
    242242        if (g_text_mode) {
    243             log_msg(2, "Closing progress form");
     243            mr_msg(2, "Closing progress form");
    244244            return;
    245245        }
     
    285285        set_signals(FALSE);     // link to external func
    286286        g_exiting = TRUE;
    287         log_msg(1, "Fatal error received - '%s'", error_string);
     287        mr_msg(1, "Fatal error received - '%s'", error_string);
    288288        printf("Fatal error... %s\n", error_string);
    289289        if (getpid() == g_mastermind_pid) {
    290             log_msg(2, "mastermind %d is exiting", (int) getpid());
     290            mr_msg(2, "mastermind %d is exiting", (int) getpid());
    291291            kill(g_main_pid, SIGTERM);
    292292            mr_free(tmp);
     
    296296        if (getpid() != g_main_pid) {
    297297            if (g_mastermind_pid != 0 && getpid() != g_mastermind_pid) {
    298                 log_msg(2, "non-m/m %d is exiting", (int) getpid());
     298                mr_msg(2, "non-m/m %d is exiting", (int) getpid());
    299299                kill(g_main_pid, SIGTERM);
    300300                mr_free(tmp);
     
    303303        }
    304304
    305         log_msg(3, "OK, I think I'm the main PID.");
     305        mr_msg(3, "OK, I think I'm the main PID.");
    306306        if (already_exiting) {
    307             log_msg(3, "...I'm already exiting. Give me time, Julian!");
     307            mr_msg(3, "...I'm already exiting. Give me time, Julian!");
    308308            mr_free(tmp);
    309309            finish(1);
     
    311311
    312312        already_exiting = TRUE;
    313         log_msg(2, "I'm going to do some cleaning up now.");
     313        mr_msg(2, "I'm going to do some cleaning up now.");
    314314        paranoid_system("killall mindi 2> /dev/null");
    315315        kill_anything_like_this("/mondo/do-not");
     
    320320        chdir("/");
    321321        for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) {
    322             log_msg(2, "Waiting for child processes to terminate");
     322            mr_msg(2, "Waiting for child processes to terminate");
    323323            sleep(1);
    324324            run_program_and_log_output(tmp, 5);
     
    337337
    338338        if (!g_text_mode) {
    339             log_msg(0, fatalstr);
    340             log_msg(0, error_string);
     339            mr_msg(0, fatalstr);
     340            mr_msg(0, error_string);
    341341            //      popup_and_OK (error_string);
    342342            newtFinished();
     
    359359        register_pid(0, "mondo");   // finish() does this too, FYI
    360360        if (!g_main_pid) {
    361             log_msg(3, "FYI - g_main_pid is blank");
     361            mr_msg(3, "FYI - g_main_pid is blank");
    362362        }
    363363        mr_free(tmp);
     
    402402        if (!g_text_mode) {
    403403            if (does_file_exist("/THIS-IS-A-RAMDISK")) {
    404                 log_msg(1, "Calling newtFinished()");
     404                mr_msg(1, "Calling newtFinished()");
    405405                newtFinished();
    406406            } else {
    407                 log_msg(1, "Calling newtSuspend()");
     407                mr_msg(1, "Calling newtSuspend()");
    408408                newtSuspend();
    409409            }
     
    504504        va_start(args, fmt);
    505505        vsprintf(output, fmt, args);
    506         log_msg(0, output);
     506        mr_msg(0, output);
    507507        output[80] = '\0';
    508508        va_end(args);
     
    549549     mvaddstr_and_log_it(int y, int x, char *output) {
    550550        assert_string_is_neither_NULL_nor_zerolength(output);
    551         log_msg(0, output);
     551        mr_msg(0, output);
    552552        if (g_text_mode) {
    553553            printf("%s\n", output);
     
    583583//  center_string (title, 80);
    584584        if (g_text_mode) {
    585             log_msg(0, title);
     585            mr_msg(0, title);
    586586        } else {
    587587            strcpy(tmp, title);
     
    592592        g_isoform_starttime = get_time();
    593593        if (g_text_mode) {
    594             log_msg(0, g_isoform_header_str);
     594            mr_msg(0, g_isoform_header_str);
    595595        } else {
    596596            g_isoform_header = newtLabel(1, 1, g_isoform_header_str);
     
    661661        strcpy(g_blurb_str_3, blurb2);
    662662        if (g_text_mode) {
    663             log_msg(0, blurb1);
    664             log_msg(0, blurb2);
    665             log_msg(0, blurb3);
     663            mr_msg(0, blurb1);
     664            mr_msg(0, blurb2);
     665            mr_msg(0, blurb3);
    666666        } else {
    667667            g_blurb1 = newtLabel(2, 1, blurb1);
     
    697697        assert_string_is_neither_NULL_nor_zerolength(prompt);
    698698
    699         log_msg(0, prompt);
     699        mr_msg(0, prompt);
    700700        if (g_text_mode) {
    701701            printf
     
    11041104        char *tmp;
    11051105
    1106 //  log_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);
     1106//  mr_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);
    11071107        percentline_str = mr_malloc(MAX_NEWT_COMMENT_LEN);
    11081108        timeline_str = mr_malloc(MAX_NEWT_COMMENT_LEN);
     
    11281128                        blurb1, blurb2, blurb3, g_current_progress,
    11291129                        g_maximum_progress);
    1130                 log_msg(0, tmp);
     1130                mr_msg(0, tmp);
    11311131                g_current_progress = g_maximum_progress;
    11321132            }
     
    11691169            }
    11701170            if (percentage > 100) {
    1171                 log_msg(2, "percentage = %d", percentage);
     1171                mr_msg(2, "percentage = %d", percentage);
    11721172            }
    11731173            sprintf(taskprogress + strlen(taskprogress),
     
    14021402        if (!(fin = fopen(source_file, "r"))) {
    14031403            log_OS_error(source_file);
    1404             log_msg(2, "Can't open %s; therefore, cannot popup list",
     1404            mr_msg(2, "Can't open %s; therefore, cannot popup list",
    14051405                    source_file);
    14061406            mr_free(tmp);
    14071407            return (1);
    14081408        }
    1409         log_msg(2, "Loading %s", source_file);
     1409        mr_msg(2, "Loading %s", source_file);
    14101410        for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM;
    14111411             filelist->entries++) {
     
    14591459                           (void *) &dummy_fle,
    14601460                           sizeof(struct s_filelist_entry));
    1461                     log_msg(2, "Swapping %s and %s",
     1461                    mr_msg(2, "Swapping %s and %s",
    14621462                            filelist->el[i].filename,
    14631463                            filelist->el[i + 1].filename);
     
    15441544        assert_string_is_neither_NULL_nor_zerolength(source_file);
    15451545        if (g_text_mode) {
    1546             log_msg(2, "Text mode. Therefore, no popup list.");
     1546            mr_msg(2, "Text mode. Therefore, no popup list.");
    15471547            goto free_to_go;
    15481548        }
    1549         log_msg(2, "Examining file %s", source_file);
     1549        mr_msg(2, "Examining file %s", source_file);
    15501550
    15511551        lng = count_lines_in_file(source_file);
    15521552        if (lng < 1) {
    1553             log_msg(2, "No lines in file. Therefore, no popup list.");
     1553            mr_msg(2, "No lines in file. Therefore, no popup list.");
    15541554            mr_free(reason);
    15551555            goto free_to_go;
    15561556        } else if (lng >= ARBITRARY_MAXIMUM) {
    1557             log_msg(2, "Too many files differ for me to list.");
     1557            mr_msg(2, "Too many files differ for me to list.");
    15581558            goto free_to_go;
    15591559        }
     
    15651565
    15661566        if (load_filelist_into_array(filelist, source_file)) {
    1567             log_msg(2, "Can't open %s; therefore, cannot popup list",
     1567            mr_msg(2, "Can't open %s; therefore, cannot popup list",
    15681568                    source_file);
    15691569            mr_free(reason);
    15701570            return;
    15711571        }
    1572         log_msg(2, "%d files loaded into filelist array",
     1572        mr_msg(2, "%d files loaded into filelist array",
    15731573                filelist->entries);
    15741574        for (i = 0; i < filelist->entries; i++) {
Note: See TracChangeset for help on using the changeset viewer.