Changeset 1086 in MondoRescue
- Timestamp:
- Feb 2, 2007, 11:21:27 PM (18 years ago)
- Location:
- trunk/mondo/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/libmondo-archive.c
r1081 r1086 142 142 143 143 if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) { 144 log_msg(3, "Failed to delete semaphore");144 mr_msg(3, "Failed to delete semaphore"); 145 145 } 146 146 } … … 159 159 sem_b.sem_flg = SEM_UNDO; 160 160 if (semop(g_sem_id, &sem_b, 1) == -1) { 161 log_msg(3, "semaphore_p failed");161 mr_msg(3, "semaphore_p failed"); 162 162 return (0); 163 163 } … … 177 177 sem_b.sem_flg = SEM_UNDO; 178 178 if (semop(g_sem_id, &sem_b, 1) == -1) { 179 log_msg(3, "semaphore_v failed");179 mr_msg(3, "semaphore_v failed"); 180 180 return (0); 181 181 } … … 237 237 mr_free(command); 238 238 command = tmp; 239 log_msg(4, "command = '%s'", command);239 mr_msg(4, "command = '%s'", command); 240 240 241 241 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 242 log_msg(5, "command='%s'", command);242 mr_msg(5, "command='%s'", command); 243 243 res = system(command); 244 244 tmp = last_line_of_file(MONDO_LOGFILE); 245 log_msg(1, "res=%d; tmp='%s'", res, tmp);245 mr_msg(1, "res=%d; tmp='%s'", res, tmp); 246 246 if (bkpinfo->use_star && (res == 254 || res == 65024) 247 247 && strstr(tmp, "star: Processed all possible files") 248 248 && tries > 0) { 249 log_msg(1, "Star returned nonfatal error");249 mr_msg(1, "Star returned nonfatal error"); 250 250 res = 0; 251 251 } … … 256 256 if (p) { 257 257 p[0] = p[1] = p[2] = p[3] = ' '; 258 log_msg(1, "new command = '%s'", command);258 mr_msg(1, "new command = '%s'", command); 259 259 } else { 260 log_msg(3,260 mr_msg(3, 261 261 "Attempt #%d failed. Pausing 3 seconds and retrying...", 262 262 tries + 1); … … 269 269 retval += res; 270 270 if (retval) { 271 log_msg(3, "Failed to write set %d", setno);271 mr_msg(3, "Failed to write set %d", setno); 272 272 } else if (tries > 1) { 273 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,273 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 274 274 tries); 275 275 } … … 348 348 } else { 349 349 mr_asprintf(&zipparams, " "); 350 log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);350 mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp); 351 351 } 352 352 mr_free(tmp); … … 381 381 382 382 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 383 log_msg(5, "command='%s'", command);383 mr_msg(5, "command='%s'", command); 384 384 res = system(command); 385 385 if (res) { 386 386 log_OS_error(command); 387 log_msg(3,387 mr_msg(3, 388 388 "Attempt #%d failed. Pausing 3 seconds and retrying...", 389 389 tries + 1); … … 395 395 retval += res; 396 396 if (retval) { 397 log_msg(3, "Failed to write set %d", setno);397 mr_msg(3, "Failed to write set %d", setno); 398 398 } else if (tries > 1) { 399 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,399 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 400 400 tries); 401 401 } … … 410 410 if (free_ramdisk_space > i) { 411 411 free_ramdisk_space = i; 412 log_msg(2, "min(free_ramdisk_space) is now %d",412 mr_msg(2, "min(free_ramdisk_space) is now %d", 413 413 free_ramdisk_space); 414 414 if (free_ramdisk_space < 10) { … … 507 507 retval += make_those_slices_phase(bkpinfo); // backup BIG files 508 508 retval += do_that_final_phase(bkpinfo); // clean up 509 log_msg(1, "Creation of archives... complete.");509 mr_msg(1, "Creation of archives... complete."); 510 510 if (bkpinfo->verify_data) { 511 511 sleep(2); … … 581 581 mr_free(tmp); 582 582 mr_asprintf(&tmp, "devs_to_exclude = '%s'", devs_to_exclude); 583 log_msg(2, tmp);583 mr_msg(2, tmp); 584 584 mr_free(tmp); 585 585 mvaddstr_and_log_it(g_currentY, 0, … … 673 673 mr_asprintf(&tmp, "User specified boot loader. It is '%c'.", 674 674 bkpinfo->boot_loader); 675 log_msg(2, tmp);675 mr_msg(2, tmp); 676 676 mr_free(tmp); 677 677 } else { … … 681 681 mr_asprintf(&tmp, "User specified boot device. It is '%s'.", 682 682 bkpinfo->boot_device); 683 log_msg(2, tmp);683 mr_msg(2, tmp); 684 684 mr_free(tmp); 685 685 mr_free(bootdev); … … 759 759 mr_asprintf(&tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); 760 760 if (write_one_liner_data_file(tmp, bkpinfo->boot_device)) { 761 log_msg(1, "%ld: Unable to write one-liner boot device", __LINE__);761 mr_msg(1, "%ld: Unable to write one-liner boot device", __LINE__); 762 762 } 763 763 mr_free(tmp); … … 797 797 if (write_one_liner_data_file(tmp, value)) { 798 798 res++; 799 log_msg(1, "%ld: Unable to write one-liner backup-media-type",799 mr_msg(1, "%ld: Unable to write one-liner backup-media-type", 800 800 __LINE__); 801 801 } … … 806 806 if (write_one_liner_data_file(tmp, bootldr_str)) { 807 807 res++; 808 log_msg(1, "%ld: Unable to write one-liner bootloader.name",808 mr_msg(1, "%ld: Unable to write one-liner bootloader.name", 809 809 __LINE__); 810 810 } … … 822 822 mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir); 823 823 if (write_one_liner_data_file(tmp1, "TRUE")) { 824 log_msg(1, "%ld: Unable to write one-liner XATTR",824 mr_msg(1, "%ld: Unable to write one-liner XATTR", 825 825 __LINE__); 826 826 } … … 830 830 mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir); 831 831 if (write_one_liner_data_file(tmp1, "TRUE")) { 832 log_msg(1, "%ld: Unable to write one-liner ACL",832 mr_msg(1, "%ld: Unable to write one-liner ACL", 833 833 __LINE__); 834 834 } … … 857 857 mr_free(tmp); 858 858 859 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);859 mr_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 860 860 861 861 if (bkpinfo->backup_media_type == usb) { … … 911 911 mr_free(tmp2); 912 912 913 log_msg(2, command);913 mr_msg(2, command); 914 914 915 915 // popup_and_OK("Pausing"); … … 924 924 log_to_screen("Boot+data disks were created OK"); 925 925 mr_asprintf(&command, "mkdir -p /var/cache/mindi/"); 926 log_msg(2, command);926 mr_msg(2, command); 927 927 run_program_and_log_output(command, FALSE); 928 928 mr_free(command); … … 931 931 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso", 932 932 bkpinfo->scratchdir); 933 log_msg(2, command);933 mr_msg(2, command); 934 934 run_program_and_log_output(command, FALSE); 935 935 mr_free(command); … … 945 945 mr_asprintf(&command, "cp -f %s/mindi-*oot*.img %s/images", 946 946 bkpinfo->tmpdir, bkpinfo->scratchdir); 947 log_msg(2, command);947 mr_msg(2, command); 948 948 run_program_and_log_output(command, FALSE); 949 949 mr_free(command); … … 1047 1047 } 1048 1048 if (!semaphore_p()) { 1049 log_msg(3, "P sem failed (pid=%d)", (int) getpid());1049 mr_msg(3, "P sem failed (pid=%d)", (int) getpid()); 1050 1050 fatal_error("Cannot get semaphore P"); 1051 1051 } … … 1064 1064 bkpinfo->tmpdir, archiving_set_no); 1065 1065 if (!does_file_exist(archiving_filelist_fname)) { 1066 log_msg(3,1066 mr_msg(3, 1067 1067 "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.", 1068 1068 FORTY_SPACES, getpid(), this_thread_no, … … 1076 1076 archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix); 1077 1077 if (does_file_exist(tmp)) { 1078 log_msg(4, "%s[%d:%d] - waiting for storer",1078 mr_msg(4, "%s[%d:%d] - waiting for storer", 1079 1079 FORTY_SPACES, getpid(), this_thread_no); 1080 1080 while (does_file_exist(tmp)) { 1081 1081 sleep(1); 1082 1082 } 1083 log_msg(4, "[%d] - continuing", getpid());1083 mr_msg(4, "[%d] - continuing", getpid()); 1084 1084 } 1085 1085 mr_free(tmp); 1086 1086 1087 log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),1087 mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(), 1088 1088 this_thread_no, archiving_set_no); 1089 1089 if (g_getfattr) { … … 1100 1100 } 1101 1101 1102 log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),1102 mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(), 1103 1103 this_thread_no, archiving_set_no); 1104 1104 res = archive_this_fileset(bkpinfo, archiving_filelist_fname, … … 1129 1129 fatal_error("Cannot get semaphore V"); 1130 1130 } 1131 log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),1131 mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(), 1132 1132 this_thread_no, archiving_set_no); 1133 1133 archiving_set_no++; … … 1142 1142 fatal_error("Cannot get semaphore V"); 1143 1143 } 1144 log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),1144 mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(), 1145 1145 this_thread_no); 1146 1146 mr_free(archiving_filelist_fname); … … 1171 1171 "Writing any remaining data to media "); 1172 1172 1173 log_msg(1, "Closing tape/CD ... ");1173 mr_msg(1, "Closing tape/CD ... "); 1174 1174 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1175 1175 /* write tape/cdstream */ … … 1180 1180 retval += res; 1181 1181 if (res) { 1182 log_msg(1, "write_final_iso_if_necessary returned an error");1183 } 1184 } 1185 log_msg(2, "Fork is exiting ... ");1182 mr_msg(1, "write_final_iso_if_necessary returned an error"); 1183 } 1184 } 1185 mr_msg(2, "Fork is exiting ... "); 1186 1186 1187 1187 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 1234 1234 mr_free(g_serial_string); 1235 1235 g_serial_string = tmp; 1236 log_msg(2, "g_serial_string = '%s'", g_serial_string);1236 mr_msg(2, "g_serial_string = '%s'", g_serial_string); 1237 1237 1238 1238 mr_asprintf(&tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir); 1239 1239 if (write_one_liner_data_file(tmpfile, g_serial_string)) { 1240 log_msg(1, "%ld: Failed to write serial string", __LINE__);1240 mr_msg(1, "%ld: Failed to write serial string", __LINE__); 1241 1241 } 1242 1242 mr_free(g_serial_string); … … 1253 1253 fatal_error("Cannot open backup (streaming) device"); 1254 1254 } 1255 log_msg(1, "Backup (stream) opened OK");1255 mr_msg(1, "Backup (stream) opened OK"); 1256 1256 write_data_disks_to_stream(data_disks_file); 1257 1257 } else { 1258 log_msg(1, "Backing up to CD's");1258 mr_msg(1, "Backing up to CD's"); 1259 1259 } 1260 1260 mr_free(data_disks_file); … … 1324 1324 mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, 1325 1325 tempfile, tempfile); 1326 log_msg(3, command);1326 mr_msg(3, command); 1327 1327 open_evalcall_form(title); 1328 1328 if (!(pin = popen(command, "r"))) { … … 1340 1340 trackno = get_trackno_from_logfile(tempfile); 1341 1341 if (trackno < 0 || trackno > 80) { 1342 log_msg(1, "Weird track#");1342 mr_msg(1, "Weird track#"); 1343 1343 continue; 1344 1344 } … … 1481 1481 int misc_counter_that_is_not_important = 0; 1482 1482 1483 log_msg(8, "here");1483 mr_msg(8, "here"); 1484 1484 assert(bkpinfo != NULL); 1485 1485 /* BERLIOS: To be removed */ … … 1501 1501 *p_next_set_to_archive = 0; 1502 1502 log_to_screen("Archiving regular files"); 1503 log_msg(5, "Go, Shorty. It's your birthday.");1503 mr_msg(5, "Go, Shorty. It's your birthday."); 1504 1504 open_progress_form(_("Backing up filesystem"), 1505 1505 _("I am backing up your live filesystem now."), … … 1508 1508 get_last_filelist_number(bkpinfo) + 1); 1509 1509 1510 log_msg(5, "We're gonna party like it's your birthday.");1510 mr_msg(5, "We're gonna party like it's your birthday."); 1511 1511 1512 1512 srand((unsigned int) getpid()); … … 1521 1521 } // initialize semaphore 1522 1522 for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) { 1523 log_msg(8, "Creating thread #%d", noof_threads);1523 mr_msg(8, "Creating thread #%d", noof_threads); 1524 1524 (*p_archival_threads_running)++; 1525 1525 if ((res = … … 1531 1531 } 1532 1532 1533 log_msg(8, "About to enter while() loop");1533 mr_msg(8, "About to enter while() loop"); 1534 1534 while (!done_storing) { 1535 1535 if (g_exiting) { … … 1538 1538 if (*p_archival_threads_running == 0 1539 1539 && *p_last_set_archived == storing_set_no - 1) { 1540 log_msg(2,1540 mr_msg(2, 1541 1541 "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... :-)", 1542 1542 *p_last_set_archived, storing_set_no); … … 1572 1572 } 1573 1573 1574 log_msg(2, "Storing set %d", storing_set_no);1574 mr_msg(2, "Storing set %d", storing_set_no); 1575 1575 while (!does_file_exist(storing_filelist_fname) 1576 1576 || !does_file_exist(storing_afioball_fname)) { 1577 log_msg(2,1577 mr_msg(2, 1578 1578 "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.", 1579 1579 storing_filelist_fname, storing_afioball_fname); … … 1644 1644 close_progress_form(); 1645 1645 1646 log_msg(2, "Joining background threads to foreground thread");1646 mr_msg(2, "Joining background threads to foreground thread"); 1647 1647 for (i = 0; i < noof_threads; i++) { 1648 1648 pthread_join(archival_thread[i], pvp); 1649 log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);1649 mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads); 1650 1650 } 1651 1651 del_semvalue(); 1652 log_msg(2, "Done.");1652 mr_msg(2, "Done."); 1653 1653 if (retval) { 1654 1654 mr_asprintf(&tmp, … … 1734 1734 } 1735 1735 1736 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",1736 mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", 1737 1737 bkpinfo->scratchdir, destfile); 1738 1738 /* BERLIOS: Do not ignore getcwd result */ … … 1759 1759 1760 1760 if (bkpinfo->call_make_iso != NULL) { 1761 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);1761 mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1762 1762 mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1763 1763 mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)", … … 1808 1808 mr_asprintf(&sz_blank_disk, "dvd+rw-format -force %s", 1809 1809 bkpinfo->media_device); 1810 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);1810 mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk); 1811 1811 res = run_external_binary_with_percentage_indicator_NEW 1812 1812 ("Blanking DVD disk", sz_blank_disk); … … 1862 1862 bkpinfo->backup_media_string, 1863 1863 g_current_media_number); 1864 log_msg(1, message_to_screen);1864 mr_msg(1, message_to_screen); 1865 1865 mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1866 1866 bkpinfo->backup_media_string, 1867 1867 g_current_media_number); 1868 1868 if (bkpinfo->nonbootable_backup) { 1869 log_msg(1, "Making nonbootable backup");1869 mr_msg(1, "Making nonbootable backup"); 1870 1870 // FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end 1871 1871 res = eval_call_to_make_ISO(bkpinfo, … … 1874 1874 MONDO_LOGFILE, message_to_screen); 1875 1875 } else { 1876 log_msg(1, "Making bootable backup");1876 mr_msg(1, "Making bootable backup"); 1877 1877 1878 1878 #ifdef __FreeBSD__ … … 1881 1881 1882 1882 1883 log_msg(1, "make_cd_use_lilo is actually %d",1883 mr_msg(1, "make_cd_use_lilo is actually %d", 1884 1884 bkpinfo->make_cd_use_lilo); 1885 1885 if (bkpinfo->make_cd_use_lilo) { 1886 log_msg(1, "make_cd_use_lilo = TRUE");1886 mr_msg(1, "make_cd_use_lilo = TRUE"); 1887 1887 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo 1888 1888 // and add ' .' at end 1889 1889 #ifdef __IA64__ 1890 log_msg(1, "IA64 --> elilo");1890 mr_msg(1, "IA64 --> elilo"); 1891 1891 mr_asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size); 1892 1892 res = eval_call_to_make_ISO(bkpinfo, … … 1900 1900 // and add ' .' at end 1901 1901 mr_free(tmp2); 1902 log_msg(1, "Non-ia64 --> lilo");1902 mr_msg(1, "Non-ia64 --> lilo"); 1903 1903 res = eval_call_to_make_ISO(bkpinfo, 1904 1904 "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", … … 1909 1909 #endif 1910 1910 } else { 1911 log_msg(1, "make_cd_use_lilo = FALSE");1912 log_msg(1, "Isolinux");1911 mr_msg(1, "make_cd_use_lilo = FALSE"); 1912 mr_msg(1, "Isolinux"); 1913 1913 res = eval_call_to_make_ISO(bkpinfo, 1914 1914 "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", … … 1932 1932 || bkpinfo->backup_media_type == cdrw) { 1933 1933 if (is_this_device_mounted(bkpinfo->media_device)) { 1934 log_msg(2,1934 mr_msg(2, 1935 1935 "Warning - %s mounted. I'm unmounting it before I burn to it.", 1936 1936 bkpinfo->media_device); … … 1942 1942 1943 1943 if (bkpinfo->call_burn_iso != NULL) { 1944 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);1944 mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1945 1945 mr_asprintf(&message_to_screen, "Burning %s #%d", 1946 1946 bkpinfo->backup_media_string, … … 1977 1977 chdir(old_pwd); 1978 1978 if (retval) { 1979 log_msg(1, "WARNING - make_iso_fs returned an error");1979 mr_msg(1, "WARNING - make_iso_fs returned an error"); 1980 1980 } 1981 1981 mr_free(old_pwd); … … 1992 1992 "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", 1993 1993 bigfile_fname); 1994 log_msg(1, "command = '%s'", command);1994 mr_msg(1, "command = '%s'", command); 1995 1995 tmp = call_program_and_get_last_line_of_output(command); 1996 log_msg(1, "--> tmp = '%s'", tmp);1996 mr_msg(1, "--> tmp = '%s'", tmp); 1997 1997 mr_free(command); 1998 1998 if (strstr(tmp, "NTFS")) { … … 2055 2055 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 2056 2056 2057 log_msg(1, "size of all biggiefiles = %ld",2057 mr_msg(1, "size of all biggiefiles = %ld", 2058 2058 size_of_all_biggiefiles_K(bkpinfo)); 2059 log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",2059 mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld", 2060 2060 size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size, 2061 2061 estimated_total_noof_slices); 2062 2062 2063 2063 if (length_of_file(biggielist_fname) < 6) { 2064 log_msg(1, "No biggiefiles; fair enough...");2064 mr_msg(1, "No biggiefiles; fair enough..."); 2065 2065 return (0); 2066 2066 } … … 2095 2095 // Call ntfsclone (formerly partimagehack) if it's a /dev entry 2096 2096 // (i.e. a partition to be imaged) 2097 log_msg(2, "bigfile_fname = %s", bigfile_fname);2097 mr_msg(2, "bigfile_fname = %s", bigfile_fname); 2098 2098 use_ntfsprog = FALSE; 2099 2099 if (!strncmp(bigfile_fname, "/dev/", 5) 2100 2100 && is_dev_an_NTFS_dev(bigfile_fname)) { 2101 2101 use_ntfsprog = TRUE; 2102 log_msg(2,2102 mr_msg(2, 2103 2103 "Calling ntfsclone in background because %s is an NTFS partition", 2104 2104 bigfile_fname); … … 2113 2113 fatal_error("Fork failure"); 2114 2114 case 0: 2115 log_msg(2,2115 mr_msg(2, 2116 2116 "CHILD - fip - calling feed_into_ntfsprog(%s, %s)", 2117 2117 bigfile_fname, sz_devfile); … … 2120 2120 break; 2121 2121 default: 2122 log_msg(2,2122 mr_msg(2, 2123 2123 "feed_into_ntfsprog() called in background --- pid=%ld", 2124 2124 (long int) (pid)); … … 2133 2133 2134 2134 // Whether partition or biggiefile, just do your thang :-) 2135 log_msg(2, "Bigfile #%ld is '%s' (%ld KB)",2135 mr_msg(2, "Bigfile #%ld is '%s' (%ld KB)", 2136 2136 biggie_file_number + 1, bigfile_fname, 2137 2137 (long) biggie_fsize >> 10); … … 2180 2180 paranoid_fclose(fin); 2181 2181 2182 log_msg(1, "Finished backing up bigfiles");2183 log_msg(1, "estimated slices = %ld; actual slices = %ld",2182 mr_msg(1, "Finished backing up bigfiles"); 2183 mr_msg(1, "estimated slices = %ld; actual slices = %ld", 2184 2184 estimated_total_noof_slices, g_current_progress); 2185 2185 close_progress_form(); … … 2229 2229 bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix); 2230 2230 2231 log_msg(1, "EXAT'g set %ld", curr_set_no);2231 mr_msg(1, "EXAT'g set %ld", curr_set_no); 2232 2232 if (g_getfattr) { 2233 2233 mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, … … 2241 2241 } 2242 2242 2243 log_msg(1, "Archiving set %ld", curr_set_no);2243 mr_msg(1, "Archiving set %ld", curr_set_no); 2244 2244 res = archive_this_fileset(bkpinfo, curr_filelist_fname, 2245 2245 curr_afioball_fname, curr_set_no); … … 2349 2349 BLK_START_AFIOBALLS); 2350 2350 #if __FreeBSD__ == 5 2351 log_msg(1,2351 mr_msg(1, 2352 2352 "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0"); 2353 2353 res = make_afioballs_and_images_OLD(bkpinfo); … … 2364 2364 if (res) { 2365 2365 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2366 log_msg(1, "make_afioballs_and_images returned an error");2366 mr_msg(1, "make_afioballs_and_images returned an error"); 2367 2367 } else { 2368 2368 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 2413 2413 2414 2414 mr_asprintf(&blah, "biggielist = %s", biggielist); 2415 log_msg(2, blah);2415 mr_msg(2, blah); 2416 2416 mr_free(blah); 2417 2417 2418 2418 if (!does_file_exist(biggielist)) { 2419 log_msg(1, "BTW, the biggielist does not exist");2419 mr_msg(1, "BTW, the biggielist does not exist"); 2420 2420 } 2421 2421 … … 2457 2457 retval += res; 2458 2458 if (res) { 2459 log_msg(1, "make_slices_and_images returned an error");2459 mr_msg(1, "make_slices_and_images returned an error"); 2460 2460 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2461 2461 } else { … … 2519 2519 mr_asprintf(&curr_file, "%s", cf); 2520 2520 if (!does_file_exist(curr_file)) { 2521 log_msg(1,2521 mr_msg(1, 2522 2522 "Warning - you're trying to add a non-existent file - '%s' to the CD", 2523 2523 curr_file); 2524 2524 } else { 2525 log_msg(8, "Trying to add file %s to CD", curr_file);2525 mr_msg(8, "Trying to add file %s to CD", curr_file); 2526 2526 would_occupy += length_of_file(curr_file) / 1024; 2527 2527 } … … 2538 2538 retval += res; 2539 2539 if (res) { 2540 log_msg(1, "WARNING - write_iso_and_go_on returned an error");2540 mr_msg(1, "WARNING - write_iso_and_go_on returned an error"); 2541 2541 } 2542 2542 } … … 2554 2554 retval += res; 2555 2555 if (res) { 2556 log_msg(1, "(move_files_to_cd) '%s' failed", tmp);2556 mr_msg(1, "(move_files_to_cd) '%s' failed", tmp); 2557 2557 } else { 2558 log_msg(8, "Moved %s to CD OK", tmp);2558 mr_msg(8, "Moved %s to CD OK", tmp); 2559 2559 } 2560 2560 mr_free(tmp); … … 2565 2565 2566 2566 if (retval) { 2567 log_msg(1,2567 mr_msg(1, 2568 2568 "Warning - errors occurred while I was adding files to CD dir"); 2569 2569 } … … 2621 2621 mr_asprintf(&bootdisk_dev, "/dev/fd0H1722"); 2622 2622 } else { 2623 log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");2623 mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*"); 2624 2624 mr_asprintf(&bootdisk_dev, DEFAULT_1722MB_DISK); 2625 2625 } 2626 2626 mr_asprintf(&datadisk_dev, "%s", "/dev/fd0"); 2627 2627 if (!does_device_exist(datadisk_dev)) { 2628 log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");2628 mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*"); 2629 2629 mr_free(datadisk_dev); 2630 2630 mr_asprintf(&datadisk_dev, "%s", "/dev/fd0"); … … 2686 2686 } 2687 2687 mr_asprintf(&tmp, "cat %s > %s", rootdisk_file, datadisk_dev); 2688 log_msg(1, "tmp = '%s'", tmp);2688 mr_msg(1, "tmp = '%s'", tmp); 2689 2689 res += 2690 2690 run_external_binary_with_percentage_indicator_NEW … … 2707 2707 for (i = 1; i < 99; i++) { 2708 2708 mr_asprintf(&tmp, "%s/mindi-data-%d.img", imagesdir, i); 2709 log_msg(3, tmp);2709 mr_msg(3, tmp); 2710 2710 if (!does_file_exist(tmp)) { 2711 log_msg(3, "...not found");2711 mr_msg(3, "...not found"); 2712 2712 break; 2713 2713 } … … 2830 2830 mr_asprintf(&curr_file, "%s", cf); 2831 2831 if (!does_file_exist(curr_file)) { 2832 log_msg(1,2832 mr_msg(1, 2833 2833 "Warning - you're trying to add a non-existent file - '%s' to the tape", 2834 2834 curr_file); … … 2858 2858 2859 2859 if (retval) { 2860 log_msg(1,2860 mr_msg(1, 2861 2861 "Warning - errors occurred while I was adding file to tape"); 2862 2862 } … … 2890 2890 } else { 2891 2891 mr_asprintf(&cdrecord, " "); 2892 log_msg(2, "Found no cdrecord nor dvdrecord in path.");2892 mr_msg(2, "Found no cdrecord nor dvdrecord in path."); 2893 2893 } 2894 2894 if (cdrecord[0]) { … … 2944 2944 if (cdrom_dev != NULL) { 2945 2945 /* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird 2946 log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );2946 mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" ); 2947 2947 retract_CD_tray_and_defeat_autorun(); 2948 2948 */ … … 2957 2957 if ((attempt_to_mount_returned_this = 2958 2958 run_program_and_log_output(tmp, 1))) { 2959 log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);2959 mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt); 2960 2960 log_to_screen("If there's a CD/DVD in the drive, it's blank."); 2961 2961 mr_asprintf(&our_serial_str, "%s", ""); … … 2984 2984 mr_free(szunmount); 2985 2985 2986 log_msg(2, "paafcd: cd_number = %d", cd_number);2987 log_msg(2, "our serial str = %s; g_serial_string = %s",2986 mr_msg(2, "paafcd: cd_number = %d", cd_number); 2987 mr_msg(2, "our serial str = %s; g_serial_string = %s", 2988 2988 our_serial_str, g_serial_string); 2989 2989 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 2990 log_msg(2, "This %s is part of this backup set!",2990 mr_msg(2, "This %s is part of this backup set!", 2991 2991 g_backup_media_string); 2992 2992 ok_go_ahead_burn_it = FALSE; … … 3005 3005 mr_free(our_serial_str); 3006 3006 } else { 3007 log_msg(2,3007 mr_msg(2, 3008 3008 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 3009 3009 g_backup_media_string); … … 3028 3028 goto gotos_make_me_puke; 3029 3029 } else { 3030 log_msg(2, "paafcd: OK, going ahead and burning it.");3030 mr_msg(2, "paafcd: OK, going ahead and burning it."); 3031 3031 } 3032 3032 mr_free(cdrom_dev); 3033 3033 3034 log_msg(2,3034 mr_msg(2, 3035 3035 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 3036 3036 g_backup_media_string); … … 3161 3161 file_to_openin = ntfsprog_fifo; 3162 3162 mr_asprintf(&checksum_line, "IGNORE"); 3163 log_msg(2,3163 mr_msg(2, 3164 3164 "Not calculating checksum for %s: it would take too long", 3165 3165 biggie_filename); … … 3221 3221 paranoid_fclose(fout); 3222 3222 length = totallength / optimal_set_size / 1024; 3223 log_msg(1, "Opening in %s; slicing it and writing to CD/tape",3223 mr_msg(1, "Opening in %s; slicing it and writing to CD/tape", 3224 3224 file_to_openin); 3225 3225 if (!(fin = fopen(file_to_openin, "r"))) { … … 3279 3279 { 3280 3280 if (!does_file_exist(curr_slice_fname_uncompressed)) { 3281 log_msg(2,3281 mr_msg(2, 3282 3282 "Warning - '%s' doesn't exist. How can I compress slice?", 3283 3283 curr_slice_fname_uncompressed); … … 3287 3287 bkpinfo->compression_level, 3288 3288 curr_slice_fname_uncompressed); 3289 log_msg(2, command);3289 mr_msg(2, command); 3290 3290 if ((res = system(command))) { 3291 3291 log_OS_error(command); … … 3303 3303 retval += res; 3304 3304 if (res) { 3305 log_msg(2, "Failed to compress the slice");3305 mr_msg(2, "Failed to compress the slice"); 3306 3306 } 3307 3307 if (bkpinfo->use_lzo … … 3323 3323 newtRefresh(); 3324 3324 } else { 3325 log_msg(2, tmp);3325 mr_msg(2, tmp); 3326 3326 } 3327 3327 #else 3328 log_msg(2, tmp);3328 mr_msg(2, tmp); 3329 3329 #endif 3330 3330 mr_free(tmp); … … 3373 3373 biggie_file_number + 1); 3374 3374 } 3375 log_msg(1, tmp);3375 mr_msg(1, tmp); 3376 3376 mr_free(tmp); 3377 3377 return (retval); … … 3421 3421 mr_free(tmp); 3422 3422 3423 log_msg(1, "Wiped %s's archives", dir);3423 mr_msg(1, "Wiped %s's archives", dir); 3424 3424 mr_asprintf(&tmp, "ls -l %s", dir); 3425 3425 run_program_and_log_output(tmp, FALSE); … … 3457 3457 3458 3458 mr_asprintf(&tmp, "Writing the final ISO"); 3459 log_msg(2, tmp);3459 mr_msg(2, tmp); 3460 3460 /* BERLIOS: center_string is now broken 3461 3461 center_string(tmp, 80); … … 3473 3473 } 3474 3474 #endif 3475 log_msg(2, "Returning from writing final ISO (res=%d)", res);3475 mr_msg(2, "Returning from writing final ISO (res=%d)", res); 3476 3476 return (res); 3477 3477 } … … 3525 3525 using_nfs = FALSE; 3526 3526 } 3527 log_msg(1, "OK, time to make %s #%d",3527 mr_msg(1, "OK, time to make %s #%d", 3528 3528 bkpinfo->backup_media_string, 3529 3529 g_current_media_number); … … 3541 3541 bkpinfo->scratchdir); 3542 3542 if (run_program_and_log_output(tmp, FALSE)) { 3543 log_msg(2, "Warning - unable to copy autorun to scratchdir");3543 mr_msg(2, "Warning - unable to copy autorun to scratchdir"); 3544 3544 } 3545 3545 mr_free(tmp); … … 3550 3550 if (last_cd) { 3551 3551 unlink(lastcd_fname); 3552 log_msg(2,3552 mr_msg(2, 3553 3553 "OK, you're telling me this is the last CD. Fair enough."); 3554 3554 } else { … … 3579 3579 if ((tmp = find_cdrom_device(FALSE)) == NULL) // make sure find_cdrom_device() finds, records CD-R's loc 3580 3580 { 3581 log_msg(3, "*Sigh* Mike, I hate your computer.");3581 mr_msg(3, "*Sigh* Mike, I hate your computer."); 3582 3582 bkpinfo->manual_cd_tray = TRUE; 3583 3583 } // if it can't be found then force pausing 3584 3584 else { 3585 log_msg(3, "Great. Found Mike's CD-ROM drive.");3585 mr_msg(3, "Great. Found Mike's CD-ROM drive."); 3586 3586 mr_free(tmp); 3587 3587 } … … 3611 3611 } 3612 3612 } else { 3613 log_msg(2, "Retrying, at user's request...");3613 mr_msg(2, "Retrying, at user's request..."); 3614 3614 res = 0; 3615 3615 } … … 3634 3634 bkpinfo->scratchdir, bkpinfo->scratchdir); 3635 3635 if (system(tmp)) { 3636 log_msg(2,3636 mr_msg(2, 3637 3637 "Error occurred when I tried to delete the redundant IMGs and GZs"); 3638 3638 } … … 3640 3640 3641 3641 if (last_cd) { 3642 log_msg(2, "This was your last CD.");3643 } else { 3644 log_msg(2, "Continuing to backup your data...");3642 mr_msg(2, "This was your last CD."); 3643 } else { 3644 mr_msg(2, "Continuing to backup your data..."); 3645 3645 } 3646 3646 … … 3682 3682 //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr)) 3683 3683 { 3684 log_msg(2,3684 mr_msg(2, 3685 3685 "Not verifying again. Per-CD/ISO verification already carried out."); 3686 3686 paranoid_system … … 3694 3694 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3695 3695 if (cdno != g_current_media_number) { 3696 log_msg(2,3696 mr_msg(2, 3697 3697 "Warning - had to change g_current_media_number from %d to %d", 3698 3698 g_current_media_number, cdno); … … 3787 3787 } 3788 3788 mr_asprintf(&tmp, "maxblocks = %d; p=%s", maxblocks, p); 3789 log_msg(2, tmp);3789 mr_msg(2, tmp); 3790 3790 mr_free(tmp); 3791 3791 … … 3803 3803 if (fread(blk, 1, 1024, fin) != 1024) { 3804 3804 if (feof(fin)) { 3805 log_msg(1,3805 mr_msg(1, 3806 3806 "img read err - img ended prematurely - non-fatal error"); 3807 3807 sleep(3); -
trunk/mondo/src/common/libmondo-devices.c
r1079 r1086 133 133 } 134 134 135 log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,135 mr_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device, 136 136 mountpoint); 137 137 /*@ end vars *************************************************** */ … … 145 145 #endif 146 146 147 log_msg(4, command);147 mr_msg(4, command); 148 148 if (strncmp(device, "/dev/", 5) == 0) { 149 149 retract_CD_tray_and_defeat_autorun(); 150 150 } 151 151 retval = system(command); 152 log_msg(1, "system(%s) returned %d", command, retval);152 mr_msg(1, "system(%s) returned %d", command, retval); 153 153 mr_free(command); 154 154 … … 174 174 mr_asprintf(&tmp, where_is_root_mounted()); 175 175 mr_asprintf(&comment, "root is mounted at %s\n", tmp); 176 log_msg(0, comment);176 mr_msg(0, comment); 177 177 mr_free(comment); 178 178 179 log_msg(0,179 mr_msg(0, 180 180 "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().", 181 181 tmp); … … 208 208 is_this_a_ramdisk = TRUE; 209 209 } 210 log_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);210 mr_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk); 211 211 return (is_this_a_ramdisk); 212 212 } … … 291 291 #endif 292 292 293 log_msg(3, "Ejecting %s", dev);293 mr_msg(3, "Ejecting %s", dev); 294 294 res2 = run_program_and_log_output(command, 1); 295 295 mr_free(command); … … 543 543 } 544 544 if (res) { 545 log_msg(1, _("mount failed"));546 } else { 547 log_msg(1, _("mount succeeded with %s"), dev);545 mr_msg(1, _("mount failed")); 546 } else { 547 mr_msg(1, _("mount succeeded with %s"), dev); 548 548 } 549 549 mr_free(dev); … … 568 568 if (g_cdrw_drive_is_here != NULL) { 569 569 mr_asprintf(&cdrw_device, g_cdrw_drive_is_here); 570 log_msg(3, "Been there, done that. Returning %s", cdrw_device);570 mr_msg(3, "Been there, done that. Returning %s", cdrw_device); 571 571 return(cdrw_device); 572 572 } 573 573 if (g_backup_media_type == dvd) { 574 log_msg(1,574 mr_msg(1, 575 575 "This is dumb. You're calling find_cdrw_device() but you're backing up to DVD. WTF?"); 576 576 return(NULL); … … 652 652 if ((g_cdrom_drive_is_here != NULL) && !isdigit(g_cdrom_drive_is_here[0])) { 653 653 mr_asprintf(&output, g_cdrom_drive_is_here); 654 log_msg(3, "Been there, done that. Returning %s", output);654 mr_msg(3, "Been there, done that. Returning %s", output); 655 655 return(output); 656 656 } 657 657 if ((the_last_place_i_found_it != NULL) && !try_to_mount) { 658 658 mr_asprintf(&output, the_last_place_i_found_it); 659 log_msg(3,659 mr_msg(3, 660 660 "find_cdrom_device() --- returning last found location - '%s'", 661 661 output); … … 674 674 if (!tmp) { 675 675 mr_asprintf(&output, "/dev/cdrom"); 676 log_msg(4, "Can't find cdrecord; assuming %s", output);676 mr_msg(4, "Can't find cdrecord; assuming %s", output); 677 677 if (!does_device_exist(output)) { 678 log_msg(4, "That didn't work. Sorry.");678 mr_msg(4, "That didn't work. Sorry."); 679 679 mr_free(cdr_exe); 680 680 mr_free(output); … … 690 690 fin = popen(command, "r"); 691 691 if (!fin) { 692 log_msg(4, "command=%s", command);692 mr_msg(4, "command=%s", command); 693 693 log_OS_error("Cannot popen command"); 694 694 mr_free(cdr_exe); … … 730 730 #ifndef __FreeBSD__ 731 731 if (strlen(phrase_two) == 0) { 732 log_msg(4, "Not running phase two. String is empty.");732 mr_msg(4, "Not running phase two. String is empty."); 733 733 } else { 734 734 mr_asprintf(&command, "dmesg | grep \"%s\" 2> /dev/null", phrase_two); 735 735 fin = popen(command, "r"); 736 736 if (!fin) { 737 log_msg(4, "Cannot run 2nd command - non-fatal, fortunately");737 mr_msg(4, "Cannot run 2nd command - non-fatal, fortunately"); 738 738 } else { 739 739 for (mr_getline(&tmp, &n, fin); !feof(fin); 740 740 mr_getline(&tmp, &n, fin)) { 741 log_msg(5, "--> '%s'", tmp);741 mr_msg(5, "--> '%s'", tmp); 742 742 if (tmp[0] != ' ' && tmp[1] != ' ') { 743 743 p = strchr(tmp, ':'); … … 747 747 mr_free(dvd_last_resort); 748 748 mr_asprintf(&dvd_last_resort, "/dev/%s", tmp); 749 log_msg(4,749 mr_msg(4, 750 750 "Ignoring '%s' because it's a DVD drive", 751 751 tmp); … … 767 767 #ifdef __FreeBSD__ 768 768 if (!found_it) { 769 log_msg(4, "OK, approach 2");769 mr_msg(4, "OK, approach 2"); 770 770 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) { 771 771 if (! … … 804 804 if (dvd_last_resort != NULL) { 805 805 if (!found_it && strlen(dvd_last_resort) > 0) { 806 log_msg(4, "Well, I'll use the DVD - %s - as a last resort",806 mr_msg(4, "Well, I'll use the DVD - %s - as a last resort", 807 807 dvd_last_resort); 808 808 mr_free(output); … … 817 817 strrchr(output, '/') + 1); 818 818 if (system(tmp) == 0) { 819 log_msg(4,819 mr_msg(4, 820 820 "%s is not right. It's being SCSI-emulated. Continuing.", 821 821 output); … … 827 827 828 828 if (found_it) { 829 log_msg(4, "(find_cdrom_device) --> '%s'", output);829 mr_msg(4, "(find_cdrom_device) --> '%s'", output); 830 830 if (!does_device_exist(output)) { 831 log_msg(4, "OK, I was wrong, I haven't found it... yet.");831 mr_msg(4, "OK, I was wrong, I haven't found it... yet."); 832 832 found_it = FALSE; 833 833 mr_free(output); … … 836 836 837 837 if (!found_it) { 838 log_msg(4, "OK, approach 2");838 mr_msg(4, "OK, approach 2"); 839 839 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/scd0"))) { 840 840 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/sr0"))) { … … 882 882 if (found_it && try_to_mount) { 883 883 if (! mount_CDROM_here(output, mountpoint)) { 884 log_msg(4, "[Cardigans] I've changed my mind");884 mr_msg(4, "[Cardigans] I've changed my mind"); 885 885 found_it = FALSE; 886 886 mr_free(output); … … 888 888 mr_asprintf(&tmp, "%s/archives", mountpoint); 889 889 if (!does_file_exist(tmp)) { 890 log_msg(4, "[Cardigans] I'll take it back");890 mr_msg(4, "[Cardigans] I'll take it back"); 891 891 found_it = FALSE; 892 892 mr_free(output); … … 895 895 paranoid_system(command); 896 896 mr_free(command); 897 log_msg(4, "I'm confident the Mondo CD is in %s", output);897 mr_msg(4, "I'm confident the Mondo CD is in %s", output); 898 898 } 899 899 mr_free(tmp); … … 905 905 if (found_it) { 906 906 if (!does_file_exist(output)) { 907 log_msg(3, "I still haven't found it.");907 mr_msg(3, "I still haven't found it."); 908 908 mr_free(output); 909 909 return(NULL); 910 910 } 911 log_msg(3, "(find_cdrom_device) --> '%s'", output);911 mr_msg(3, "(find_cdrom_device) --> '%s'", output); 912 912 mr_asprintf(&the_last_place_i_found_it, output); 913 913 mr_free(g_cdrom_drive_is_here); … … 921 921 mr_free(cdr_exe); 922 922 923 log_msg(1, "command=%s", command);923 mr_msg(1, "command=%s", command); 924 924 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command)); 925 925 mr_free(command); … … 927 927 if (tmp[0]) { 928 928 output = tmp; 929 log_msg(4, "Finally found it at %s", output);929 mr_msg(4, "Finally found it at %s", output); 930 930 } else { 931 931 mr_free(tmp); 932 932 mr_free(output); 933 log_msg(4, "Still couldn't find it.");933 mr_msg(4, "Still couldn't find it."); 934 934 } 935 935 return(output); … … 945 945 if (g_dvd_drive_is_here != NULL) { 946 946 mr_asprintf(&output, g_dvd_drive_is_here); 947 log_msg(3, "Been there, done that. Returning %s", output);947 mr_msg(3, "Been there, done that. Returning %s", output); 948 948 return (output); 949 949 } … … 952 952 ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1") 953 953 ); 954 log_msg(5, "tmp = '%s'", tmp);954 mr_msg(5, "tmp = '%s'", tmp); 955 955 if (!tmp[0]) { 956 956 mr_free(tmp); … … 969 969 mr_free(g_dvd_drive_is_here); 970 970 mr_asprintf(&g_dvd_drive_is_here, output); 971 log_msg(2, "I think DVD is at %s", output);972 } else { 973 log_msg(2, "I cannot find DVD");971 mr_msg(2, "I think DVD is at %s", output); 972 } else { 973 mr_msg(2, "I cannot find DVD"); 974 974 } 975 975 … … 1032 1032 1033 1033 if (outvalB <= 0) { 1034 log_msg(1, "Error getting size of %s: %s", drive, strerror(errno));1034 mr_msg(1, "Error getting size of %s: %s", drive, strerror(errno)); 1035 1035 #if linux 1036 1036 fileid = open(drive, O_RDONLY); … … 1041 1041 cylindersize = hdgeo.heads * hdgeo.sectors / 2; 1042 1042 outvalA = cylindersize * cylinders / 1024; 1043 log_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",1043 mr_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d", 1044 1044 hdgeo.cylinders, hdgeo.heads, hdgeo.sectors); 1045 1045 gotgeo = 1; 1046 1046 } else { 1047 log_msg(1, "Harddisk geometry wrong");1047 mr_msg(1, "Harddisk geometry wrong"); 1048 1048 } 1049 1049 } else { 1050 log_msg(1,1050 mr_msg(1, 1051 1051 "Error in ioctl() getting new hard disk geometry (%s), resizing in unsafe mode", 1052 1052 strerror(errno)); … … 1054 1054 close(fileid); 1055 1055 } else { 1056 log_msg(1, "Failed to open %s for reading: %s", drive,1056 mr_msg(1, "Failed to open %s for reading: %s", drive, 1057 1057 strerror(errno)); 1058 1058 } 1059 1059 if (!gotgeo) { 1060 log_msg(1, "Failed to get harddisk geometry, using old mode");1060 mr_msg(1, "Failed to get harddisk geometry, using old mode"); 1061 1061 } 1062 1062 #endif … … 1067 1067 outvalC = (outvalA > outvalB) ? outvalA : outvalB; 1068 1068 1069 // log_msg (5, "drive = %s, error = %s", drive, strerror (errno));1069 // mr_msg (5, "drive = %s, error = %s", drive, strerror (errno)); 1070 1070 // fatal_error ("GPSOD: Unable to get size of drive"); 1071 log_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,1071 mr_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB, 1072 1072 outvalC); 1073 1073 … … 1164 1164 // assert_string_is_neither_NULL_nor_zerolength(device_raw); 1165 1165 if (device_raw[0] != '/' && !strstr(device_raw, ":/")) { 1166 log_msg(1, "%s needs to have a '/' prefixed - I'll do it",1166 mr_msg(1, "%s needs to have a '/' prefixed - I'll do it", 1167 1167 device_raw); 1168 1168 mr_asprintf(&tmp, "/%s", device_raw); … … 1170 1170 mr_asprintf(&tmp, device_raw); 1171 1171 } 1172 log_msg(1, "Is %s mounted?", tmp);1172 mr_msg(1, "Is %s mounted?", tmp); 1173 1173 if (!strcmp(tmp, "/proc") || !strcmp(tmp, "proc")) { 1174 log_msg(1,1174 mr_msg(1, 1175 1175 "I don't know how the heck /proc made it into the mountlist. I'll ignore it."); 1176 1176 return (FALSE); … … 1201 1201 mr_free(device_with_space); 1202 1202 1203 log_msg(4, "tmp (command) = '%s'", tmp);1203 mr_msg(4, "tmp (command) = '%s'", tmp); 1204 1204 if (!system(tmp)) { 1205 1205 mr_free(tmp); … … 1321 1321 assert(cd_number_i_want > 0); 1322 1322 1323 // log_msg(3, "Insisting on CD number %d", cd_number_i_want);1323 // mr_msg(3, "Insisting on CD number %d", cd_number_i_want); 1324 1324 1325 1325 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1326 log_msg(3,1326 mr_msg(3, 1327 1327 "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO"); 1328 1328 return; … … 1335 1335 if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso 1336 1336 || bkpinfo->backup_media_type == nfs) { 1337 log_msg(3, "Remounting CD");1337 mr_msg(3, "Remounting CD"); 1338 1338 g_ISO_restore_mode = TRUE; 1339 1339 // FIXME --- I'm tempted to do something about this... … … 1352 1352 cd_number_i_want); 1353 1353 if (does_file_exist(tmp)) { 1354 log_msg(1,1354 mr_msg(1, 1355 1355 "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir", 1356 1356 bkpinfo->isodir); … … 1358 1358 } 1359 1359 } 1360 log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);1360 mr_msg(3, "Mounting %s at %s", tmp, MNT_CDROM); 1361 1361 if (! mount_CDROM_here(tmp, MNT_CDROM)) { 1362 1362 fatal_error("Mommy!"); … … 1365 1365 } 1366 1366 if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) { 1367 log_msg(3, "Currently, we hold %d but we want %d", res,1367 mr_msg(3, "Currently, we hold %d but we want %d", res, 1368 1368 cd_number_i_want); 1369 1369 mr_asprintf(&tmp, "Insisting on %s #%d", … … 1373 1373 bkpinfo->backup_media_string, 1374 1374 cd_number_i_want); 1375 log_msg(3, tmp);1375 mr_msg(3, tmp); 1376 1376 mr_free(tmp); 1377 1377 … … 1403 1403 mr_free(request); 1404 1404 1405 log_msg(1, "Thankyou. Proceeding...");1405 mr_msg(1, "Thankyou. Proceeding..."); 1406 1406 g_current_media_number = cd_number_i_want; 1407 1407 } … … 1452 1452 } 1453 1453 bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type); 1454 log_msg(3, "media type = %s",bkpinfo->backup_media_string);1454 mr_msg(3, "media type = %s",bkpinfo->backup_media_string); 1455 1455 1456 1456 if (archiving_to_media) { … … 1490 1490 mr_asprintf(&tmp, "1"); 1491 1491 mr_asprintf(&sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 1492 log_msg(1, "Setting to DVD defaults");1492 mr_msg(1, "Setting to DVD defaults"); 1493 1493 } else if (bkpinfo->backup_media_type == usb) { 1494 1494 strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE); … … 1498 1498 mr_asprintf(&tmp, "4"); 1499 1499 mr_asprintf(&sz_size, "650"); 1500 log_msg(1, "Setting to CD defaults");1500 mr_msg(1, "Setting to CD defaults"); 1501 1501 } 1502 1502 if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) { … … 1534 1534 if (bkpinfo->disaster_recovery) { 1535 1535 mr_allocstr(bkpinfo->media_device, "/dev/cdrom"); 1536 log_msg(2, "CD-ROM device assumed to be at %s",1536 mr_msg(2, "CD-ROM device assumed to be at %s", 1537 1537 bkpinfo->media_device); 1538 1538 } else if (bkpinfo->restore_data … … 1541 1541 mr_asprintf(&bkpinfo->media_device, "/dev/cdrom"); 1542 1542 } // just for the heck of it :) 1543 log_msg(1, "bkpinfo->media_device = %s",1543 mr_msg(1, "bkpinfo->media_device = %s", 1544 1544 bkpinfo->media_device); 1545 1545 tmp = find_cdrom_device(FALSE); … … 1547 1547 || (tmp != NULL)) { 1548 1548 mr_allocstr(bkpinfo->media_device, tmp); 1549 log_msg(1, "bkpinfo->media_device = %s",1549 mr_msg(1, "bkpinfo->media_device = %s", 1550 1550 bkpinfo->media_device); 1551 1551 mr_asprintf(&comment, … … 1561 1561 mr_free(tmp); 1562 1562 1563 log_msg(2, "%s device found at %s",1563 mr_msg(2, "%s device found at %s", 1564 1564 bkpinfo->backup_media_string, 1565 1565 bkpinfo->media_device); … … 1607 1607 mr_free(bkpinfo->media_device); 1608 1608 if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) { 1609 log_msg(3, _("Ok, using vanilla scsi tape."));1609 mr_msg(3, _("Ok, using vanilla scsi tape.")); 1610 1610 mr_allocstr(bkpinfo->media_device,VANILLA_SCSI_TAPE"0" ); 1611 1611 if ((fin = fopen(bkpinfo->media_device, "r"))) { … … 1647 1647 } 1648 1648 mr_free(tmp); 1649 log_msg(4, "sz_size = %s", sz_size);1649 mr_msg(4, "sz_size = %s", sz_size); 1650 1650 mr_free(sz_size); 1651 1651 bkpinfo->media_size[0] = 0; 1652 log_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);1652 mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]); 1653 1653 if (bkpinfo->media_size[0] <= 0) { 1654 1654 bkpinfo->media_size[0] = 0; … … 1781 1781 finish(1); 1782 1782 } 1783 log_msg(3, "prefix set to %s", bkpinfo->prefix);1783 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 1784 1784 1785 1785 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { 1786 1786 bkpinfo->media_size[i] = 650; 1787 1787 } 1788 log_msg(3, "Just set nfs_remote_dir to %s",1788 mr_msg(3, "Just set nfs_remote_dir to %s", 1789 1789 bkpinfo->nfs_remote_dir); 1790 log_msg(3, "isodir is still %s", bkpinfo->isodir);1790 mr_msg(3, "isodir is still %s", bkpinfo->isodir); 1791 1791 break; 1792 1792 … … 1828 1828 finish(1); 1829 1829 } 1830 log_msg(3, "prefix set to %s", bkpinfo->prefix);1830 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 1831 1831 break; 1832 1832 default: … … 1974 1974 #else 1975 1975 if (bkpinfo->backup_media_type == nfs) { 1976 log_msg(3, "I think the NFS mount is mounted at %s",1976 mr_msg(3, "I think the NFS mount is mounted at %s", 1977 1977 bkpinfo->isodir); 1978 1978 } … … 1997 1997 fatal_error("Media size is less than zero."); 1998 1998 } else { 1999 log_msg(2, "Warning - media size is less than zero.");1999 mr_msg(2, "Warning - media size is less than zero."); 2000 2000 bkpinfo->media_size[0] = 0; 2001 2001 } … … 2092 2092 return (FALSE); 2093 2093 } 2094 log_msg(10, "Injecting %s", dev);2094 mr_msg(10, "Injecting %s", dev); 2095 2095 inject_device(dev); 2096 2096 if (!does_file_exist(dev)) { 2097 log_msg(10, "%s doesn't exist. Returning FALSE.", dev);2097 mr_msg(10, "%s doesn't exist. Returning FALSE.", dev); 2098 2098 return (FALSE); 2099 2099 } … … 2103 2103 && !run_program_and_log_output(command, FALSE)) { 2104 2104 mr_asprintf(&output, dev); 2105 log_msg(4, "Found it - %s", dev);2105 mr_msg(4, "Found it - %s", dev); 2106 2106 mr_free(command); 2107 2107 return (TRUE); 2108 2108 } else { 2109 log_msg(4, "It's not %s", dev);2109 mr_msg(4, "It's not %s", dev); 2110 2110 mr_free(command); 2111 2111 return (FALSE); … … 2365 2365 lstat(curr_fname, &statbuf); 2366 2366 while (S_ISLNK(statbuf.st_mode)) { 2367 log_msg(1, "curr_fname = %s", curr_fname);2367 mr_msg(1, "curr_fname = %s", curr_fname); 2368 2368 mr_asprintf(&command, "file %s", curr_fname); 2369 2369 tmp = call_program_and_get_last_line_of_output(command); … … 2376 2376 for (p = scratch; *p != '\0' && *p != '\''; p++); 2377 2377 *p = '\0'; 2378 log_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp, scratch);2378 mr_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp, scratch); 2379 2379 mr_free(tmp); 2380 2380 … … 2419 2419 char *fdisk = NULL; 2420 2420 2421 log_msg(0, "Looking for partition table format type");2421 mr_msg(0, "Looking for partition table format type"); 2422 2422 mr_asprintf(&fdisk, "/sbin/parted2fdisk"); 2423 log_msg(1, "Using %s", fdisk);2423 mr_msg(1, "Using %s", fdisk); 2424 2424 mr_asprintf(&command, "%s -l %s | grep 'EFI GPT'", fdisk, drive); 2425 2425 mr_free(fdisk); … … 2434 2434 } 2435 2435 mr_free(tmp); 2436 log_msg(0, "Found %s partition table format type", output);2436 mr_msg(0, "Found %s partition table format type", output); 2437 2437 return (output); 2438 2438 } -
trunk/mondo/src/common/libmondo-fifo.c
r1079 r1086 120 120 internal_tape_block_size, keych, device); 121 121 } 122 log_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);122 mr_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer); 123 123 fres = popen(g_sz_call_to_buffer, sz_dir); 124 124 mr_free(sz_dir); 125 125 if (fres) { 126 log_msg(2, "Successfully opened ('%c') tape device %s", direction,126 mr_msg(2, "Successfully opened ('%c') tape device %s", direction, 127 127 device); 128 128 } else { 129 log_msg(2, "Failed to open ('%c') tape device %s", direction,129 mr_msg(2, "Failed to open ('%c') tape device %s", direction, 130 130 device); 131 131 } … … 133 133 mr_asprintf(&tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer); 134 134 if (run_program_and_log_output(tmp, 2)) { 135 log_msg(2, "Warning - I think I failed to open tape, actually.");135 mr_msg(2, "Warning - I think I failed to open tape, actually."); 136 136 } 137 137 mr_free(tmp); … … 168 168 "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer); 169 169 mr_free(g_sz_call_to_buffer); 170 log_msg(2, "kill_buffer() --- command = %s", command);170 mr_msg(2, "kill_buffer() --- command = %s", command); 171 171 172 172 tmp = call_program_and_get_last_line_of_output(command); … … 174 174 175 175 mr_asprintf(&command, "kill %s", tmp); 176 log_msg(2, "kill_buffer() --- command = %s", command);176 mr_msg(2, "kill_buffer() --- command = %s", command); 177 177 178 178 if (strlen(tmp) > 0) { -
trunk/mondo/src/common/libmondo-filelist.c
r1083 r1086 150 150 int retval = 0; 151 151 152 log_msg(1, "Sorting file %s", orig_fname);152 mr_msg(1, "Sorting file %s", orig_fname); 153 153 mr_asprintf(&tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768), 154 154 (int) (random() % 32768), (int) (random() % 32768)); … … 164 164 165 165 if (retval) { 166 log_msg(2, "Failed to sort %s - oh dear", orig_fname);166 mr_msg(2, "Failed to sort %s - oh dear", orig_fname); 167 167 } else { 168 log_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",168 mr_msg(2, "Sorted %s --> %s OK. Copying it back to %s now", 169 169 orig_fname, tmp_fname, orig_fname); 170 170 mr_asprintf(&command, "mv -f %s %s", tmp_fname, orig_fname); … … 173 173 174 174 if (retval) { 175 log_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,175 mr_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname, 176 176 orig_fname); 177 177 } else { 178 log_msg(2, "%s was sorted OK.", orig_fname);178 mr_msg(2, "%s was sorted OK.", orig_fname); 179 179 } 180 180 } 181 181 mr_free(tmp_fname); 182 log_msg(1, "Finished sorting file %s", orig_fname);182 mr_msg(1, "Finished sorting file %s", orig_fname); 183 183 return (retval); 184 184 } … … 325 325 mr_asprintf(&tmp, "Filelist divided into %ld sets", curr_set_no + 1); 326 326 } 327 log_msg(1, tmp);327 mr_msg(1, tmp); 328 328 mr_free(tmp); 329 329 close_evalcall_form(); … … 403 403 pattr = popen(syscall, "r"); 404 404 if (!pattr) { 405 log_msg(1, "Failed to open fattr() %s", syscall);405 mr_msg(1, "Failed to open fattr() %s", syscall); 406 406 return (1); 407 407 } 408 408 if (feof(pattr)) { 409 log_msg(1, "Failed to call fattr() %s", syscall);409 mr_msg(1, "Failed to call fattr() %s", syscall); 410 410 paranoid_pclose(pattr); 411 411 return (2); … … 433 433 434 434 if (!(fin = fopen(filelist, "r"))) { 435 log_msg(1, "Cannot openin filelist %s", filelist);435 mr_msg(1, "Cannot openin filelist %s", filelist); 436 436 return (1); 437 437 } 438 438 mr_asprintf(&pout_command, "gzip -c1 > %s", auxlist_fname); 439 439 if (!(pout = popen(pout_command, "w"))) { 440 log_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);440 mr_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname); 441 441 fclose(fin); 442 442 mr_free(pout_command); … … 451 451 file_to_analyze[i - 1] = '\0'; 452 452 } 453 log_msg(8, "Analyzing %s", file_to_analyze);453 mr_msg(8, "Analyzing %s", file_to_analyze); 454 454 /* BERLIOS : to be checked */ 455 455 mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\')); … … 520 520 FILE *pin, *pout, *faclin; 521 521 522 log_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,522 mr_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist, 523 523 original_exat_fname, executable); 524 524 if (!orig_msklist || !orig_msklist[0] 525 525 || !does_file_exist(orig_msklist)) { 526 log_msg(1,526 mr_msg(1, 527 527 "No masklist provided. I shall therefore set ALL attributes."); 528 528 mr_asprintf(&command, "gzip -dc %s | %s --restore - 2>> %s", 529 529 original_exat_fname, executable, MONDO_LOGFILE); 530 log_msg(1, "command = %s", command);530 mr_msg(1, "command = %s", command); 531 531 retval = system(command); 532 532 mr_free(command); 533 log_msg(1, "Returning w/ retval=%d", retval);533 mr_msg(1, "Returning w/ retval=%d", retval); 534 534 return (retval); 535 535 } 536 536 if (length_of_file(original_exat_fname) <= 0) { 537 log_msg(1,537 mr_msg(1, 538 538 "original_exat_fname %s is empty or missing, so no need to set EXAT list", 539 539 original_exat_fname); … … 551 551 MONDO_LOGFILE); 552 552 553 log_msg(1, "syscall_pin = %s", syscall_pin);554 log_msg(1, "syscall_pout = %s", syscall_pout);553 mr_msg(1, "syscall_pin = %s", syscall_pin); 554 mr_msg(1, "syscall_pout = %s", syscall_pout); 555 555 pout = popen(syscall_pout, "w"); 556 556 if (!pout) { … … 604 604 605 605 i = strcmp(p, q); 606 log_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);606 mr_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i); 607 607 608 608 // printf("%s v %s --> %d\n", p, q, i); 609 609 610 610 if (i < 0) { // read another subset file in. 611 log_msg(my_depth, "Reading next subset line in\n\n");611 mr_msg(my_depth, "Reading next subset line in\n\n"); 612 612 mr_getline(¤t_subset_file, &n, faclin); 613 613 continue; … … 619 619 mr_getline(&incoming, &n, pin); 620 620 if (!i) { 621 log_msg(my_depth, "Copying master %s", q);621 mr_msg(my_depth, "Copying master %s", q); 622 622 } 623 623 // if (!i) { printf("Match --- %s\n", q); } … … 661 661 return (set_EXAT_list(masklist, fattr_fname, "setfattr")); 662 662 } else { 663 log_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");663 mr_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist"); 664 664 return(0); 665 665 } … … 673 673 return (set_EXAT_list(masklist, acl_fname, "setfacl")); 674 674 } else { 675 log_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");675 mr_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist"); 676 676 return(0); 677 677 } … … 748 748 char_to_add = string_to_add[0]; 749 749 if (node->right != NULL && node->ch < char_to_add) { 750 log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,750 mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth, 751 751 char_to_add, node->ch, (node->right)->ch); 752 752 return (add_string_at_node(node->right, string_to_add)); … … 754 754 // walk down tree if appropriate 755 755 if (node->down != NULL && node->ch == char_to_add) { 756 log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);756 mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add); 757 757 depth++; 758 758 res = add_string_at_node(node->down, string_to_add + 1); … … 762 762 763 763 if (char_to_add == '\0' && node->ch == '\0') { 764 log_msg(6, "%s already in tree", original_string);764 mr_msg(6, "%s already in tree", original_string); 765 765 return (1); 766 766 } … … 769 769 if (char_to_add < node->ch) // add to the left of node 770 770 { 771 log_msg(7, "depth=%d char=%c --- adding (left)", depth,771 mr_msg(7, "depth=%d char=%c --- adding (left)", depth, 772 772 char_to_add); 773 773 memcpy((void *) newnode, (void *) node, sizeof(struct s_node)); … … 775 775 } else if (char_to_add > node->ch) // add to the right of node 776 776 { 777 log_msg(7, "depth=%d char=%c --- adding (right)", depth,777 mr_msg(7, "depth=%d char=%c --- adding (right)", depth, 778 778 char_to_add); 779 779 newnode->right = node->right; // newnode is to the RIGHT of node … … 786 786 node->expanded = node->selected = FALSE; 787 787 if (char_to_add == '\0') { 788 log_msg(6, "Added %s OK", original_string);788 mr_msg(6, "Added %s OK", original_string); 789 789 return (0); 790 790 } 791 791 // add the rest 792 log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);792 mr_msg(6, "Adding remaining chars ('%s')", string_to_add + 1); 793 793 for (i = 1; i < noof_chars; i++) { 794 794 node->down = (struct s_node *) mr_malloc(sizeof(struct s_node)); 795 795 node = node->down; 796 796 char_to_add = string_to_add[i]; 797 log_msg(6, "Adding '%c'", char_to_add);797 mr_msg(6, "Adding '%c'", char_to_add); 798 798 node->ch = char_to_add; 799 799 node->right = node->down = NULL; … … 803 803 } 804 804 } 805 log_msg(6, "Finally - added %s OK", original_string);805 mr_msg(6, "Finally - added %s OK", original_string); 806 806 return (0); 807 807 } … … 838 838 mr_asprintf(&command_to_open_fname, "gzip -dc %s", filelist_fname); 839 839 mr_asprintf(&tmp, "zcat %s | wc -l", filelist_fname); 840 log_msg(6, "tmp = %s", tmp);840 mr_msg(6, "tmp = %s", tmp); 841 841 tmp1 = call_program_and_get_last_line_of_output(tmp); 842 842 mr_free(tmp); … … 907 907 908 908 if (depth == 0) { 909 log_msg(0, "----------------show filelist--------------");909 mr_msg(0, "----------------show filelist--------------"); 910 910 } 911 911 current_string[depth] = node->ch; 912 912 913 log_msg(3, "depth=%d", depth);913 mr_msg(3, "depth=%d", depth); 914 914 if (node->down) { 915 log_msg(3, "moving down");915 mr_msg(3, "moving down"); 916 916 depth++; 917 917 show_filelist(node->down); … … 920 920 921 921 if (!node->ch) { 922 log_msg(0, "%s\n", current_string);922 mr_msg(0, "%s\n", current_string); 923 923 } 924 924 925 925 if (node->right) { 926 log_msg(3, "moving right");926 mr_msg(3, "moving right"); 927 927 show_filelist(node->right); 928 928 } 929 929 if (depth == 0) { 930 log_msg(0, "----------------show filelist--------------");930 mr_msg(0, "----------------show filelist--------------"); 931 931 } 932 932 return; … … 986 986 for (node = filelist; node != NULL; node = node->right) { 987 987 str[depth] = node->ch; 988 log_msg(5, "depth=%d ch=%c", depth, node->ch);988 mr_msg(5, "depth=%d ch=%c", depth, node->ch); 989 989 if (!node->ch) { 990 990 // if (node->selected) … … 1340 1340 #endif 1341 1341 mr_free(find_excludes); 1342 log_msg(5, "find command = %s", strtmp);1342 mr_msg(5, "find command = %s", strtmp); 1343 1343 system(strtmp); 1344 1344 mr_free(strtmp); … … 1356 1356 find_skeleton_marker[0] = '\0'; 1357 1357 skeleton_lino = 1; 1358 log_msg(5, "entries = %ld", g_skeleton_entries);1358 mr_msg(5, "entries = %ld", g_skeleton_entries); 1359 1359 percentage = 0; 1360 1360 } else if (depth <= MAX_SKEL_DEPTH) // update evalcall form if appropriate … … 1363 1363 "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir, 1364 1364 skeleton_filelist, skeleton_filelist); 1365 // log_msg(0, "fsm = %s", find_skeleton_marker);1365 // mr_msg(0, "fsm = %s", find_skeleton_marker); 1366 1366 if (!system(find_skeleton_marker)) { 1367 1367 percentage = (int) (skeleton_lino * 100 / g_skeleton_entries); 1368 1368 skeleton_lino++; 1369 // log_msg(5, "Found %s", dir);1370 // log_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);1369 // mr_msg(5, "Found %s", dir); 1370 // mr_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage); 1371 1371 sprintf(find_skeleton_marker, "mv -f %s.new %s", 1372 1372 skeleton_filelist, skeleton_filelist); 1373 // log_msg(6, "fsm = %s", find_skeleton_marker);1373 // mr_msg(6, "fsm = %s", find_skeleton_marker); 1374 1374 run_program_and_log_output(find_skeleton_marker, 8); 1375 1375 time(&this_time); … … 1390 1390 depth++; 1391 1391 1392 // log_msg(0, "Cataloguing %s", dir);1392 // mr_msg(0, "Cataloguing %s", dir); 1393 1393 if (sth[0] == ' ') { 1394 1394 mr_asprintf(&skip_these, "%s", sth); … … 1466 1466 mr_free(find_skeleton_marker); 1467 1467 unlink(skeleton_filelist); 1468 log_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);1468 mr_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries); 1469 1469 } 1470 1470 return (0); … … 1565 1565 mr_free(tmp); 1566 1566 } else if (lstat(sz_datefile, &statbuf)) { 1567 log_msg(2,1567 mr_msg(2, 1568 1568 "Warning - unable to find date of previous backup. Full backup instead."); 1569 1569 differential = 0; … … 1571 1571 } else { 1572 1572 time_of_last_full_backup = statbuf.st_mtime; 1573 log_msg(2, "Differential backup. Yay.");1573 mr_msg(2, "Differential backup. Yay."); 1574 1574 } 1575 1575 mr_free(sz_datefile); … … 1577 1577 // use user-specified filelist (if specified) 1578 1578 if (userdef_filelist) { 1579 log_msg(1,1579 mr_msg(1, 1580 1580 "Using the user-specified filelist - %s - instead of calculating one", 1581 1581 userdef_filelist); … … 1586 1586 mr_free(command); 1587 1587 } else { 1588 log_msg(2, "include_paths = '%s'", include_paths);1589 log_msg(1, "Calculating filelist");1588 mr_msg(2, "include_paths = '%s'", include_paths); 1589 mr_msg(1, "Calculating filelist"); 1590 1590 tmp = call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"); 1591 1591 tmp1 = call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"); … … 1598 1598 mr_free(tmp2); 1599 1599 1600 log_msg(2, "Excluding paths = '%s'", exclude_paths);1601 log_msg(2,1600 mr_msg(2, "Excluding paths = '%s'", exclude_paths); 1601 mr_msg(2, 1602 1602 "Generating skeleton filelist so that we can track our progress"); 1603 1603 mr_asprintf(&skeleton_filelist, "%s/tmpfs/skeleton.txt", tmpdir); 1604 1604 make_hole_for_file(skeleton_filelist); 1605 1605 1606 log_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);1607 log_msg(2, "Opening out filelist to %s", sz_filelist);1606 mr_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries); 1607 mr_msg(2, "Opening out filelist to %s", sz_filelist); 1608 1608 if (!(fout = fopen(sz_filelist, "w"))) { 1609 1609 fatal_error("Cannot openout to sz_filelist"); … … 1611 1611 i = 0; 1612 1612 if (strlen(include_paths) == 0) { 1613 log_msg(1, "Including only '/' in %s", sz_filelist);1613 mr_msg(1, "Including only '/' in %s", sz_filelist); 1614 1614 open_and_list_dir("/", exclude_paths, fout, 1615 1615 time_of_last_full_backup, skeleton_filelist); … … 1618 1618 while (*p) { 1619 1619 q = next_entry(p); 1620 log_msg(1, "Including %s in filelist %s", q, sz_filelist);1620 mr_msg(1, "Including %s in filelist %s", q, sz_filelist); 1621 1621 open_and_list_dir(q, exclude_paths, fout, 1622 1622 time_of_last_full_backup, … … 1632 1632 mr_free(exclude_paths); 1633 1633 } 1634 log_msg(2, "Copying new filelist to scratchdir");1634 mr_msg(2, "Copying new filelist to scratchdir"); 1635 1635 mr_asprintf(&command, "mkdir -p %s/archives", scratchdir); 1636 1636 paranoid_system(command); … … 1646 1646 mr_free(sz_filelist); 1647 1647 1648 log_msg(2, "Exiting");1648 mr_msg(2, "Exiting"); 1649 1649 return (0); 1650 1650 } … … 1683 1683 noof_chars = strlen(string_to_find) + 1; /* we include the '\0' */ 1684 1684 1685 log_msg(7, "starting --- str=%s", string_to_find);1685 mr_msg(7, "starting --- str=%s", string_to_find); 1686 1686 1687 1687 /* walk across tree if necessary */ … … 1689 1689 char_to_find = string_to_find[0]; 1690 1690 if (node->right != NULL && node->ch < char_to_find) { 1691 log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,1691 mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth, 1692 1692 char_to_find, node->ch, (node->right)->ch); 1693 1693 return (find_string_at_node(node->right, string_to_find)); … … 1696 1696 /* walk down tree if appropriate */ 1697 1697 if (node->down != NULL && node->ch == char_to_find) { 1698 log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);1698 mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find); 1699 1699 depth++; 1700 1700 node = find_string_at_node(node->down, string_to_find + 1); … … 1704 1704 1705 1705 if (char_to_find == '\0' && node->ch == '\0') { 1706 log_msg(7, "%s is in tree", original_string);1706 mr_msg(7, "%s is in tree", original_string); 1707 1707 return (node); 1708 1708 } else { 1709 log_msg(7, "%s is NOT in tree", original_string);1709 mr_msg(7, "%s is NOT in tree", original_string); 1710 1710 return (NULL); 1711 1711 } … … 1734 1734 size_t len = 0; // Scrub's patch doesn't work without that 1735 1735 1736 // log_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");1737 log_msg(5, "starting");1738 log_msg(5, "needles_list_fname = %s", needles_list_fname);1739 log_msg(5, "matches_list_fname = %s", matches_list_fname);1736 // mr_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE"); 1737 mr_msg(5, "starting"); 1738 mr_msg(5, "needles_list_fname = %s", needles_list_fname); 1739 mr_msg(5, "matches_list_fname = %s", matches_list_fname); 1740 1740 if (!(fin = fopen(needles_list_fname, "r"))) { 1741 1741 fatal_error("Cannot openin needles_list_fname"); … … 1759 1759 } 1760 1760 1761 log_msg(5, "Looking for '%s'", fname);1761 mr_msg(5, "Looking for '%s'", fname); 1762 1762 found_node = find_string_at_node(filelist, fname); 1763 1763 if (found_node) { … … 1768 1768 fname = tmp; 1769 1769 } 1770 log_msg(5, "Found '%s'", fname);1770 mr_msg(5, "Found '%s'", fname); 1771 1771 turn_wildcard_chars_into_literal_chars(tmp, fname); 1772 1772 fprintf(fout, "%s\n", tmp); … … 1799 1799 struct s_node *nod; 1800 1800 1801 log_msg(3, "Adding %s to filelist", list_of_files_fname);1801 mr_msg(3, "Adding %s to filelist", list_of_files_fname); 1802 1802 if (!(fin = fopen(list_of_files_fname, "r"))) { 1803 1803 iamhere(list_of_files_fname); … … 1812 1812 tmp[strlen(tmp) - 1] = '\0'; 1813 1813 } 1814 log_msg(2, "tmp = '%s'", tmp);1814 mr_msg(2, "tmp = '%s'", tmp); 1815 1815 if (!tmp[0]) { 1816 1816 continue; 1817 1817 } 1818 1818 if ((nod = find_string_at_node(filelist, tmp))) { 1819 log_msg(5, "Found '%s' in filelist already. Cool.", tmp);1819 mr_msg(5, "Found '%s' in filelist already. Cool.", tmp); 1820 1820 } else { 1821 1821 add_string_at_node(filelist, tmp); … … 1825 1825 if (nod && flag_em) { 1826 1826 toggle_path_selection(filelist, tmp, TRUE); 1827 log_msg(5, "Flagged '%s'", tmp);1827 mr_msg(5, "Flagged '%s'", tmp); 1828 1828 } 1829 1829 } -
trunk/mondo/src/common/libmondo-files.c
r1043 r1086 155 155 156 156 if (lstat(filename, &buf)) { 157 log_msg(20, "%s does not exist", filename);157 mr_msg(20, "%s does not exist", filename); 158 158 return (FALSE); 159 159 } else { 160 log_msg(20, "%s exists", filename);160 mr_msg(20, "%s exists", filename); 161 161 return (TRUE); 162 162 } … … 331 331 332 332 if (output != NULL && does_file_exist(output)) { 333 log_msg(4, "find_home_of_exe () --- Found %s at %s", fname, output);333 mr_msg(4, "find_home_of_exe () --- Found %s at %s", fname, output); 334 334 } else { 335 335 mr_free(output); 336 log_msg(4, "find_home_of_exe() --- Could not find %s", fname);336 mr_msg(4, "find_home_of_exe() --- Could not find %s", fname); 337 337 } 338 338 return (output); … … 662 662 sz_res = call_program_and_get_last_line_of_output(command); 663 663 file_len_K = atol(sz_res); 664 log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);664 mr_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K); 665 665 mr_free(command); 666 666 mr_free(sz_res); … … 699 699 ("Cannot open biggielist. OK, so estimate is based on filesets only."); 700 700 } else { 701 log_msg(4, "Reading it...");701 mr_msg(4, "Reading it..."); 702 702 for (mr_getline(&fname, &n, fin); !feof(fin); 703 703 mr_getline(&fname, &n, fin)) { … … 730 730 if (file_len_K > 0) { 731 731 scratchL += file_len_K; 732 log_msg(4, "%s --> %ld K", fname, file_len_K);732 mr_msg(4, "%s --> %ld K", fname, file_len_K); 733 733 } 734 734 mr_asprintf(&comment, 735 735 "After adding %s, scratchL+%ld now equals %ld", fname, 736 736 file_len_K, scratchL); 737 log_msg(4, comment);737 mr_msg(4, comment); 738 738 mr_free(comment); 739 739 … … 948 948 949 949 /* BERLIOS: Why do we need to do it here as well ? */ 950 log_msg(4, "g_mondo_home='%s'", g_mondo_home);950 mr_msg(4, "g_mondo_home='%s'", g_mondo_home); 951 951 if ((g_mondo_home == NULL) || strlen(g_mondo_home) < 2) { 952 952 mr_free(g_mondo_home); … … 956 956 bkpinfo->scratchdir); 957 957 958 log_msg(4, "command = %s", command);958 mr_msg(4, "command = %s", command); 959 959 if (run_program_and_log_output(command, 1)) { 960 960 fatal_error("Failed to copy Mondo's stuff to scratchdir"); … … 966 966 /* i18n */ 967 967 mr_asprintf(&command, CP_BIN " --parents /usr/share/locale/*/LC_MESSAGES/mondo.mo %s",bkpinfo->scratchdir); 968 log_msg(4, "command = %s", command);968 mr_msg(4, "command = %s", command); 969 969 run_program_and_log_output(command, 1); 970 970 mr_free(command); … … 1298 1298 "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n"); 1299 1299 paranoid_fclose(fout); 1300 log_msg(2, "Created %s", outfile);1300 mr_msg(2, "Created %s", outfile); 1301 1301 mr_asprintf(&tmp, "chmod +x %s", outfile); 1302 1302 paranoid_system(tmp); -
trunk/mondo/src/common/libmondo-fork.c
r1081 r1086 75 75 /*@*********** End Variables ***************************************/ 76 76 77 log_msg(3, "Starting");77 mr_msg(3, "Starting"); 78 78 assert(bkpinfo != NULL); 79 79 assert_string_is_neither_NULL_nor_zerolength(basic_call); … … 90 90 91 91 resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_"); 92 log_msg(4, "basic call = '%s'", basic_call);93 log_msg(4, "midway_call = '%s'", midway_call);94 log_msg(4, "tmp = '%s'", tmp);95 log_msg(4, "ultimate call = '%s'", ultimate_call);92 mr_msg(4, "basic call = '%s'", basic_call); 93 mr_msg(4, "midway_call = '%s'", midway_call); 94 mr_msg(4, "tmp = '%s'", tmp); 95 mr_msg(4, "ultimate call = '%s'", ultimate_call); 96 96 mr_asprintf(&command, "%s >> %s", ultimate_call, MONDO_LOGFILE); 97 97 98 98 log_to_screen 99 99 (_("Please be patient. Do not be alarmed by on-screen inactivity.")); 100 log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",100 mr_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'", 101 101 what_i_am_doing); 102 102 if (bkpinfo->manual_cd_tray) { … … 113 113 } 114 114 #endif 115 log_msg(1, "command = '%s'", command);115 mr_msg(1, "command = '%s'", command); 116 116 retval += system(command); 117 117 if (!g_text_mode) { … … 119 119 } 120 120 if (retval) { 121 log_msg(2, "Basic call '%s' returned an error.", basic_call);121 mr_msg(2, "Basic call '%s' returned an error.", basic_call); 122 122 popup_and_OK(_("Press ENTER to continue.")); 123 123 popup_and_OK … … 127 127 /* if text mode then do the above & RETURN; if not text mode, do this... */ 128 128 else { 129 log_msg(3, "command = '%s'", command);129 mr_msg(3, "command = '%s'", command); 130 130 // yes_this_is_a_goto: 131 131 retval = … … 168 168 assert(program != NULL); 169 169 if (!program[0]) { 170 log_msg(2, "Warning - asked to run zerolength program");170 mr_msg(2, "Warning - asked to run zerolength program"); 171 171 return (1); 172 172 } … … 189 189 res = system(callstr); 190 190 if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) { 191 log_msg(0, "running: %s", callstr);192 log_msg(0,191 mr_msg(0, "running: %s", callstr); 192 mr_msg(0, 193 193 "--------------------------------start of output-----------------------------"); 194 194 } … … 219 219 if ((res == 0 && log_if_success) 220 220 || (res != 0 && log_if_failure)) { 221 log_msg(0, incoming);221 mr_msg(0, incoming); 222 222 } 223 223 } … … 227 227 unlink("/tmp/mondo-run-prog-thing.tmp"); 228 228 if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) { 229 log_msg(0,229 mr_msg(0, 230 230 "--------------------------------end of output------------------------------"); 231 231 if (res) { 232 log_msg(0, "...ran with res=%d", res);232 mr_msg(0, "...ran with res=%d", res); 233 233 } else { 234 log_msg(0, "...ran just fine. :-)");234 mr_msg(0, "...ran just fine. :-)"); 235 235 } 236 236 } 237 237 // else 238 // { log_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }238 // { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); } 239 239 return (res); 240 240 } … … 275 275 open_evalcall_form(what_i_am_doing); 276 276 mr_asprintf(&tmp, "Executing %s", basic_call); 277 log_msg(2, tmp);277 mr_msg(2, tmp); 278 278 mr_free(tmp); 279 279 … … 292 292 log_to_screen(_("Waiting for external binary to start")); 293 293 for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) { 294 log_msg(3, "Waiting for lockfile %s to exist", lockfile);294 mr_msg(3, "Waiting for lockfile %s to exist", lockfile); 295 295 } 296 296 } … … 305 305 /* Log actual pclose errors. */ 306 306 if (errno) 307 log_msg(5, "pclose err: %d", errno);307 mr_msg(5, "pclose err: %d", errno); 308 308 /* Check if we have a valid status. If we do, extract the called program's exit code. */ 309 309 /* If we don't, highlight this fact by returning -1. */ … … 343 343 FILE *ftmp = NULL; 344 344 345 log_msg(5, "Opening.");345 mr_msg(5, "Opening."); 346 346 bufcap = 256L * 1024L; 347 347 buf = mr_malloc(bufcap); … … 367 367 mr_free(tmp); 368 368 369 log_msg(7,369 mr_msg(7, 370 370 "subslice #%ld --- I have read %ld of %ld bytes in from f_orig", 371 371 subsliceno, bytes_read_in, bytes_to_be_read); … … 377 377 mr_free(tmp); 378 378 379 log_msg(7, "Subslice #%d written OK", subsliceno);379 mr_msg(7, "Subslice #%d written OK", subsliceno); 380 380 subsliceno++; 381 381 } … … 393 393 fatal_error("Cannot read the introductory block"); 394 394 } 395 log_msg(5, "tmp is %s", tmp);395 mr_msg(5, "tmp is %s", tmp); 396 396 if (!strstr(tmp, PIMP_START_SZ)) { 397 397 fatal_error("Can't find intro blk"); … … 402 402 bytes_to_be_read = atol(tmp); 403 403 while (bytes_to_be_read > 0) { 404 log_msg(7, "subslice#%ld, bytes=%ld", subsliceno,404 mr_msg(7, "subslice#%ld, bytes=%ld", subsliceno, 405 405 bytes_to_be_read); 406 406 bytes_read_in = fread(buf, 1, bytes_to_be_read, fin); … … 414 414 } 415 415 if (atol(tmp) != subsliceno) { 416 log_msg(1, "Wanted subslice %ld but got %ld ('%s')",416 mr_msg(1, "Wanted subslice %ld but got %ld ('%s')", 417 417 subsliceno, atol(tmp), tmp); 418 418 } 419 log_msg(7, "Subslice #%ld read OK", subsliceno);419 mr_msg(7, "Subslice #%ld read OK", subsliceno); 420 420 subsliceno++; 421 421 if (fread(tmp, 1, 64L, fin) != 64L) { … … 426 426 } 427 427 428 // log_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);428 // mr_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in); 429 429 430 430 if (direction == 'w') { … … 436 436 mr_free(tmp); 437 437 } else { 438 log_msg(1, "tmpA is %s", tmp);438 mr_msg(1, "tmpA is %s", tmp); 439 439 if (!strstr(tmp, PIMP_END_SZ)) { 440 440 if (fread(tmp, 1, 64L, fin) != 64L) { 441 441 fatal_error("Can't read the final block"); 442 442 } 443 log_msg(5, "tmpB is %s", tmp);443 mr_msg(5, "tmpB is %s", tmp); 444 444 if (!strstr(tmp, PIMP_END_SZ)) { 445 445 ftmp = fopen("/tmp/out.leftover", "w"); 446 446 bytes_read_in = fread(tmp, 1, 64L, fin); 447 log_msg(1, "bytes_read_in = %ld", bytes_read_in);447 mr_msg(1, "bytes_read_in = %ld", bytes_read_in); 448 448 // if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); } 449 449 fwrite(tmp, 1, bytes_read_in, ftmp); … … 455 455 /* BERLIOS : strange ??? 456 456 s-printf(tmp, "I am here - %llu", ftello(fin)); 457 log_msg(0, tmp);457 mr_msg(0, tmp); 458 458 */ 459 459 fread(tmp, 1, 512, fin); 460 log_msg(0, "tmp = '%s'", tmp);460 mr_msg(0, "tmp = '%s'", tmp); 461 461 fwrite(tmp, 1, 512, ftmp); 462 462 fclose(ftmp); … … 468 468 469 469 mr_free(buf); 470 log_msg(3, "Successfully copied %ld bytes", bytes_written_out);470 mr_msg(3, "Successfully copied %ld bytes", bytes_written_out); 471 471 return (retval); 472 472 } … … 521 521 mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile, 522 522 tempfile); 523 log_msg(3, command);523 mr_msg(3, command); 524 524 open_evalcall_form(tt); 525 525 … … 537 537 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE); 538 538 if (pcno < 0 || pcno > 100) { 539 log_msg(5, "Weird pc#");539 mr_msg(5, "Weird pc#"); 540 540 continue; 541 541 } … … 567 567 res = 999; 568 568 sz_command = (char *) info; 569 log_msg(4, "sz_command = '%s'", sz_command);569 mr_msg(4, "sz_command = '%s'", sz_command); 570 570 res = system(sz_command); 571 571 if (res > 256 && res != 4444) { 572 572 res = res / 256; 573 573 } 574 log_msg(4, "child res = %d", res);574 mr_msg(4, "child res = %d", res); 575 575 sz_command[0] = '\0'; 576 576 pthread_exit((void *) (&res)); … … 602 602 603 603 mr_asprintf(&command, "%s 2>> %s", cmd, MONDO_LOGFILE); 604 log_msg(3, "command = '%s'", command);604 mr_msg(3, "command = '%s'", command); 605 605 if ((res = 606 606 pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit, … … 609 609 } 610 610 611 log_msg(8, "Parent running");611 mr_msg(8, "Parent running"); 612 612 open_evalcall_form(tt); 613 613 for (sleep(1); command[0] != '\0'; sleep(1)) { 614 614 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE); 615 615 if (pcno <= 0 || pcno > 100) { 616 log_msg(8, "Weird pc#");616 mr_msg(8, "Weird pc#"); 617 617 continue; 618 618 } … … 639 639 res = 666; 640 640 } 641 log_msg(3, "Parent res = %d", res);641 mr_msg(3, "Parent res = %d", res); 642 642 return (res); 643 643 } -
trunk/mondo/src/common/libmondo-mountlist.c
r1081 r1086 536 536 flaws_str = tmp1; 537 537 res++; 538 log_msg(1, tmp);538 mr_msg(1, tmp); 539 539 mr_free(tmp); 540 540 return (FALSE); … … 902 902 "Not putting %s in list of drives: it's a virtual drive", 903 903 drive); 904 log_msg(8, tmp);904 mr_msg(8, tmp); 905 905 mr_free(tmp); 906 906 continue; … … 912 912 "Not putting %s in list of drives: it has zero size (maybe an LVM volume)", 913 913 drive); 914 log_msg(8, tmp);914 mr_msg(8, tmp); 915 915 mr_free(tmp); 916 916 continue; … … 931 931 "Putting %s with size %lli in list of drives", 932 932 drive, size); 933 log_msg(8, tmp);933 mr_msg(8, tmp); 934 934 mr_free(tmp); 935 935 … … 946 946 } 947 947 drivelist->entries = noof_drives; 948 log_msg(8, "Made list of drives");948 mr_msg(8, "Made list of drives"); 949 949 950 950 return (noof_drives); … … 1090 1090 !strcmp(mountlist->el[items].device, "devpts") 1091 1091 ) { 1092 log_msg(1,1092 mr_msg(1, 1093 1093 "Ignoring %s in mountlist - not loading that line :) ", 1094 1094 mountlist->el[items].device); -
trunk/mondo/src/common/libmondo-msg.c
r783 r1086 17 17 18 18 /** 19 * The standard log_debug_msg() ( log_msg() also due to a macro). Writes some describing19 * The standard log_debug_msg() (mr_msg() also due to a macro). Writes some describing 20 20 * information to the logfile. 21 21 */ -
trunk/mondo/src/common/libmondo-raid.c
r1081 r1086 599 599 get_next_raidtab_line(fin, label, value); 600 600 while (!feof(fin)) { 601 log_msg(1, "Looking for raid record #%d", items);601 mr_msg(1, "Looking for raid record #%d", items); 602 602 initialize_raidrec(&raidlist->el[items]); 603 603 v = 0; … … 611 611 raidlist->el[items].additional_vars.entries = v; 612 612 if (feof(fin)) { 613 log_msg(1, "No more records.");613 mr_msg(1, "No more records."); 614 614 continue; 615 615 } 616 log_msg(2, "Record #%d (%s) found", items, value);616 mr_msg(2, "Record #%d (%s) found", items, value); 617 617 raidlist->el[items].raid_device = value; 618 618 for (get_next_raidtab_line(fin, label, value); … … 625 625 paranoid_fclose(fin); 626 626 raidlist->entries = items; 627 log_msg(1, "Raidtab loaded successfully.");628 log_msg(1, "%d RAID devices in raidtab", items);627 mr_msg(1, "Raidtab loaded successfully."); 628 mr_msg(1, "%d RAID devices in raidtab", items); 629 629 return (0); 630 630 } … … 686 686 raidrec->parity = 3; 687 687 } else { 688 log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);688 mr_msg(1, "Unknown RAID parity algorithm '%s'\n.", value); 689 689 } 690 690 } else if (!strcmp(label, "device")) { … … 946 946 // open file 947 947 if (!(fin = fopen(MDSTAT_FILE, "r"))) { 948 log_msg(1, "Could not open %s.\n", MDSTAT_FILE);948 mr_msg(1, "Could not open %s.\n", MDSTAT_FILE); 949 949 return 1; 950 950 } … … 990 990 token = mr_strtok (string, delims, &lastpos); 991 991 if (!strcmp(token, "inactive")) { 992 log_msg(1, "RAID device '%s' inactive.\n",992 mr_msg(1, "RAID device '%s' inactive.\n", 993 993 raidlist->el[raidlist->entries].raid_device); 994 994 mr_free(string); … … 1017 1017 raidlist->el[raidlist->entries].raid_level = 10; 1018 1018 } else { 1019 log_msg(1, "Unknown RAID level '%s'.\n", token);1019 mr_msg(1, "Unknown RAID level '%s'.\n", token); 1020 1020 mr_free(string); 1021 1021 mr_free(token); … … 1061 1061 break; 1062 1062 default: // error 1063 log_msg(1, "Unknown device type '%c'\n", type);1063 mr_msg(1, "Unknown device type '%c'\n", type); 1064 1064 mr_free(string); 1065 1065 mr_free(token); … … 1153 1153 break; 1154 1154 default: // error 1155 log_msg(1, "Row %d should not occur in record!\n", row);1155 mr_msg(1, "Row %d should not occur in record!\n", row); 1156 1156 break; 1157 1157 } -
trunk/mondo/src/common/libmondo-stream.c
r1081 r1086 363 363 wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr); 364 364 } 365 log_msg(1, "Got xattr");365 mr_msg(1, "Got xattr"); 366 366 } 367 367 mr_free(fname); … … 390 390 wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr); 391 391 } 392 log_msg(1, "Got acl");392 mr_msg(1, "Got acl"); 393 393 } 394 394 mr_free(fname); … … 408 408 // tarball itself 409 409 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 410 log_msg(1, "now looking for afioball");410 mr_msg(1, "now looking for afioball"); 411 411 return (retval); 412 412 } … … 580 580 581 581 if (strncmp(tapedev, "/dev/", 5)) { 582 log_msg(1,582 mr_msg(1, 583 583 "Not using 'mt setblk'. This isn't an actual /dev entry."); 584 584 return (0); … … 910 910 // crctt=crc16=0; 911 911 where_I_was_before_tape_change = size; 912 log_msg(4, "where_I_was_... = %lld",912 mr_msg(4, "where_I_was_... = %lld", 913 913 where_I_was_before_tape_change); 914 914 start_to_read_from_next_tape(bkpinfo); 915 log_msg(4, "Started reading from next tape.");915 mr_msg(4, "Started reading from next tape."); 916 916 skip_incoming_files_until_we_find_this_one(temp_fname); 917 log_msg(4, "Skipped irrelevant files OK.");917 mr_msg(4, "Skipped irrelevant files OK."); 918 918 for (size = orig_size; size > where_I_was_before_tape_change; 919 919 size -= bytes_to_write) { … … 921 921 fread(datablock, 1, bytes_to_read, g_tape_stream); 922 922 } 923 log_msg(4, "'size' is now %lld (should be %lld)", size,923 mr_msg(4, "'size' is now %lld (should be %lld)", size, 924 924 where_I_was_before_tape_change); 925 925 log_to_screen("Successfully re-sync'd tape"); … … 938 938 #endif 939 939 } 940 log_msg(6, "Total read from tape for this file = %lld",940 mr_msg(6, "Total read from tape for this file = %lld", 941 941 total_read_from_tape_for_this_file); 942 log_msg(6, ".......................... Should be %lld", orig_size);942 mr_msg(6, ".......................... Should be %lld", orig_size); 943 943 g_tape_posK += total_read_from_tape_for_this_file / 1024; 944 944 mr_asprintf(&actual_cksum, "%04x%04x", crc16, crctt); … … 1027 1027 } 1028 1028 tempblock[i] = '\0'; 1029 log_msg(6, "%s (fname=%s, size=%ld K)",1029 mr_msg(6, "%s (fname=%s, size=%ld K)", 1030 1030 marker_to_string(*pcontrol_char), tempblock + 1000, 1031 1031 (long) (*plen) >> 10); … … 1141 1141 pB = the_file_I_was_reading; 1142 1142 } 1143 log_msg(1, "skip_incoming_..(%s)", pB);1144 log_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");1143 mr_msg(1, "skip_incoming_..(%s)", pB); 1144 mr_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE"); 1145 1145 ctrl_chr = -1; 1146 1146 while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) { … … 1151 1151 break; 1152 1152 } 1153 log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);1153 mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr); 1154 1154 wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr); 1155 log_msg(3, "Still trying to re-sync w/ tape");1155 mr_msg(3, "Still trying to re-sync w/ tape"); 1156 1156 mr_free(temp_fname); 1157 1157 temp_fname = (char *)&res; … … 1164 1164 break; 1165 1165 } 1166 log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);1166 mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr); 1167 1167 wrong_marker(BLK_START_FILE, ctrl_chr); 1168 log_msg(3, "Still trying to re-sync w/ tape");1168 mr_msg(3, "Still trying to re-sync w/ tape"); 1169 1169 /* Do not desallocate when the while condition is met */ 1170 1170 if (ctrl_chr != BLK_START_FILE) { … … 1186 1186 } 1187 1187 while (strcmp(pA, pB)) { 1188 log_msg(6, "Skipping %s (it's not %s)", temp_fname,1188 mr_msg(6, "Skipping %s (it's not %s)", temp_fname, 1189 1189 the_file_I_was_reading); 1190 1190 for (size = temp_size; size > 0; size -= bytes_to_write) { … … 1230 1230 */ 1231 1231 } 1232 log_msg(2, "Reading %s (it matches %s)", temp_fname,1232 mr_msg(2, "Reading %s (it matches %s)", temp_fname, 1233 1233 the_file_I_was_reading); 1234 1234 mr_free(temp_fname); … … 1275 1275 wrong_marker(BLK_START_OF_BACKUP, ctrlchr); 1276 1276 } else { 1277 log_msg(3, "Next tape opened OK. Whoopee!");1277 mr_msg(3, "Next tape opened OK. Whoopee!"); 1278 1278 } 1279 1279 return (res); … … 1350 1350 char *fname; 1351 1351 1352 log_msg(2, "I am now writing back catalog to tape");1352 mr_msg(2, "I am now writing back catalog to tape"); 1353 1353 last = g_tapecatalog->entries - 1; 1354 1354 for (i = 0; i <= last; i++) { … … 1356 1356 g_tapecatalog->el[i].fname); 1357 1357 if (!does_file_exist(fname)) { 1358 log_msg(6, "Can't write %s - it doesn't exist.", fname);1358 mr_msg(6, "Can't write %s - it doesn't exist.", fname); 1359 1359 } else { 1360 1360 write_header_block_to_stream(length_of_file(fname), 1361 1361 "start-backcatalog-afio-or-slice", 1362 1362 BLK_START_AN_AFIO_OR_SLICE); 1363 log_msg(2, "Writing %s", fname);1363 mr_msg(2, "Writing %s", fname); 1364 1364 if (write_file_to_stream_from_file(bkpinfo, fname)) { 1365 1365 res++; 1366 log_msg(2, "%s failed", fname);1366 mr_msg(2, "%s failed", fname); 1367 1367 } 1368 1368 if (i != last) { … … 1374 1374 mr_free(fname); 1375 1375 } 1376 log_msg(2, "Finished writing back catalog to tape");1376 mr_msg(2, "Finished writing back catalog to tape"); 1377 1377 return (res); 1378 1378 } … … 1606 1606 marker_to_string(control_char), p, 1607 1607 (long) length_of_incoming_file >> 10); 1608 log_msg(6, tmp);1608 mr_msg(6, tmp); 1609 1609 mr_free(tmp); 1610 1610 return (0); -
trunk/mondo/src/common/libmondo-tools.c
r1081 r1086 232 232 } 233 233 } 234 // log_msg(1, "tmp = '%s'", tmp);234 // mr_msg(1, "tmp = '%s'", tmp); 235 235 d = atof(tmp); 236 236 #endif 237 log_msg(1, "g_kernel_version = %f", d);237 mr_msg(1, "g_kernel_version = %f", d); 238 238 return (d); 239 239 } … … 368 368 1024; 369 369 370 log_msg(1, "Foo");370 mr_msg(1, "Foo"); 371 371 if (bkpinfo->backup_media_type == tape) { 372 log_msg(1, "Bar");372 mr_msg(1, "Bar"); 373 373 mr_asprintf(&tmp, "mt -f %s status", bkpinfo->media_device); 374 log_msg(1, "tmp = '%s'", tmp);374 mr_msg(1, "tmp = '%s'", tmp); 375 375 if (run_program_and_log_output(tmp, 3)) { 376 376 fatal_error … … 496 496 mr_free(command); 497 497 } 498 log_msg(2, "call_make_iso (DVD res) is ... %s",498 mr_msg(2, "call_make_iso (DVD res) is ... %s", 499 499 bkpinfo->call_make_iso); 500 500 } // end of DVD code … … 739 739 int i = 0; 740 740 741 log_msg(1, "Hi");741 mr_msg(1, "Hi"); 742 742 743 743 assert(bkpinfo != NULL); … … 1058 1058 else if (strstr(value, "/dev/") && strstr(value, "t0") 1059 1059 && !strcmp(label, "media-dev")) { 1060 log_msg(2, "FYI, I shan't read new value for %s - already got %s",1060 mr_msg(2, "FYI, I shan't read new value for %s - already got %s", 1061 1061 label, value); 1062 1062 return (0); … … 1114 1114 char *command; 1115 1115 1116 log_msg(1, "Started sub");1117 log_msg(4, "Setting command to something");1116 mr_msg(1, "Started sub"); 1117 mr_msg(4, "Setting command to something"); 1118 1118 mr_asprintf(&command, 1119 1119 "grep -v ':' /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1120 log_msg(4, "Cool. Command = '%s'", command);1120 mr_msg(4, "Cool. Command = '%s'", command); 1121 1121 tmp = call_program_and_get_last_line_of_output(command); 1122 1122 mr_free(command); 1123 1123 1124 log_msg(4, "tmp = '%s'", tmp);1124 mr_msg(4, "tmp = '%s'", tmp); 1125 1125 if (tmp) { 1126 1126 log_it("/boot is at %s according to /etc/fstab", tmp); … … 1129 1129 mr_free(g_boot_mountpt); 1130 1130 mr_asprintf(&g_boot_mountpt, "/boot"); 1131 log_msg(1, "Mounted /boot");1131 mr_msg(1, "Mounted /boot"); 1132 1132 } else { 1133 1133 log_it("...ignored cos it's a label :-)"); … … 1135 1135 } else { 1136 1136 mr_asprintf(&command, "mount | grep -E '^%s'", tmp); 1137 log_msg(3, "command = %s", command);1137 mr_msg(3, "command = %s", command); 1138 1138 if (run_program_and_log_output(command, 5)) { 1139 1139 mr_free(g_boot_mountpt); … … 1151 1151 mr_asprintf(&g_boot_mountpt, " "); 1152 1152 */ 1153 log_msg(1, "Plan B");1153 mr_msg(1, "Plan B"); 1154 1154 if (!run_program_and_log_output("mount /boot", 5)) { 1155 1155 mr_free(g_boot_mountpt); 1156 1156 mr_asprintf(&g_boot_mountpt, "/boot"); 1157 log_msg(1, "Plan B worked");1157 mr_msg(1, "Plan B worked"); 1158 1158 } else { 1159 log_msg(1,1159 mr_msg(1, 1160 1160 "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition."); 1161 1161 } … … 1167 1167 } 1168 1168 mr_free(tmp); 1169 log_msg(1, "Ended sub");1169 mr_msg(1, "Ended sub"); 1170 1170 } 1171 1171 … … 1178 1178 char *tmp; 1179 1179 1180 log_msg(3, "starting");1180 mr_msg(3, "starting"); 1181 1181 if (g_boot_mountpt != NULL) { 1182 1182 mr_asprintf(&tmp, "umount %s", g_boot_mountpt); … … 1186 1186 mr_free(tmp); 1187 1187 } 1188 log_msg(3, "leaving");1188 mr_msg(3, "leaving"); 1189 1189 } 1190 1190 … … 1291 1291 ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99"); 1292 1292 if (g_magicdev_command) { 1293 log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);1293 mr_msg(1, "g_magicdev_command = '%s'", g_magicdev_command); 1294 1294 paranoid_system("killall magicdev"); 1295 1295 } -
trunk/mondo/src/common/libmondo-verify.c
r1081 r1086 71 71 */ 72 72 73 log_msg(1, "Now scanning log file for 'afio: ' stuff");73 mr_msg(1, "Now scanning log file for 'afio: ' stuff"); 74 74 mr_asprintf(&command, 75 75 "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s", 76 76 stderr_fname, afio_found_changes); 77 log_msg(2, command);77 mr_msg(2, command); 78 78 res = system(command); 79 79 mr_free(command); 80 80 if (res) { 81 log_msg(2, "Warning - failed to think");82 } 83 84 log_msg(1, "Now scanning log file for 'star: ' stuff");81 mr_msg(2, "Warning - failed to think"); 82 } 83 84 mr_msg(1, "Now scanning log file for 'star: ' stuff"); 85 85 mr_asprintf(&command, 86 86 "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", 87 87 stderr_fname, afio_found_changes); 88 log_msg(2, command);88 mr_msg(2, command); 89 89 res = system(command); 90 90 mr_free(command); 91 91 if (res) { 92 log_msg(2, "Warning - failed to think");92 mr_msg(2, "Warning - failed to think"); 93 93 } 94 94 // exclude_nonexistent_files (afio_found_changes); … … 98 98 ignorefiles_fname, afio_found_changes, afio_found_changes, 99 99 changedfiles_fname); 100 log_msg(2, command);100 mr_msg(2, command); 101 101 paranoid_system(command); 102 102 mr_free(command); … … 144 144 if (g_last_afioball_number != set_number - 1) { 145 145 if (set_number == 0) { 146 log_msg(1,146 mr_msg(1, 147 147 "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more"); 148 148 } else { … … 163 163 does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets)); 164 164 total_sets++) { 165 log_msg(1, "total_sets = %d", total_sets);165 mr_msg(1, "total_sets = %d", total_sets); 166 166 } 167 167 for (; … … 172 172 g_last_afioball_number); 173 173 update_evalcall_form(percentage); 174 log_msg(1, "set = %d", set_number);174 mr_msg(1, "set = %d", set_number); 175 175 retval += 176 176 verify_an_afioball_from_CD(bkpinfo, … … 270 270 // handle slices until end of CD 271 271 if (slice_num == 0) { 272 log_msg(2, "ISO=%d bigfile=%ld --START--",272 mr_msg(2, "ISO=%d bigfile=%ld --START--", 273 273 g_current_media_number, bigfile_num); 274 274 if (!(fin = fopen(tmp1,"r"))) { 275 log_msg(2, "Cannot open bigfile's info file");275 mr_msg(2, "Cannot open bigfile's info file"); 276 276 } else { 277 277 if (fread 278 278 ((void *) &biggiestruct, 1, sizeof(biggiestruct), 279 279 fin) < sizeof(biggiestruct)) { 280 log_msg(2, "Unable to get biggiestruct");280 mr_msg(2, "Unable to get biggiestruct"); 281 281 } 282 282 paranoid_fclose(fin); … … 284 284 mr_asprintf(&tmp2, "%s/%s", bkpinfo->restore_path, 285 285 biggiestruct.filename); 286 log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2);286 mr_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2); 287 287 if (!(forig = fopen(tmp2, "r"))) { 288 log_msg(2, "Failed to open bigfile. Darn.");288 mr_msg(2, "Failed to open bigfile. Darn."); 289 289 retval++; 290 290 } … … 293 293 slice_num++; 294 294 } else if (does_file_exist(tmp1)) { 295 log_msg(2, "ISO=%d bigfile=%ld ---END---",295 mr_msg(2, "ISO=%d bigfile=%ld ---END---", 296 296 g_current_media_number, bigfile_num); 297 297 bigfile_num++; … … 299 299 slice_num = 0; 300 300 } else { 301 log_msg(2, "ISO=%d bigfile=%ld slice=%ld \r",301 mr_msg(2, "ISO=%d bigfile=%ld slice=%ld \r", 302 302 g_current_media_number, bigfile_num, slice_num); 303 303 if (bkpinfo->compression_level > 0) { … … 327 327 paranoid_pclose(pin); 328 328 if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) { 329 log_msg(3,329 mr_msg(3, 330 330 "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.", 331 331 biggiestruct.filename); 332 log_msg(3,332 mr_msg(3, 333 333 "If you really want verification for %s, please contact the devteam and offer an incentive.", 334 334 biggiestruct.filename); … … 336 336 } 337 337 if (res) { 338 log_msg(0,338 mr_msg(0, 339 339 "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c", 340 340 biggiestruct.filename); … … 405 405 if (strstr(tarball_fname, ".lzo") 406 406 && strcmp(bkpinfo->zip_suffix, "lzo")) { 407 log_msg(2, "OK, I'm going to start using lzop.");407 mr_msg(2, "OK, I'm going to start using lzop."); 408 408 mr_allocstr(bkpinfo->zip_exe, "lzop"); 409 409 mr_allocstr(bkpinfo->zip_suffix, "lzo"); … … 413 413 if (strstr(tarball_fname, ".gz") 414 414 && strcmp(bkpinfo->zip_suffix, "gz")) { 415 log_msg(2, "OK, I'm going to start using gzip.");415 mr_msg(2, "OK, I'm going to start using gzip."); 416 416 strcpy(bkpinfo->zip_exe, "gzip"); 417 417 strcpy(bkpinfo->zip_suffix, "gz"); … … 421 421 if (strstr(tarball_fname, ".bz2") 422 422 && strcmp(bkpinfo->zip_suffix, "bz2")) { 423 log_msg(2, "OK, I'm going to start using bzip2.");423 mr_msg(2, "OK, I'm going to start using bzip2."); 424 424 mr_allocstr(bkpinfo->zip_exe, "bzip2"); 425 425 mr_allocstr(bkpinfo->zip_suffix, "bz2"); … … 441 441 bkpinfo->zip_exe, tarball_fname, outlog, outlog); 442 442 } 443 log_msg(6, "command=%s", command);443 mr_msg(6, "command=%s", command); 444 444 paranoid_system(command); 445 445 mr_free(command); … … 462 462 if (strchr(tmp, '/')) { 463 463 if (!diffs) { 464 log_msg(0, "'%s' - differences found",464 mr_msg(0, "'%s' - differences found", 465 465 tarball_fname); 466 466 } 467 log_msg(0, "star: /%s",467 mr_msg(0, "star: /%s", 468 468 strip_afio_output_line(tmp)); 469 469 diffs++; … … 472 472 } else { 473 473 if (!diffs) { 474 log_msg(0, "'%s' - differences found",474 mr_msg(0, "'%s' - differences found", 475 475 tarball_fname); 476 476 } 477 log_msg(0, "afio: /%s", strip_afio_output_line(tmp));477 mr_msg(0, "afio: /%s", strip_afio_output_line(tmp)); 478 478 diffs++; 479 479 } … … 515 515 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); 516 516 517 log_msg(1, "Verifying %s", tarball_fname);517 mr_msg(1, "Verifying %s", tarball_fname); 518 518 if (!does_file_exist(tarball_fname)) { 519 519 fatal_error("Cannot verify nonexistent afioball"); … … 575 575 "Afioball '%s' no longer matches your live filesystem", 576 576 p); 577 log_msg(0, tmp);577 mr_msg(0, tmp); 578 578 mr_free(tmp); 579 579 retval++; … … 648 648 &ctrl_chr); 649 649 if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) { 650 log_msg(2, "test_file = %s", test_file);650 mr_msg(2, "test_file = %s", test_file); 651 651 wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr); 652 652 } … … 666 666 mr_asprintf(&tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum, 667 667 orig_cksum); 668 log_msg(2, tmp);668 mr_msg(2, tmp); 669 669 mr_free(tmp); 670 670 … … 795 795 fname = (char *) &res; 796 796 } 797 log_msg(1, "All done with afioballs");797 mr_msg(1, "All done with afioballs"); 798 798 close_progress_form(); 799 799 mr_free(fname); … … 867 867 } 868 868 noof_biggiefiles = (long) size; 869 log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);869 mr_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles); 870 870 open_progress_form(_("Verifying big files"), comment, 871 871 _("Please wait. This may take some time."), "", … … 956 956 "%s not found; assuming you backed up to CD; verifying CD...", 957 957 fname); 958 log_msg(2, tmp);958 mr_msg(2, tmp); 959 959 mr_free(tmp); 960 960 … … 995 995 mr_free(command); 996 996 } 997 log_msg(2, "OK, I've mounted the ISO/CD\n");997 mr_msg(2, "OK, I've mounted the ISO/CD\n"); 998 998 mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint); 999 999 if (!does_file_exist(tmp)) { 1000 log_msg1000 mr_msg 1001 1001 (2, 1002 1002 "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE."); … … 1033 1033 retval++; 1034 1034 } else { 1035 log_msg(2, "OK, I've unmounted the ISO file\n");1035 mr_msg(2, "OK, I've unmounted the ISO file\n"); 1036 1036 } 1037 1037 mr_free(command); … … 1045 1045 if (!bkpinfo->please_dont_eject 1046 1046 && eject_device(bkpinfo->media_device)) { 1047 log_msg(2, "Failed to eject CD-ROM drive");1047 mr_msg(2, "Failed to eject CD-ROM drive"); 1048 1048 } 1049 1049 } … … 1075 1075 assert(bkpinfo != NULL); 1076 1076 1077 log_msg(3, "verify_tape_backups --- starting");1077 mr_msg(3, "verify_tape_backups --- starting"); 1078 1078 log_to_screen(_("Verifying backups")); 1079 1079 openin_tape(bkpinfo); … … 1098 1098 (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE, 1099 1099 changed_files_fname); 1100 log_msg(2, "Running command to derive list of changed files");1101 log_msg(2, tmp);1100 mr_msg(2, "Running command to derive list of changed files"); 1101 mr_msg(2, tmp); 1102 1102 if (system(tmp)) { 1103 1103 if (does_file_exist(changed_files_fname) … … 1126 1126 "%ld files differed from live filesystem; type less %s or less %s to see", 1127 1127 diffs, changed_files_fname, "/tmp/changed.files"); 1128 log_msg(0, tmp);1128 mr_msg(0, tmp); 1129 1129 mr_free(tmp); 1130 1130 -
trunk/mondo/src/common/newt-specific.c
r1081 r1086 199 199 usleep(500000); 200 200 if (g_text_mode) { 201 log_msg(2, "Closing evalcall form");201 mr_msg(2, "Closing evalcall form"); 202 202 return; 203 203 } … … 219 219 } 220 220 if (g_current_progress == -999) { 221 log_msg(2,221 mr_msg(2, 222 222 "Trying to close the progress form when it ain't open!"); 223 223 return; … … 227 227 sleep(1); 228 228 if (g_text_mode) { 229 log_msg(2, "Closing progress form");229 mr_msg(2, "Closing progress form"); 230 230 return; 231 231 } … … 270 270 set_signals(FALSE); // link to external func 271 271 g_exiting = TRUE; 272 log_msg(1, "%s - '%s'", fatalstr, error_string);272 mr_msg(1, "%s - '%s'", fatalstr, error_string); 273 273 printf("%s - %s\n", fatalstr, error_string); 274 274 if (getpid() == g_mastermind_pid) { 275 log_msg(2, "mastermind %d is exiting", (int) getpid());275 mr_msg(2, "mastermind %d is exiting", (int) getpid()); 276 276 kill(g_main_pid, SIGTERM); 277 277 finish(1); … … 280 280 if (getpid() != g_main_pid) { 281 281 if (g_mastermind_pid != 0 && getpid() != g_mastermind_pid) { 282 log_msg(2, "non-m/m %d is exiting", (int) getpid());282 mr_msg(2, "non-m/m %d is exiting", (int) getpid()); 283 283 kill(g_main_pid, SIGTERM); 284 284 finish(1); … … 286 286 } 287 287 288 log_msg(3, "OK, I think I'm the main PID.");288 mr_msg(3, "OK, I think I'm the main PID."); 289 289 if (already_exiting) { 290 log_msg(3, "...I'm already exiting. Give me time, Julian!");290 mr_msg(3, "...I'm already exiting. Give me time, Julian!"); 291 291 finish(1); 292 292 } 293 293 294 294 already_exiting = TRUE; 295 log_msg(2, "I'm going to do some cleaning up now.");295 mr_msg(2, "I'm going to do some cleaning up now."); 296 296 paranoid_system("killall mindi 2> /dev/null"); 297 297 kill_anything_like_this("/mondo/do-not"); … … 303 303 chdir("/"); 304 304 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 305 log_msg(2, "Waiting for child processes to terminate");305 mr_msg(2, "Waiting for child processes to terminate"); 306 306 sleep(1); 307 307 run_program_and_log_output(tmp, 5); … … 323 323 324 324 if (!g_text_mode) { 325 log_msg(0, fatalstr);326 log_msg(0, error_string);325 mr_msg(0, fatalstr); 326 mr_msg(0, error_string); 327 327 newtFinished(); 328 328 } … … 337 337 register_pid(0, "mondo"); // finish() does this too, FYI 338 338 if (!g_main_pid) { 339 log_msg(3, "FYI - g_main_pid is blank");339 mr_msg(3, "FYI - g_main_pid is blank"); 340 340 } 341 341 finish(254); … … 371 371 if (!g_text_mode) { 372 372 if (does_file_exist("/THIS-IS-A-RAMDISK")) { 373 log_msg(1, "Calling newtFinished()");373 mr_msg(1, "Calling newtFinished()"); 374 374 newtFinished(); 375 375 } else { 376 log_msg(1, "Calling newtSuspend()");376 mr_msg(1, "Calling newtSuspend()"); 377 377 newtSuspend(); 378 378 } … … 465 465 va_start(args, fmt); 466 466 mr_asprintf(&output, fmt, args); 467 log_msg(0, output);467 mr_msg(0, output); 468 468 if (strlen(output) > 80) { 469 469 output[80] = '\0'; … … 508 508 mvaddstr_and_log_it(int y, int x, char *output) { 509 509 assert_string_is_neither_NULL_nor_zerolength(output); 510 log_msg(0, output);510 mr_msg(0, output); 511 511 if (g_text_mode) { 512 512 printf("%s\n", output); … … 541 541 // center_string (title, 80); 542 542 if (g_text_mode) { 543 log_msg(0, title);543 mr_msg(0, title); 544 544 } else { 545 545 mr_asprintf(&tmp, title); … … 553 553 g_isoform_starttime = get_time(); 554 554 if (g_text_mode) { 555 log_msg(0, g_isoform_header_str);555 mr_msg(0, g_isoform_header_str); 556 556 } else { 557 557 g_isoform_header = newtLabel(1, 1, g_isoform_header_str); … … 618 618 mr_asprintf(&g_blurb_str_3, blurb2); 619 619 if (g_text_mode) { 620 log_msg(0, blurb1);621 log_msg(0, blurb2);622 log_msg(0, blurb3);620 mr_msg(0, blurb1); 621 mr_msg(0, blurb2); 622 mr_msg(0, blurb3); 623 623 } else { 624 624 g_blurb1 = newtLabel(2, 1, blurb1); … … 654 654 assert_string_is_neither_NULL_nor_zerolength(prompt); 655 655 656 log_msg(0, prompt);656 mr_msg(0, prompt); 657 657 if (g_text_mode) { 658 658 printf … … 1054 1054 char *p; 1055 1055 1056 // log_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);1056 // mr_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3); 1057 1057 if (!g_text_mode) { 1058 1058 assert(blurb1 != NULL); … … 1072 1072 blurb1, blurb2, blurb3, g_current_progress, 1073 1073 g_maximum_progress); 1074 log_msg(0, tmp);1074 mr_msg(0, tmp); 1075 1075 mr_free(tmp); 1076 1076 g_current_progress = g_maximum_progress; … … 1123 1123 1124 1124 if (percentage > 100) { 1125 log_msg(2, _("percentage = %d"), percentage);1125 mr_msg(2, _("percentage = %d"), percentage); 1126 1126 } 1127 1127 mr_asprintf(&taskprogress, … … 1340 1340 if (!(fin = fopen(source_file, "r"))) { 1341 1341 log_OS_error(source_file); 1342 log_msg(2, "Can't open %s; therefore, cannot popup list",1342 mr_msg(2, "Can't open %s; therefore, cannot popup list", 1343 1343 source_file); 1344 1344 return (1); 1345 1345 } 1346 log_msg(2, "Loading %s", source_file);1346 mr_msg(2, "Loading %s", source_file); 1347 1347 for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM; 1348 1348 filelist->entries++) { … … 1404 1404 (void *) &dummy_fle, 1405 1405 sizeof(struct s_filelist_entry)); 1406 log_msg(2, "Swapping %s and %s",1406 mr_msg(2, "Swapping %s and %s", 1407 1407 filelist->el[i].filename, 1408 1408 filelist->el[i + 1].filename); … … 1478 1478 assert_string_is_neither_NULL_nor_zerolength(source_file); 1479 1479 if (g_text_mode) { 1480 log_msg(2, "Text mode. Therefore, no popup list.");1480 mr_msg(2, "Text mode. Therefore, no popup list."); 1481 1481 return; 1482 1482 } 1483 log_msg(2, "Examining file %s", source_file);1483 mr_msg(2, "Examining file %s", source_file); 1484 1484 1485 1485 lng = count_lines_in_file(source_file); 1486 1486 if (lng < 1) { 1487 log_msg(2, "No lines in file. Therefore, no popup list.");1487 mr_msg(2, "No lines in file. Therefore, no popup list."); 1488 1488 return; 1489 1489 } else if (lng >= ARBITRARY_MAXIMUM) { 1490 log_msg(2, "Too many files differ for me to list.");1490 mr_msg(2, "Too many files differ for me to list."); 1491 1491 return; 1492 1492 } … … 1498 1498 1499 1499 if (load_filelist_into_array(filelist, source_file)) { 1500 log_msg(2, "Can't open %s; therefore, cannot popup list",1500 mr_msg(2, "Can't open %s; therefore, cannot popup list", 1501 1501 source_file); 1502 1502 return; 1503 1503 } 1504 log_msg(2, "%d files loaded into filelist array",1504 mr_msg(2, "%d files loaded into filelist array", 1505 1505 filelist->entries); 1506 1506 for (i = 0; i < filelist->entries; i++) { -
trunk/mondo/src/mondoarchive/main.c
r1081 r1086 53 53 void welcome_to_mondoarchive() 54 54 { 55 log_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",55 mr_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org", 56 56 PACKAGE_VERSION); 57 log_msg(0, "running on %s architecture", get_architecture());58 log_msg(0,57 mr_msg(0, "running on %s architecture", get_architecture()); 58 mr_msg(0, 59 59 "-----------------------------------------------------------"); 60 log_msg(0,60 mr_msg(0, 61 61 "NB: Mondo logs almost everything, so don't panic if you see"); 62 log_msg(0,62 mr_msg(0, 63 63 "some error messages. Please read them carefully before you"); 64 log_msg(0,64 mr_msg(0, 65 65 "decide to break out in a cold sweat. Despite (or perhaps"); 66 log_msg(0,66 mr_msg(0, 67 67 "because of) the wealth of messages. some users are inclined"); 68 log_msg(0,68 mr_msg(0, 69 69 "to stop reading this log. If Mondo stopped for some reason,"); 70 log_msg(0,70 mr_msg(0, 71 71 "chances are it's detailed here. More than likely there's a"); 72 log_msg(0,72 mr_msg(0, 73 73 "message at the very end of this log that will tell you what"); 74 log_msg(0,74 mr_msg(0, 75 75 "is wrong. Please read it! -Devteam"); 76 log_msg(0,76 mr_msg(0, 77 77 "-----------------------------------------------------------"); 78 78 79 log_msg(0, "Zero...");80 log_msg(1, "One...");81 log_msg(2, "Two...");82 log_msg(3, "Three...");83 log_msg(4, "Four...");84 log_msg(5, "Five...");85 log_msg(6, "Six...");86 log_msg(7, "Seven...");87 log_msg(8, "Eight...");79 mr_msg(0, "Zero..."); 80 mr_msg(1, "One..."); 81 mr_msg(2, "Two..."); 82 mr_msg(3, "Three..."); 83 mr_msg(4, "Four..."); 84 mr_msg(5, "Five..."); 85 mr_msg(6, "Six..."); 86 mr_msg(7, "Seven..."); 87 mr_msg(8, "Eight..."); 88 88 printf("See %s for details of backup run.\n", MONDO_LOGFILE); 89 89 } … … 96 96 void distro_specific_kludges_at_start_of_mondoarchive() 97 97 { 98 log_msg(2, "Unmounting old ramdisks if necessary");98 mr_msg(2, "Unmounting old ramdisks if necessary"); 99 99 stop_magicdev_if_necessary(); // for RH+Gnome users 100 100 run_program_and_log_output … … 111 111 void distro_specific_kludges_at_end_of_mondoarchive() 112 112 { 113 log_msg(2, "Restarting magicdev if necessary");113 mr_msg(2, "Restarting magicdev if necessary"); 114 114 sync(); 115 115 restart_magicdev_if_necessary(); // for RH+Gnome users 116 116 117 log_msg(2, "Restarting supermounts if necessary");117 mr_msg(2, "Restarting supermounts if necessary"); 118 118 sync(); 119 119 remount_supermounts_if_necessary(); // for Mandrake users 120 120 121 log_msg(2, "Unmounting /boot if necessary");121 mr_msg(2, "Unmounting /boot if necessary"); 122 122 sync(); 123 123 unmount_boot_if_necessary(); // for Gentoo users … … 181 181 /* initialize log file with time stamp */ 182 182 unlink(MONDO_LOGFILE); 183 log_msg(0, "Time started: %s", mr_date()); 183 mr_msg_init(MONDO_LOGFILE,4); 184 mr_msg(0, "Time started: %s", mr_date()); 184 185 185 186 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ … … 196 197 /* Configure the bkpinfo structure, global file paths, etc. */ 197 198 g_main_pid = getpid(); 198 log_msg(9, "This");199 mr_msg(9, "This"); 199 200 200 201 register_pid(g_main_pid, "mondo"); … … 203 204 run_program_and_log_output("dmesg -n1", TRUE); 204 205 205 log_msg(9, "Next");206 mr_msg(9, "Next"); 206 207 welcome_to_mondoarchive(); 207 208 distro_specific_kludges_at_start_of_mondoarchive(); … … 324 325 (_("Errors were detected in the command line you supplied.\n")); 325 326 printf(_("Please review the log file - %s \n"),MONDO_LOGFILE); 326 log_msg(1, "Mondoarchive will now exit.");327 mr_msg(1, "Mondoarchive will now exit."); 327 328 finish(1); 328 329 } … … 388 389 (_("Type 'less /tmp/changed.files' to see which files don't match the archives")); 389 390 } else { 390 log_msg(1,391 mr_msg(1, 391 392 _("Type 'less /tmp/changed.files' to see which files don't match the archives")); 392 log_msg(2, "Calling popup_changelist_from_file()");393 mr_msg(2, "Calling popup_changelist_from_file()"); 393 394 popup_changelist_from_file("/tmp/changed.files"); 394 log_msg(2, "Returned from popup_changelist_from_file()");395 mr_msg(2, "Returned from popup_changelist_from_file()"); 395 396 } 396 397 } else { … … 431 432 432 433 /* finalize log file with time stamp */ 433 log_msg(0, "Time finished: %s", mr_date());434 mr_msg(0, "Time finished: %s", mr_date()); 434 435 435 436 if (!g_text_mode) { -
trunk/mondo/src/mondoarchive/mondo-cli.c
r1081 r1086 92 92 { 93 93 */ 94 log_msg(3, "Switches:-");94 mr_msg(3, "Switches:-"); 95 95 for (i = 0; i < 128; i++) { 96 96 if (flag_set[i]) { 97 97 mr_asprintf(&tmp, "-%c %s", i, flag_val[i]); 98 log_msg(3, tmp);98 mr_msg(3, tmp); 99 99 mr_free(tmp); 100 100 } … … 162 162 mr_asprintf(&comment, "media_size[%d] = %ld", j, 163 163 bkpinfo->media_size[j]); 164 log_msg(3, comment);164 mr_msg(3, comment); 165 165 mr_free(comment); 166 166 } … … 170 170 for (j = 1; j <= MAX_NOOF_MEDIA; j++) { 171 171 if (bkpinfo->media_size[j] <= 0) { 172 log_msg(1, "You gave media #%d an invalid size\n", j);172 mr_msg(1, "You gave media #%d an invalid size\n", j); 173 173 return (-1); 174 174 } … … 252 252 if (tmp1) { 253 253 flag_set['R'] = TRUE; 254 log_msg(1, "Using star instead of afio");254 mr_msg(1, "Using star instead of afio"); 255 255 } else { 256 256 fatal_error … … 286 286 if (flag_set['I']) { 287 287 if (!strcmp(bkpinfo->include_paths, "/")) { 288 log_msg(2, "'/' is pleonastic.");288 mr_msg(2, "'/' is pleonastic."); 289 289 bkpinfo->include_paths = NULL; 290 290 } … … 299 299 *q = '\0'; 300 300 if (stat(p, &buf) != 0) { 301 log_msg(1, "ERROR ! %s doesn't exist", p);301 mr_msg(1, "ERROR ! %s doesn't exist", p); 302 302 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 303 303 } … … 305 305 } else { 306 306 if (stat(p, &buf) != 0) { 307 log_msg(1, "ERROR ! %s doesn't exist", p);307 mr_msg(1, "ERROR ! %s doesn't exist", p); 308 308 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 309 309 } … … 321 321 mr_free(tmp1); 322 322 323 log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);323 mr_msg(1, "include_paths is now '%s'", bkpinfo->include_paths); 324 324 if (bkpinfo->include_paths[0] == '-') { 325 325 retval++; … … 373 373 } 374 374 } else { 375 log_msg(3, "flag_val['c'] = %s", flag_val['c']);376 log_msg(3, "flag_val['w'] = %s", flag_val['w']);375 mr_msg(3, "flag_val['c'] = %s", flag_val['c']); 376 mr_msg(3, "flag_val['w'] = %s", flag_val['w']); 377 377 if (flag_set['c']) { 378 378 bkpinfo->cdrw_speed = atoi(flag_val['c']); … … 492 492 log_to_screen(_("NFS share is not mounted. Please mount it.\n")); 493 493 } 494 log_msg(3, "mount = %s", bkpinfo->nfs_mount);495 log_msg(3, "isodir= %s", bkpinfo->isodir);494 mr_msg(3, "mount = %s", bkpinfo->nfs_mount); 495 mr_msg(3, "isodir= %s", bkpinfo->isodir); 496 496 } 497 497 … … 556 556 /* End of bug fix */ 557 557 if (stat(p, &buf) != 0) { 558 log_msg(1, "WARNING ! %s doesn't exist", p);558 mr_msg(1, "WARNING ! %s doesn't exist", p); 559 559 } 560 560 p = q+1 ; 561 561 } else { 562 562 if (stat(p, &buf) != 0) { 563 log_msg(1, "WARNING ! %s doesn't exist", p);563 mr_msg(1, "WARNING ! %s doesn't exist", p); 564 564 } 565 565 p = NULL; … … 593 593 mr_free(tmp1); 594 594 595 log_msg(3, "-N means we're now excluding %s",595 mr_msg(3, "-N means we're now excluding %s", 596 596 bkpinfo->exclude_paths); 597 597 } … … 599 599 if (flag_set['b']) { 600 600 mr_asprintf(&psz, flag_val['b']); 601 log_msg(1, "psz = '%s'", psz);601 mr_msg(1, "psz = '%s'", psz); 602 602 if (psz[strlen(psz) - 1] == 'k') { 603 603 psz[strlen(psz) - 1] = '\0'; … … 608 608 mr_free(psz); 609 609 610 log_msg(1, "'%s' --> %ld", flag_val['b'], itbs);611 log_msg(1, "Internal tape block size is now %ld bytes", itbs);610 mr_msg(1, "'%s' --> %ld", flag_val['b'], itbs); 611 mr_msg(1, "Internal tape block size is now %ld bytes", itbs); 612 612 if (itbs % 512 != 0 || itbs < 256 || itbs > 1024L * 1024) { 613 613 fatal_error … … 776 776 (BOOT_LOADER_CHARS, 777 777 (bkpinfo->boot_loader = flag_val['l'][0]))) { 778 log_msg(1, "%c? What is %c? I need G, L, E or R.",778 mr_msg(1, "%c? What is %c? I need G, L, E or R.", 779 779 bkpinfo->boot_loader, bkpinfo->boot_loader); 780 780 fatal_error … … 795 795 } 796 796 i = which_boot_loader(tmp); 797 log_msg(3, "boot loader is %c, residing at %s", i, tmp);797 mr_msg(3, "boot loader is %c, residing at %s", i, tmp); 798 798 printf(_("boot loader is %c, residing at %s\n"), i, tmp); 799 799 mr_free(tmp); … … 973 973 void help_screen() 974 974 { 975 log_msg(1, "Type 'man mondo-archive' for more information\n");975 mr_msg(1, "Type 'man mondo-archive' for more information\n"); 976 976 exit(1); 977 977 } … … 1065 1065 void termination_in_progress(int sig) 1066 1066 { 1067 log_msg(1, "Termination in progress");1067 mr_msg(1, "Termination in progress"); 1068 1068 usleep(1000); 1069 1069 pthread_exit(0); -
trunk/mondo/src/mondorestore/mondo-prep.c
r1081 r1086 68 68 drivelist->el[lino].device, MONDO_WAS_HERE); 69 69 if (!run_program_and_log_output(command, 1)) { 70 log_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",70 mr_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)", 71 71 lino, drivelist->el[lino].device); 72 72 mr_free(command); … … 90 90 fout = fopen(drivelist->el[lino].device, "w+"); 91 91 if (!fout) { 92 log_msg(1, "Unable to open+wipe %s",92 mr_msg(1, "Unable to open+wipe %s", 93 93 drivelist->el[lino].device); 94 94 } else { 95 95 if (1 != fwrite(buf, strlen(buf)+1, 1, fout)) { 96 log_msg(1, "Failed to wipe %s",96 mr_msg(1, "Failed to wipe %s", 97 97 drivelist->el[lino].device); 98 98 } else { 99 log_msg(1, "Successfully wiped %s",99 mr_msg(1, "Successfully wiped %s", 100 100 drivelist->el[lino].device); 101 101 } … … 114 114 } 115 115 // Still here? Cool! 116 log_msg(1, "Cool. I didn't have to wipe anything.");116 mr_msg(1, "Cool. I didn't have to wipe anything."); 117 117 } 118 118 … … 126 126 return (-1); 127 127 } 128 log_msg(5, "Writing string '%s', one char at a time", str);128 mr_msg(5, "Writing string '%s', one char at a time", str); 129 129 j = strlen(str); 130 130 for (i = 0; i < j; i++) { 131 log_msg(6, "Writing %d ('%c')", str[i], str[i]);131 mr_msg(6, "Writing %d ('%c')", str[i], str[i]); 132 132 if ((fq = fopen(FDISK_LOG, "a+"))) { 133 133 fputc(str[i], fq); … … 141 141 } 142 142 } 143 log_msg(5, "Returning");143 mr_msg(5, "Returning"); 144 144 145 145 return (i); … … 198 198 199 199 iamhere("STARTING"); 200 log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");200 mr_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes..."); 201 201 tmp = find_home_of_exe("lvm"); 202 202 if (tmp) // found it :) cool … … 239 239 if (just_erase_existing_volumes) { 240 240 paranoid_fclose(fin); 241 log_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");241 mr_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs."); 242 242 sync(); 243 243 sync(); … … 245 245 sleep(1); 246 246 iamhere("ENDING"); 247 log_msg(1, "Not many errors. Returning 0.");247 mr_msg(1, "Not many errors. Returning 0."); 248 248 return (0); 249 249 } 250 250 251 log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");251 mr_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff..."); 252 252 rewind(fin); 253 253 for (mr_getline(&incoming, &n1, fin); !feof(fin); mr_getline(&incoming, &n1, fin)) { … … 286 286 for (q = tmp1; *q > 32; q++); 287 287 *q = '\0'; 288 log_msg(1, "Deleting old entries at /dev/%s", tmp1);288 mr_msg(1, "Deleting old entries at /dev/%s", tmp1); 289 289 mr_asprintf(&tmp, "rm -Rf /dev/%s", tmp1); 290 290 mr_free(tmp1); … … 295 295 run_program_and_log_output(vgscan_sz, 1); 296 296 run_program_and_log_output(pvscan_sz, 1); 297 log_msg(3,297 mr_msg(3, 298 298 "After working around potentially broken i-want-my-lvm, incoming[] is now '%s'", 299 299 incoming); … … 311 311 res = run_program_and_log_output(command, 5); 312 312 } 313 log_msg(0, "%s --> %d", command, res);313 mr_msg(0, "%s --> %d", command, res); 314 314 if (res > 0) { 315 315 res = 1; … … 333 333 for (p = tmp; *p != '\0' && !isdigit(*p); p++); 334 334 extents = atol(p); 335 log_msg(5, "p='%s' --> extents=%ld", p, extents);335 mr_msg(5, "p='%s' --> extents=%ld", p, extents); 336 336 mr_free(tmp); 337 337 338 338 p = strstr(command, "-L"); 339 339 if (!p) { 340 log_msg(0, "Fiddlesticks. '%s' returned %d", command, res);340 mr_msg(0, "Fiddlesticks. '%s' returned %d", command, res); 341 341 } else { 342 342 if (lvmversion == 2) { … … 363 363 *(p + i) = ' '; 364 364 } 365 log_msg(5, "Retrying with '%s'", command);365 mr_msg(5, "Retrying with '%s'", command); 366 366 res = run_program_and_log_output(command, 5); 367 367 if (res > 0) { … … 371 371 fprintf(g_fprep, "%s\n", command); 372 372 } 373 log_msg(0, "%s --> %d", command, res);373 mr_msg(0, "%s --> %d", command, res); 374 374 if (!res) { 375 log_msg(5, "YAY! This time, it succeeded.");375 mr_msg(5, "YAY! This time, it succeeded."); 376 376 } 377 377 } 378 378 } 379 379 if (strstr(command, "vgcreate")) { 380 log_msg(0, "In case you're interested...");380 mr_msg(0, "In case you're interested..."); 381 381 run_program_and_log_output(vgscan_sz, 1); 382 382 run_program_and_log_output(pvscan_sz, 1); … … 396 396 mr_free(incoming); 397 397 398 log_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");398 mr_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff."); 399 399 sync(); 400 400 sync(); … … 403 403 iamhere("ENDING"); 404 404 if (retval > 2) { 405 log_msg(1, "%d errors. I'm reporting this.", retval);405 mr_msg(1, "%d errors. I'm reporting this.", retval); 406 406 return (retval); 407 407 } else { 408 log_msg(1, "Not many errors. Returning 0.");408 mr_msg(1, "Not many errors. Returning 0."); 409 409 return (0); 410 410 } … … 550 550 // leave straight away if raidlist is initial or has no entries 551 551 if (!raidlist || raidlist->entries == 0) { 552 log_msg(1, "No RAID arrays found.");552 mr_msg(1, "No RAID arrays found."); 553 553 return 1; 554 554 } else { 555 log_msg(1, "%d RAID arrays found.", raidlist->entries);555 mr_msg(1, "%d RAID arrays found.", raidlist->entries); 556 556 } 557 557 // find raidlist entry for requested device … … 561 561 // check whether RAID device was found in raidlist 562 562 if (i == raidlist->entries) { 563 log_msg(1, "RAID device %s not found in list.", device);563 mr_msg(1, "RAID device %s not found in list.", device); 564 564 return 1; 565 565 } … … 805 805 */ 806 806 807 log_msg(1, "Making %s", device);807 mr_msg(1, "Making %s", device); 808 808 // use mkraid if it exists, otherwise use mdadm 809 809 if (run_program_and_log_output("which mkraid", FALSE)) { 810 810 res = create_raid_device_via_mdadm(raidlist, device); 811 log_msg(1, "Creating RAID device %s via mdadm returned %d",811 mr_msg(1, "Creating RAID device %s via mdadm returned %d", 812 812 device, res); 813 813 } else { 814 814 mr_asprintf(&program, "mkraid --really-force %s", device); 815 815 res = run_program_and_log_output(program, 1); 816 log_msg(1, "%s returned %d", program, res);816 mr_msg(1, "%s returned %d", program, res); 817 817 sync(); 818 818 sleep(3); … … 834 834 835 835 if (!strcmp(format, "lvm")) { 836 log_msg(1, "Don't format %s - it's part of an lvm volume", device);836 mr_msg(1, "Don't format %s - it's part of an lvm volume", device); 837 837 return (0); 838 838 } … … 937 937 // start soft-raids now (because LVM might depend on them) 938 938 // ...and for simplicity's sake, let's format them at the same time :) 939 log_msg(1, "Stopping all RAID devices");939 mr_msg(1, "Stopping all RAID devices"); 940 940 stop_all_raid_devices(mountlist); 941 941 sync(); … … 943 943 sync(); 944 944 sleep(2); 945 log_msg(1, "Prepare soft-RAIDs"); // prep and format too945 mr_msg(1, "Prepare soft-RAIDs"); // prep and format too 946 946 for (lino = 0; lino < mountlist->entries; lino++) { 947 947 me = &mountlist->el[lino]; // the current mountlist entry 948 log_msg(2, "Examining %s", me->device);948 mr_msg(2, "Examining %s", me->device); 949 949 if (!strncmp(me->device, "/dev/md", 7)) { 950 950 if (interactively) { … … 974 974 // sleep(5); 975 975 // do LVMs now 976 log_msg(1, "Creating LVMs");976 mr_msg(1, "Creating LVMs"); 977 977 if (does_file_exist("/tmp/i-want-my-lvm")) { 978 978 wait_until_software_raids_are_prepped("/proc/mdstat", 100); … … 997 997 // do regulars at last 998 998 sleep(2); // woo! 999 log_msg(1, "Formatting regulars");999 mr_msg(1, "Formatting regulars"); 1000 1000 for (lino = 0; lino < mountlist->entries; lino++) { 1001 1001 me = &mountlist->el[lino]; // the current mountlist entry … … 1677 1677 sync(); 1678 1678 paranoid_pclose(pout_to_fdisk); 1679 log_msg(0,1679 mr_msg(0, 1680 1680 "------------------- fdisk.log looks like this ------------------"); 1681 1681 mr_asprintf(&tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE); … … 1683 1683 mr_free(tmp); 1684 1684 1685 log_msg(0,1685 mr_msg(0, 1686 1686 "------------------- end of fdisk.log... word! ------------------"); 1687 1687 mr_asprintf(&tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG); … … 1803 1803 if (partsize > 0) { 1804 1804 if (!strcmp(format, "7")) { 1805 log_msg(1, "Adding 512K, just in case");1805 mr_msg(1, "Adding 512K, just in case"); 1806 1806 partsize += 512; 1807 1807 } … … 1829 1829 1830 1830 if (pout_to_fdisk) { 1831 log_msg(1, "Doing the new all-in-one fdisk thing");1832 log_msg(1, "output = '%s'", output);1831 mr_msg(1, "Doing the new all-in-one fdisk thing"); 1832 mr_msg(1, "output = '%s'", output); 1833 1833 fput_string_one_char_at_a_time(pout_to_fdisk, output); 1834 1834 fput_string_one_char_at_a_time(pout_to_fdisk, "\n\np\n"); 1835 1835 tmp = last_line_of_file(FDISK_LOG); 1836 1836 if (strstr(tmp, " (m ")) { 1837 log_msg(1, "Successfully created %s%d", drive, partno);1837 mr_msg(1, "Successfully created %s%d", drive, partno); 1838 1838 } else { 1839 log_msg(1, "last line = %s", tmp);1840 log_msg(1, "Failed to create %s%d; sending 'Enter'...", drive,1839 mr_msg(1, "last line = %s", tmp); 1840 mr_msg(1, "Failed to create %s%d; sending 'Enter'...", drive, 1841 1841 partno); 1842 1842 } … … 1844 1844 1845 1845 if (!retval) { 1846 log_msg(1, "Trying to set %s%d's partition type now", drive,1846 mr_msg(1, "Trying to set %s%d's partition type now", drive, 1847 1847 partno); 1848 1848 retval = … … 1850 1850 partsize); 1851 1851 if (retval) { 1852 log_msg(1, "Failed. Trying again...");1852 mr_msg(1, "Failed. Trying again..."); 1853 1853 retval = 1854 1854 set_partition_type(pout_to_fdisk, drive, partno, … … 1857 1857 } 1858 1858 if (retval) { 1859 log_msg(1, "...but failed to set type");1859 mr_msg(1, "...but failed to set type"); 1860 1860 } 1861 1861 } else { … … 1959 1959 /* mountlist=&new_mtlist; */ 1960 1960 /* extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */ 1961 log_msg(0,1961 mr_msg(0, 1962 1962 "Mountlist, including the partitions incorporated in RAID devices:-"); 1963 1963 for (i = 0; i < mountlist->entries; i++) { 1964 1964 log_it(mountlist->el[i].device); 1965 1965 } 1966 log_msg(0, "End of mountlist.");1967 } 1968 log_msg(0, "Stopping all LVMs, just in case");1966 mr_msg(0, "End of mountlist."); 1967 } 1968 mr_msg(0, "Stopping all LVMs, just in case"); 1969 1969 if (!g_text_mode) { 1970 1970 newtSuspend(); … … 1974 1974 newtResume(); 1975 1975 } 1976 log_msg(0, "Stopping all software RAID devices, just in case");1976 mr_msg(0, "Stopping all software RAID devices, just in case"); 1977 1977 stop_all_raid_devices(mountlist); 1978 log_msg(0, "Done.");1978 mr_msg(0, "Done."); 1979 1979 1980 1980 /* … … 2096 2096 mr_free(partition); 2097 2097 2098 log_msg(1, tmp);2098 mr_msg(1, tmp); 2099 2099 mr_free(tmp); 2100 2100 if (partcode[0] != '\0' && strcmp(partcode, "83")) { /* no need to set type if 83: 83 is default */ … … 2106 2106 if (partno > 1 2107 2107 || strstr(tmp1, " (1-4)")) { 2108 log_msg(5, "Specifying partno (%d) - yay", partno);2108 mr_msg(5, "Specifying partno (%d) - yay", partno); 2109 2109 mr_asprintf(&tmp, "%d\n", partno); 2110 2110 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); … … 2112 2112 mr_free(tmp1); 2113 2113 tmp1 = last_line_of_file(FDISK_LOG); 2114 log_msg(5, "A - last line = '%s'", tmp1);2114 mr_msg(5, "A - last line = '%s'", tmp1); 2115 2115 } 2116 2116 mr_free(tmp1); … … 2120 2120 mr_free(tmp); 2121 2121 tmp1 = last_line_of_file(FDISK_LOG); 2122 log_msg(5, "B - last line = '%s'",tmp1);2122 mr_msg(5, "B - last line = '%s'",tmp1); 2123 2123 mr_free(tmp1); 2124 2124 2125 2125 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); 2126 2126 tmp1 = last_line_of_file(FDISK_LOG); 2127 log_msg(5, "C - last line = '%s'",tmp1);2127 mr_msg(5, "C - last line = '%s'",tmp1); 2128 2128 mr_free(tmp1); 2129 2129 2130 2130 tmp = last_line_of_file(FDISK_LOG); 2131 2131 if (!strstr(tmp, " (m ")) { 2132 log_msg(1, "last line = '%s'; part type set failed", tmp);2132 mr_msg(1, "last line = '%s'; part type set failed", tmp); 2133 2133 res++; 2134 2134 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); … … 2140 2140 mr_asprintf(&command, "parted2fdisk %s >> %s 2>> %s", drive, 2141 2141 MONDO_LOGFILE, MONDO_LOGFILE); 2142 log_msg(5, "output = '%s'", output);2143 log_msg(5, "partno=%d; partcode=%s", partno, partcode);2144 log_msg(5, "command = '%s'", command);2142 mr_msg(5, "output = '%s'", output); 2143 mr_msg(5, "partno=%d; partcode=%s", partno, partcode); 2144 mr_msg(5, "command = '%s'", command); 2145 2145 fout = popen(command, "w"); 2146 2146 if (!fout) { … … 2189 2189 mr_asprintf(&program, "raidstart %s", raid_device); 2190 2190 #endif 2191 log_msg(1, "program = %s", program);2191 mr_msg(1, "program = %s", program); 2192 2192 res = run_program_and_log_output(program, 1); 2193 2193 if (g_fprep) { … … 2197 2197 2198 2198 if (res) { 2199 log_msg(1, "Warning - failed to start RAID device %s",2199 mr_msg(1, "Warning - failed to start RAID device %s", 2200 2200 raid_device); 2201 2201 } … … 2238 2238 } 2239 2239 #endif 2240 log_msg(1, "program = %s", program);2240 mr_msg(1, "program = %s", program); 2241 2241 res = run_program_and_log_output(program, 1); 2242 2242 if (g_fprep) { … … 2246 2246 2247 2247 if (res) { 2248 log_msg(1, "Warning - failed to stop RAID device %s", raid_device);2248 mr_msg(1, "Warning - failed to stop RAID device %s", raid_device); 2249 2249 } 2250 2250 retval += res; … … 2263 2263 (mountlist->el[i].device, RAID_DEVICE_STUB, 2264 2264 strlen(RAID_DEVICE_STUB))) { 2265 log_msg(1, "Starting %s", mountlist->el[i].device);2265 mr_msg(1, "Starting %s", mountlist->el[i].device); 2266 2266 res = start_raid_device(mountlist->el[i].device); 2267 2267 retval += res; … … 2269 2269 } 2270 2270 if (retval) { 2271 log_msg(1, "Started all s/w raid devices OK");2271 mr_msg(1, "Started all s/w raid devices OK"); 2272 2272 } else { 2273 log_msg(1, "Failed to start some/all s/w raid devices");2273 mr_msg(1, "Failed to start some/all s/w raid devices"); 2274 2274 } 2275 2275 return (retval); … … 2346 2346 paranoid_fclose(fin); 2347 2347 if (retval) { 2348 log_msg(1, "Warning - unable to stop some RAID devices");2348 mr_msg(1, "Warning - unable to stop some RAID devices"); 2349 2349 } 2350 2350 sync(); … … 2548 2548 2549 2549 if (!strcmp(drivemntlist->el[partno]->mountpoint, "image")) { 2550 log_msg(1, "Skipping %s (%s) because it's an image",2550 mr_msg(1, "Skipping %s (%s) because it's an image", 2551 2551 drivemntlist->el[partno]->device, 2552 2552 drivemntlist->el[partno]->mountpoint); … … 2626 2626 assert(drivemntlist != NULL); 2627 2627 2628 log_msg(1, "Creating list of partitions for drive %s", drive_name);2628 mr_msg(1, "Creating list of partitions for drive %s", drive_name); 2629 2629 2630 2630 mr_asprintf(&tmp_drive_name,drive_name); -
trunk/mondo/src/mondorestore/mondo-restore.c
r1081 r1086 155 155 int retval = 0, res = 0; 156 156 157 log_msg(2, "let_user_edit_the_mountlist() --- starting");157 mr_msg(2, "let_user_edit_the_mountlist() --- starting"); 158 158 159 159 assert(bkpinfo != NULL); … … 162 162 if (!bkpinfo->disaster_recovery) { 163 163 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); 164 log_msg(2, "I guess you're testing edit_mountlist()");164 mr_msg(2, "I guess you're testing edit_mountlist()"); 165 165 } 166 166 if (!does_file_exist(g_mountlist_fname)) { … … 207 207 for (i = 0; i < mountlist->entries; i++) { 208 208 if (strstr(mountlist->el[i].format, "ompaq")) { 209 log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",209 mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)", 210 210 i, mountlist->el[i].device, mountlist->el[i].format); 211 211 … … 286 286 if (bkpinfo->backup_media_type == iso) { 287 287 if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) { 288 log_msg(2,288 mr_msg(2, 289 289 "catchall_mode --- iso_fiddly_bits returned w/ error"); 290 290 return (1); 291 291 } else { 292 log_msg(2, "catchall_mode --- iso_fiddly_bits ok");292 mr_msg(2, "catchall_mode --- iso_fiddly_bits ok"); 293 293 } 294 294 } 295 295 296 296 if (c == 'I') { 297 log_msg(2, "IM selected");297 mr_msg(2, "IM selected"); 298 298 retval += interactive_mode(bkpinfo, mountlist, raidlist); 299 299 } else if (c == 'N') { 300 log_msg(2, "NM selected");300 mr_msg(2, "NM selected"); 301 301 retval += nuke_mode(bkpinfo, mountlist, raidlist); 302 302 } else if (c == 'C') { 303 log_msg(2, "CM selected");303 mr_msg(2, "CM selected"); 304 304 retval += compare_mode(bkpinfo, mountlist, raidlist); 305 305 } … … 351 351 /* try to partition and format */ 352 352 353 log_msg(2, "interactive_mode --- starting (great, assertions OK)");353 mr_msg(2, "interactive_mode --- starting (great, assertions OK)"); 354 354 355 355 assert(bkpinfo != NULL); … … 357 357 assert(raidlist != NULL); 358 358 359 log_msg(2, "interactive_mode --- assertions OK");359 mr_msg(2, "interactive_mode --- assertions OK"); 360 360 361 361 if (g_text_mode) { … … 378 378 #endif 379 379 if (strstr(tmp,"noresize")) { 380 log_msg(1, "Not resizing mountlist.");380 mr_msg(1, "Not resizing mountlist."); 381 381 } else { 382 382 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 400 400 paranoid_MR_finish(1); 401 401 } 402 log_msg(2, "Proceeding...");402 mr_msg(2, "Proceeding..."); 403 403 save_mountlist_to_disk(mountlist, g_mountlist_fname); 404 404 save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME); … … 496 496 ("Do you want me to restore all of your data?")))) 497 497 { 498 log_msg(1, "Restoring all data");498 mr_msg(1, "Restoring all data"); 499 499 retval += restore_everything(bkpinfo, NULL); 500 500 } else if ((restore_all = … … 520 520 mr_allocstr(bkpinfo->restore_path, ""); // so we restore to [blank]/file/name :) 521 521 } 522 log_msg(1, "Restoring subset");522 mr_msg(1, "Restoring subset"); 523 523 retval += restore_everything(bkpinfo, filelist); 524 524 free_filelist(filelist); … … 626 626 assert(raidlist != NULL); 627 627 if (iso_fiddly_bits(bkpinfo, nuke_me_please)) { 628 log_msg(1, "iso_mode --- returning w/ error");628 mr_msg(1, "iso_mode --- returning w/ error"); 629 629 return (1); 630 630 } else { … … 726 726 assert(raidlist != NULL); 727 727 728 log_msg(2, "nuke_mode --- starting");728 mr_msg(2, "nuke_mode --- starting"); 729 729 730 730 get_cfg_file_from_archive_or_bust(bkpinfo); … … 736 736 #endif 737 737 if (strstr(tmp,"noresize")) { 738 log_msg(2, "Not resizing mountlist.");738 mr_msg(2, "Not resizing mountlist."); 739 739 } else { 740 740 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 776 776 #endif 777 777 if (strstr(tmp,"nopart")) { 778 log_msg(2,778 mr_msg(2, 779 779 "Not partitioning drives due to 'nopart' option."); 780 780 res = 0; … … 829 829 retval += restore_everything(bkpinfo, NULL); 830 830 if (!run_boot_loader(FALSE)) { 831 log_msg(1,831 mr_msg(1, 832 832 "Great! Boot loader was installed. No need for msg at end."); 833 833 boot_loader_installed = TRUE; … … 907 907 struct s_node *filelist = NULL; 908 908 909 log_msg(1, "restore_to_live_filesystem() - starting");909 mr_msg(1, "restore_to_live_filesystem() - starting"); 910 910 assert(bkpinfo != NULL); 911 911 … … 922 922 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); 923 923 if (bkpinfo->media_device == NULL) { 924 log_msg(2, "Warning - failed to find media dev");924 mr_msg(2, "Warning - failed to find media dev"); 925 925 } else { 926 log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);927 } 928 929 930 log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);926 mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device); 927 } 928 929 930 mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir); 931 931 932 932 open_evalcall_form(_("Thinking...")); … … 953 953 } 954 954 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 955 log_msg(2,955 mr_msg(2, 956 956 "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway."); 957 957 } … … 1038 1038 if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) < 1039 1039 sizeof(biggiestruct)) { 1040 log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",1040 mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d", 1041 1041 bigfileno + 1); 1042 1042 } … … 1048 1048 mr_asprintf(&tmp, "Warning - bigfile %ld does not have a checksum", 1049 1049 bigfileno + 1); 1050 log_msg(3, tmp);1050 mr_msg(3, tmp); 1051 1051 mr_free(tmp); 1052 1052 /* BERLIOS : Useless ??? … … 1068 1068 node = find_string_at_node(filelist, biggiestruct.filename); 1069 1069 if (!node) { 1070 log_msg(0, "Skipping %s (name isn't in filelist)",1070 mr_msg(0, "Skipping %s (name isn't in filelist)", 1071 1071 biggiestruct.filename); 1072 1072 return (pathname_of_last_file_restored); 1073 1073 } else if (!(node->selected)) { 1074 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1074 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1075 1075 biggiestruct.filename); 1076 1076 return (pathname_of_last_file_restored); … … 1079 1079 /* otherwise, continue */ 1080 1080 1081 log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);1081 mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename); 1082 1082 if (biggiestruct.use_ntfsprog) { 1083 1083 if (strncmp(biggiestruct.filename, "/dev/", 5)) { 1084 log_msg(1,1084 mr_msg(1, 1085 1085 "I was in error when I set biggiestruct.use_ntfsprog to TRUE."); 1086 log_msg(1, "%s isn't even in /dev", biggiestruct.filename);1086 mr_msg(1, "%s isn't even in /dev", biggiestruct.filename); 1087 1087 biggiestruct.use_ntfsprog = FALSE; 1088 1088 } … … 1094 1094 g_loglevel = 4; 1095 1095 use_ntfsprog_hack = TRUE; 1096 log_msg(2,1096 mr_msg(2, 1097 1097 "Calling ntfsclone in background because %s is an NTFS /dev entry", 1098 1098 outfile_fname); … … 1106 1106 fatal_error("Fork failure"); 1107 1107 case 0: 1108 log_msg(3,1108 mr_msg(3, 1109 1109 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1110 1110 biggiestruct.filename, ntfsprog_fifo); … … 1112 1112 feed_outfrom_ntfsprog(biggiestruct.filename, 1113 1113 ntfsprog_fifo); 1114 // log_msg(3, "CHILD - fip - exiting");1114 // mr_msg(3, "CHILD - fip - exiting"); 1115 1115 exit(res); 1116 1116 break; 1117 1117 default: 1118 log_msg(3,1118 mr_msg(3, 1119 1119 "feed_into_ntfsprog() called in background --- pid=%ld", 1120 1120 (long int) (pid)); … … 1133 1133 mr_asprintf(&tmp, "Reassembling big file %ld (%s)", bigfileno + 1, 1134 1134 outfile_fname); 1135 log_msg(2, tmp);1135 mr_msg(2, tmp); 1136 1136 mr_free(tmp); 1137 1137 … … 1144 1144 mr_asprintf(&pathname_of_last_file_restored, biggiestruct.filename); 1145 1145 1146 log_msg(3, "file_to_openout = %s", file_to_openout);1146 mr_msg(3, "file_to_openout = %s", file_to_openout); 1147 1147 if (!(fout = fopen(file_to_openout, "w"))) { 1148 1148 log_to_screen(_("Cannot openout outfile_fname - hard disk full?")); 1149 1149 return (pathname_of_last_file_restored); 1150 1150 } 1151 log_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself1151 mr_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself 1152 1152 1153 1153 for (sliceno = 1, finished = FALSE; !finished;) { … … 1160 1160 !does_file_exist(tmp1) && 1161 1161 !does_file_exist(tmp2)) { 1162 log_msg(3,1162 mr_msg(3, 1163 1163 "Cannot find a data slice or terminator slice on CD %d", 1164 1164 g_current_media_number); … … 1168 1168 bkpinfo->backup_media_string, 1169 1169 g_current_media_number, sliceno); 1170 log_msg(2, tmp3);1170 mr_msg(2, tmp3); 1171 1171 mr_free(tmp3); 1172 1172 … … 1181 1181 } else { 1182 1182 if (does_file_exist(tmp) && length_of_file(tmp) == 0) { 1183 log_msg(2,1183 mr_msg(2, 1184 1184 "End of bigfile # %ld (slice %ld is the terminator)", 1185 1185 bigfileno + 1, sliceno); … … 1207 1207 bkpinfo->backup_media_string, 1208 1208 g_current_media_number, bigfileno + 1, sliceno); 1209 log_msg(2, tmp3);1209 mr_msg(2, tmp3); 1210 1210 if (!g_text_mode) { 1211 1211 newtDrawRootText(0, g_noof_rows - 2, tmp3); … … 1243 1243 1244 1244 if (use_ntfsprog_hack) { 1245 log_msg(3, "Waiting for ntfsclone to finish");1245 mr_msg(3, "Waiting for ntfsclone to finish"); 1246 1246 mr_asprintf(&tmp, 1247 1247 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1321 1321 if (use_ntfsprog == BLK_START_A_PIHBIGGIE) { 1322 1322 use_ntfsprog = 1; 1323 log_msg(1, "%s --- pih=YES", orig_bf_fname);1323 mr_msg(1, "%s --- pih=YES", orig_bf_fname); 1324 1324 } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) { 1325 1325 use_ntfsprog = 0; 1326 log_msg(1, "%s --- pih=NO", orig_bf_fname);1326 mr_msg(1, "%s --- pih=NO", orig_bf_fname); 1327 1327 } else { 1328 1328 use_ntfsprog = 0; 1329 log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);1329 mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname); 1330 1330 } 1331 1331 … … 1338 1338 if (!node) { 1339 1339 dummy_restore = TRUE; 1340 log_msg(1,1340 mr_msg(1, 1341 1341 "Skipping big file %ld (%s) - not in biggielist subset", 1342 1342 biggiefile_number + 1, orig_bf_fname); … … 1344 1344 } else if (!(node->selected)) { 1345 1345 dummy_restore = TRUE; 1346 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1346 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1347 1347 orig_bf_fname); 1348 1348 pathname_of_last_file_restored = NULL; … … 1352 1352 if (use_ntfsprog) { 1353 1353 if (strncmp(orig_bf_fname, "/dev/", 5)) { 1354 log_msg(1, "I was in error when I set use_ntfsprog to TRUE.");1355 log_msg(1, "%s isn't even in /dev", orig_bf_fname);1354 mr_msg(1, "I was in error when I set use_ntfsprog to TRUE."); 1355 mr_msg(1, "%s isn't even in /dev", orig_bf_fname); 1356 1356 use_ntfsprog = FALSE; 1357 1357 } … … 1362 1362 mr_asprintf(&outfile_fname, orig_bf_fname); 1363 1363 use_ntfsprog_hack = TRUE; 1364 log_msg(2,1364 mr_msg(2, 1365 1365 "Calling ntfsclone in background because %s is a /dev entry", 1366 1366 outfile_fname); … … 1376 1376 fatal_error("Fork failure"); 1377 1377 case 0: 1378 log_msg(3,1378 mr_msg(3, 1379 1379 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1380 1380 outfile_fname, ntfsprog_fifo); 1381 1381 res = feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo); 1382 // log_msg(3, "CHILD - fip - exiting");1382 // mr_msg(3, "CHILD - fip - exiting"); 1383 1383 exit(res); 1384 1384 break; 1385 1385 default: 1386 log_msg(3,1386 mr_msg(3, 1387 1387 "feed_into_ntfsprog() called in background --- pid=%ld", 1388 1388 (long int) (pid)); … … 1406 1406 mr_asprintf(&tmp1, "Reassembling big file %ld (%s)", 1407 1407 biggiefile_number + 1, orig_bf_fname); 1408 log_msg(2, tmp1);1408 mr_msg(2, tmp1); 1409 1409 mr_free(tmp1); 1410 1410 } … … 1422 1422 } 1423 1423 mr_asprintf(&tmp1, "Pipe command = '%s'", command); 1424 log_msg(3, tmp1);1424 mr_msg(3, tmp1); 1425 1425 mr_free(tmp1); 1426 1426 … … 1439 1439 mr_asprintf(&tmp1, "Working on file #%ld, slice #%ld ", 1440 1440 biggiefile_number + 1, current_slice_number); 1441 log_msg(2, tmp1);1441 mr_msg(2, tmp1); 1442 1442 1443 1443 if (!g_text_mode) { … … 1460 1460 ((void *) &biggiestruct, 1, sizeof(biggiestruct), 1461 1461 fin) < sizeof(biggiestruct)) { 1462 log_msg(2,1462 mr_msg(2, 1463 1463 "Warning - unable to get biggiestruct of bigfile #%d", 1464 1464 biggiefile_number + 1); … … 1481 1481 paranoid_pclose(pout); 1482 1482 1483 log_msg(1, "pathname_of_last_file_restored is now %s",1483 mr_msg(1, "pathname_of_last_file_restored is now %s", 1484 1484 pathname_of_last_file_restored); 1485 1485 1486 1486 if (use_ntfsprog_hack) { 1487 log_msg(3, "Waiting for ntfsclone to finish");1487 mr_msg(3, "Waiting for ntfsclone to finish"); 1488 1488 mr_asprintf(&tmp, 1489 1489 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1492 1492 } 1493 1493 mr_free(tmp); 1494 log_msg(3, "OK, ntfsclone has really finished");1495 } 1496 1497 log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);1498 log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);1494 mr_msg(3, "OK, ntfsclone has really finished"); 1495 } 1496 1497 mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename); 1498 mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum); 1499 1499 if (strcmp(outfile_fname, "/dev/null")) { 1500 1500 chmod(outfile_fname, biggiestruct.properties.st_mode); … … 1550 1550 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); 1551 1551 1552 log_msg(5, "Entering");1552 mr_msg(5, "Entering"); 1553 1553 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; 1554 1554 mr_asprintf(&command, "mkdir -p %s/tmp", MNT_RESTORING); … … 1559 1559 current_tarball_number); 1560 1560 if (length_of_file(filelist_name) <= 2) { 1561 log_msg(2, "There are _zero_ files in filelist '%s'",1561 mr_msg(2, "There are _zero_ files in filelist '%s'", 1562 1562 filelist_name); 1563 log_msg(2,1563 mr_msg(2, 1564 1564 "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)"); 1565 log_msg(2,1565 mr_msg(2, 1566 1566 "but it's non-critical. It's cosmetic. Don't worry about it."); 1567 1567 retval = 0; 1568 log_msg(5, "Leaving");1568 mr_msg(5, "Leaving"); 1569 1569 return (retval); 1570 1570 } 1571 1571 if (count_lines_in_file(filelist_name) <= 0 1572 1572 || length_of_file(tarball_fname) <= 0) { 1573 log_msg(3, "length_of_file(%s) = %llu", tarball_fname,1573 mr_msg(3, "length_of_file(%s) = %llu", tarball_fname, 1574 1574 length_of_file(tarball_fname)); 1575 1575 mr_asprintf(&tmp, "Unable to restore fileset #%ld (CD I/O error)", … … 1578 1578 mr_free(tmp); 1579 1579 retval = 1; 1580 log_msg(5, "Leaving");1580 mr_msg(5, "Leaving"); 1581 1581 return (retval); 1582 1582 } … … 1591 1591 <= 0) { 1592 1592 mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number); 1593 log_msg(1, tmp);1593 mr_msg(1, tmp); 1594 1594 mr_free(tmp); 1595 1595 } else { 1596 log_msg(3, "Saved fileset %ld's subset to %s",1596 mr_msg(3, "Saved fileset %ld's subset to %s", 1597 1597 current_tarball_number, filelist_subset_fname); 1598 1598 } … … 1678 1678 1679 1679 #undef BUFSIZE 1680 log_msg(1, "command = '%s'", command);1680 mr_msg(1, "command = '%s'", command); 1681 1681 unlink(temp_log); 1682 1682 res = system(command); … … 1685 1685 if (p) { 1686 1686 p[0] = p[1] = p[2] = p[3] = ' '; 1687 log_msg(1, "new command = '%s'", command);1687 mr_msg(1, "new command = '%s'", command); 1688 1688 res = system(command); 1689 1689 } … … 1696 1696 1697 1697 if (g_getfattr) { 1698 log_msg(1, "Setting fattr list %s", xattr_fname);1698 mr_msg(1, "Setting fattr list %s", xattr_fname); 1699 1699 if (length_of_file(xattr_fname) > 0) { 1700 1700 res = set_fattr_list(filelist_subset_fname, xattr_fname); … … 1703 1703 ("Errors occurred while setting extended attributes"); 1704 1704 } else { 1705 log_msg(1, "I set xattr OK");1705 mr_msg(1, "I set xattr OK"); 1706 1706 } 1707 1707 retval += res; … … 1709 1709 } 1710 1710 if (g_getfacl) { 1711 log_msg(1, "Setting acl list %s", acl_fname);1711 mr_msg(1, "Setting acl list %s", acl_fname); 1712 1712 if (length_of_file(acl_fname) > 0) { 1713 1713 res = set_acl_list(filelist_subset_fname, acl_fname); … … 1716 1716 ("Errors occurred while setting access control lists"); 1717 1717 } else { 1718 log_msg(1, "I set ACL OK");1718 mr_msg(1, "I set ACL OK"); 1719 1719 } 1720 1720 retval += res; … … 1725 1725 system(command); 1726 1726 mr_free(command); 1727 log_msg(2, "Errors occurred while processing fileset #%d",1727 mr_msg(2, "Errors occurred while processing fileset #%d", 1728 1728 current_tarball_number); 1729 1729 } else { 1730 log_msg(2, "Fileset #%d processed OK", current_tarball_number);1730 mr_msg(2, "Fileset #%d processed OK", current_tarball_number); 1731 1731 } 1732 1732 unlink(xattr_fname); … … 1745 1745 mr_free(acl_fname); 1746 1746 mr_free(temp_log); 1747 log_msg(5, "Leaving");1747 mr_msg(5, "Leaving"); 1748 1748 return (retval); 1749 1749 } … … 1800 1800 bkpinfo->backup_media_string, 1801 1801 g_current_media_number); 1802 log_msg(2, tmp);1802 mr_msg(2, tmp); 1803 1803 mr_free(tmp); 1804 1804 run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE); … … 1820 1820 } 1821 1821 if (res) { 1822 log_msg(1, "Warning - error reading afioball from tape");1822 mr_msg(1, "Warning - error reading afioball from tape"); 1823 1823 } 1824 1824 if (bkpinfo->compression_level != 0) { … … 1843 1843 executable, afio_fname, filelist_fname, MONDO_LOGFILE); 1844 1844 } 1845 log_msg(1, "command = %s", command);1845 mr_msg(1, "command = %s", command); 1846 1846 if (system(command)) { 1847 log_msg(4, "Warning - error occurred while retrieving TOC");1847 mr_msg(4, "Warning - error occurred while retrieving TOC"); 1848 1848 } 1849 1849 mr_free(command); … … 1854 1854 <= 0 || length_of_file(filelist_subset_fname) < 2) { 1855 1855 if (length_of_file(filelist_subset_fname) < 2) { 1856 log_msg(1, "No matches found in fileset %ld",1856 mr_msg(1, "No matches found in fileset %ld", 1857 1857 current_tarball_number); 1858 1858 } 1859 1859 mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number); 1860 log_msg(2, tmp);1860 mr_msg(2, tmp); 1861 1861 mr_free(tmp); 1862 1862 restore_this_fileset = FALSE; 1863 1863 } else { 1864 log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",1864 mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s", 1865 1865 matches, current_tarball_number, 1866 1866 filelist_subset_fname); … … 1892 1892 // Call if IF there are files to restore (selectively/unconditionally) 1893 1893 if (restore_this_fileset) { 1894 log_msg(1, "Calling command='%s'", command);1894 mr_msg(1, "Calling command='%s'", command); 1895 1895 paranoid_system(command); 1896 1896 … … 1899 1899 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1900 1900 if (res) { 1901 log_msg(1, "Errors occurred while setting xattr");1901 mr_msg(1, "Errors occurred while setting xattr"); 1902 1902 } else { 1903 log_msg(1, "I set xattr OK");1903 mr_msg(1, "I set xattr OK"); 1904 1904 } 1905 1905 retval += res; … … 1910 1910 res = set_acl_list(filelist_subset_fname, acl_fname); 1911 1911 if (res) { 1912 log_msg(1, "Errors occurred while setting ACL");1912 mr_msg(1, "Errors occurred while setting ACL"); 1913 1913 } else { 1914 log_msg(1, "I set ACL OK");1914 mr_msg(1, "I set ACL OK"); 1915 1915 } 1916 1916 retval += res; … … 1918 1918 1919 1919 } else { 1920 log_msg(1, "NOT CALLING '%s'", command);1920 mr_msg(1, "NOT CALLING '%s'", command); 1921 1921 } 1922 1922 mr_free(command); … … 1970 1970 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 1971 1971 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 1972 log_msg(1, "Warning - cannot openout %s",1972 mr_msg(1, "Warning - cannot openout %s", 1973 1973 biggies_whose_EXATs_we_should_set); 1974 1974 } … … 1983 1983 1984 1984 if (length_of_file(BIGGIELIST) < 6) { 1985 log_msg(1, "OK, no biggielist; not restoring biggiefiles");1985 mr_msg(1, "OK, no biggielist; not restoring biggiefiles"); 1986 1986 return (0); 1987 1987 } 1988 1988 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 1989 1989 if (noof_biggiefiles <= 0) { 1990 log_msg(2,1990 mr_msg(2, 1991 1991 "OK, no biggiefiles in biggielist; not restoring biggiefiles"); 1992 1992 return (0); … … 1994 1994 mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives", 1995 1995 noof_biggiefiles); 1996 log_msg(2, tmp);1996 mr_msg(2, tmp); 1997 1997 mr_free(tmp); 1998 1998 … … 2002 2002 "", total_slices); 2003 2003 for (bigfileno = 0, finished = FALSE; !finished;) { 2004 log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);2004 mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1); 2005 2005 tmp = slice_fname(bigfileno, 0, ARCHIVES_PATH, ""); 2006 2006 if (!does_file_exist(tmp)) { 2007 log_msg(3,2007 mr_msg(3, 2008 2008 "...but its first slice isn't on this CD. Perhaps this was a selective restore?"); 2009 log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",2009 mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d", 2010 2010 bigfileno + 1, 2011 2011 bkpinfo->backup_media_string, 2012 2012 g_current_media_number); 2013 2013 tmp1 = slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""); 2014 log_msg(3, "Slicename would have been %s", tmp1);2014 mr_msg(3, "Slicename would have been %s", tmp1); 2015 2015 mr_free(tmp1); 2016 2016 … … 2018 2018 if (just_changed_cds) { 2019 2019 just_changed_cds = FALSE; 2020 log_msg(3,2020 mr_msg(3, 2021 2021 "I'll continue to scan this CD for bigfiles to be restored."); 2022 2022 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { … … 2031 2031 just_changed_cds = TRUE; 2032 2032 } else { 2033 log_msg(2, "There was no bigfile #%ld. That's OK.",2033 mr_msg(2, "There was no bigfile #%ld. That's OK.", 2034 2034 bigfileno + 1); 2035 log_msg(2, "I'm going to stop restoring bigfiles now.");2035 mr_msg(2, "I'm going to stop restoring bigfiles now."); 2036 2036 finished = TRUE; 2037 2037 } … … 2122 2122 2123 2123 mvaddstr_and_log_it(g_currentY, 0, _("Restoring from archives")); 2124 log_msg(2,2124 mr_msg(2, 2125 2125 "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER"); 2126 2126 if (g_current_media_number != 1) { 2127 log_msg(3, "OK, that's jacked up.");2127 mr_msg(3, "OK, that's jacked up."); 2128 2128 g_current_media_number = 1; 2129 2129 } … … 2199 2199 bkpinfo->backup_media_string, 2200 2200 g_current_media_number); 2201 // log_msg(3, "progress_str = %s", progress_str);2201 // mr_msg(3, "progress_str = %s", progress_str); 2202 2202 for (res = 999, attempts = 0; attempts < 3 && res != 0; 2203 2203 attempts++) { … … 2299 2299 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 2300 2300 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 2301 log_msg(1, "Warning - cannot openout %s",2301 mr_msg(1, "Warning - cannot openout %s", 2302 2302 biggies_whose_EXATs_we_should_set); 2303 2303 } … … 2315 2315 mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives", 2316 2316 noof_biggiefiles); 2317 log_msg(2, tmp);2317 mr_msg(2, tmp); 2318 2318 mr_free(tmp); 2319 2319 … … 2350 2350 current_bigfile_number, 2351 2351 filelist, ctrl_chr); 2352 log_msg(1, "I believe I have restored %s",2352 mr_msg(1, "I believe I have restored %s", 2353 2353 pathname_of_last_biggie_restored); 2354 2354 if (fbw && pathname_of_last_biggie_restored[0]) { … … 2370 2370 noof_biggiefiles, current_bigfile_number); 2371 2371 } 2372 log_msg(1, tmp);2372 mr_msg(1, tmp); 2373 2373 mr_free(tmp); 2374 2374 … … 2379 2379 if (g_getfattr) { 2380 2380 if (length_of_file(xattr_fname) > 0) { 2381 log_msg(1, "set_fattr_List(%s,%s)",2381 mr_msg(1, "set_fattr_List(%s,%s)", 2382 2382 biggies_whose_EXATs_we_should_set, xattr_fname); 2383 2383 set_fattr_list(biggies_whose_EXATs_we_should_set, … … 2387 2387 if (g_getfacl) { 2388 2388 if (length_of_file(acl_fname) > 0) { 2389 log_msg(1, "set_acl_list(%s,%s)",2389 mr_msg(1, "set_acl_list(%s,%s)", 2390 2390 biggies_whose_EXATs_we_should_set, acl_fname); 2391 2391 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname); … … 2469 2469 progress_str, max_val); 2470 2470 2471 log_msg(3, "hey");2471 mr_msg(3, "hey"); 2472 2472 2473 2473 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2474 2474 if (res) { 2475 log_msg(2, "Warning - error reading afioball from tape");2475 mr_msg(2, "Warning - error reading afioball from tape"); 2476 2476 } 2477 2477 retval += res; … … 2479 2479 wrong_marker(BLK_START_AFIOBALLS, ctrl_chr); 2480 2480 } 2481 log_msg(2, "ho");2481 mr_msg(2, "ho"); 2482 2482 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2483 2483 while (ctrl_chr != BLK_STOP_AFIOBALLS) { … … 2548 2548 mr_free(tmp_fname); 2549 2549 2550 log_msg(1, "All done with afioballs");2550 mr_msg(1, "All done with afioballs"); 2551 2551 close_progress_form(); 2552 2552 if (retval) { … … 2586 2586 malloc_string(cwd); 2587 2587 malloc_string(newpath); 2588 log_msg(2, "restore_everything() --- starting");2588 mr_msg(2, "restore_everything() --- starting"); 2589 2589 g_current_media_number = 1; 2590 2590 /* BERLIOS: should test return value, or better change the function */ … … 2594 2594 mr_free(tmp); 2595 2595 2596 log_msg(1, "Changing dir to %s", bkpinfo->restore_path);2596 mr_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2597 2597 chdir(bkpinfo->restore_path); 2598 2598 /* BERLIOS: should test return value, or better change the function */ 2599 2599 getcwd(newpath, MAX_STR_LEN - 1); 2600 log_msg(1, "path is now %s", newpath);2601 log_msg(1, "restoring everything");2600 mr_msg(1, "path is now %s", newpath); 2601 mr_msg(1, "restoring everything"); 2602 2602 tmp = find_home_of_exe("petris"); 2603 2603 if (!tmp && !g_text_mode) { … … 2642 2642 } 2643 2643 if (length_of_file("/etc/raidtab") > 0) { 2644 log_msg(2, "Copying local raidtab to restored filesystem");2644 mr_msg(2, "Copying local raidtab to restored filesystem"); 2645 2645 run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING 2646 2646 "/etc/raidtab", FALSE); 2647 2647 } 2648 2648 kill_petris(); 2649 log_msg(2, "restore_everything() --- leaving");2649 mr_msg(2, "restore_everything() --- leaving"); 2650 2650 mr_free(cwd); 2651 2651 mr_free(newpath); … … 2690 2690 sprintf(tmp, "restore_here = '%s'", restore_here); 2691 2691 2692 log_msg(2, tmp);2693 2694 log_msg(2, "restore_live_from_monitas_server() - starting");2692 mr_msg(2, tmp); 2693 2694 mr_msg(2, "restore_live_from_monitas_server() - starting"); 2695 2695 unlink("/tmp/mountlist.txt"); 2696 2696 unlink("/tmp/filelist.full"); … … 2701 2701 strcpy(bkpinfo->restore_path, restore_here); 2702 2702 } 2703 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2703 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2704 2704 sprintf(tmp, "FYI - data will be restored to %s", 2705 2705 bkpinfo->restore_path); 2706 log_msg(3, tmp);2707 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2706 mr_msg(3, tmp); 2707 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2708 2708 sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d", 2709 2709 (int) (random() % 32768)); … … 2756 2756 restore_this_directory, g_biggielist_txt, g_biggielist_txt); 2757 2757 if (system(command)) { 2758 log_msg(1,2758 mr_msg(1, 2759 2759 "Error(s) occurred while processing biggielist and wildcard"); 2760 2760 } … … 2764 2764 retval += restore_everything(bkpinfo, filelist); 2765 2765 free_filelist(filelist); 2766 log_msg(2, "--------End of restore_live_from_monitas_server--------");2766 mr_msg(2, "--------End of restore_live_from_monitas_server--------"); 2767 2767 return (retval); 2768 2768 } … … 2785 2785 void welcome_to_mondorestore() 2786 2786 { 2787 log_msg(0, "-------------- Mondo Restore v%s -------------",2787 mr_msg(0, "-------------- Mondo Restore v%s -------------", 2788 2788 PACKAGE_VERSION); 2789 log_msg(0,2789 mr_msg(0, 2790 2790 "DON'T PANIC! Mondorestore logs almost everything, so please "); 2791 log_msg(0,2791 mr_msg(0, 2792 2792 "don't break out in a cold sweat just because you see a few "); 2793 log_msg(0,2793 mr_msg(0, 2794 2794 "error messages in the log. Read them; analyze them; see if "); 2795 log_msg(0,2795 mr_msg(0, 2796 2796 "they are significant; above all, verify your backups! Please"); 2797 log_msg(0,2797 mr_msg(0, 2798 2798 "attach a compressed copy of this log to any e-mail you send "); 2799 log_msg(0,2799 mr_msg(0, 2800 2800 "to the Mondo mailing list when you are seeking technical "); 2801 log_msg(0,2801 mr_msg(0, 2802 2802 "support. Without it, we can't help you. - DevTeam"); 2803 log_msg(0,2803 mr_msg(0, 2804 2804 "------------------------------------------------------------"); 2805 log_msg(0,2805 mr_msg(0, 2806 2806 "BTW, despite (or perhaps because of) the wealth of messages,"); 2807 log_msg(0,2807 mr_msg(0, 2808 2808 "some users are inclined to stop reading this log. If Mondo "); 2809 log_msg(0,2809 mr_msg(0, 2810 2810 "stopped for some reason, chances are it's detailed here. "); 2811 log_msg(0,2811 mr_msg(0, 2812 2812 "More than likely there's a message near the end of this "); 2813 log_msg(0,2813 mr_msg(0, 2814 2814 "log that will tell you what is wrong. Please read it! "); 2815 log_msg(0,2815 mr_msg(0, 2816 2816 "------------------------------------------------------------"); 2817 2817 } … … 2863 2863 if (strstr(tmp,"textonly")) { 2864 2864 g_text_mode = TRUE; 2865 log_msg(1, "TEXTONLY MODE");2865 mr_msg(1, "TEXTONLY MODE"); 2866 2866 } else { 2867 2867 g_text_mode = FALSE; … … 2896 2896 g_kernel_version = get_kernel_version(); 2897 2897 2898 log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);2898 mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname); 2899 2899 mkdir(MNT_CDROM, 0x770); 2900 2900 … … 2902 2902 mr_asprintf(&tmp, "%s.orig", g_mountlist_fname); 2903 2903 if (!does_file_exist(g_mountlist_fname)) { 2904 log_msg(2,2904 mr_msg(2, 2905 2905 "%ld: Warning - g_mountlist_fname (%s) does not exist yet", 2906 2906 __LINE__, g_mountlist_fname); … … 2932 2932 welcome_to_mondorestore(); 2933 2933 if (bkpinfo->disaster_recovery) { 2934 log_msg(1, "I am in disaster recovery mode");2934 mr_msg(1, "I am in disaster recovery mode"); 2935 2935 } else { 2936 log_msg(1, "I am in normal, live mode");2936 mr_msg(1, "I am in normal, live mode"); 2937 2937 } 2938 2938 … … 3019 3019 3020 3020 if (argc == 5 && strcmp(argv[1], "--copy") == 0) { 3021 log_msg(1, "SCORE");3021 mr_msg(1, "SCORE"); 3022 3022 g_loglevel = 10; 3023 3023 if (strstr(argv[2], "save")) { 3024 log_msg(1, "Saving from %s to %s", argv[3], argv[4]);3024 mr_msg(1, "Saving from %s to %s", argv[3], argv[4]); 3025 3025 fin = fopen(argv[3], "r"); 3026 3026 fout = fopen(argv[4], "w"); … … 3075 3075 // return(1); 3076 3076 } 3077 log_msg(1, "I am in normal, live mode.");3078 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);3077 mr_msg(1, "I am in normal, live mode."); 3078 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 3079 3079 mount_boot_if_necessary(); /* for Gentoo users */ 3080 log_msg(2, "Still here.");3080 mr_msg(2, "Still here."); 3081 3081 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) { 3082 3082 g_restoring_live_from_cd = TRUE; 3083 3083 } else { 3084 log_msg(2, "Calling restore_to_live_filesystem()");3084 mr_msg(2, "Calling restore_to_live_filesystem()"); 3085 3085 retval = restore_to_live_filesystem(bkpinfo); 3086 3086 } 3087 log_msg(2, "Still here. Yay.");3087 mr_msg(2, "Still here. Yay."); 3088 3088 if (strlen(bkpinfo->tmpdir) > 0) { 3089 3089 mr_asprintf(&tmp, "rm -Rf %s/*", bkpinfo->tmpdir); … … 3095 3095 } else { 3096 3096 /* Disaster recovery mode (must be) */ 3097 log_msg(1, "I must be in disaster recovery mode.");3098 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);3097 mr_msg(1, "I must be in disaster recovery mode."); 3098 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 3099 3099 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) { 3100 3100 log_to_screen(_("Uh, that hasn't been implemented yet.")); … … 3115 3115 if (bkpinfo->backup_media_type == nfs 3116 3116 && !is_this_device_mounted(bkpinfo->nfs_mount)) { 3117 log_msg(1, "Mounting nfs dir");3117 mr_msg(1, "Mounting nfs dir"); 3118 3118 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 3119 3119 run_program_and_log_output("mkdir -p /tmp/isodir", 5); … … 3133 3133 3134 3134 3135 log_msg(1, "Send in the clowns.");3135 mr_msg(1, "Send in the clowns."); 3136 3136 3137 3137 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) { 3138 log_msg(0, "Partitioning only.");3138 mr_msg(0, "Partitioning only."); 3139 3139 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3140 3140 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3145 3145 3146 3146 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) { 3147 log_msg(0, "Formatting only.");3147 mr_msg(0, "Formatting only."); 3148 3148 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3149 3149 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3154 3154 3155 3155 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) { 3156 log_msg(0, "Stopping LVM and RAID");3156 mr_msg(0, "Stopping LVM and RAID"); 3157 3157 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3158 3158 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3241 3241 // g_I_have_just_nuked is set true by nuke_mode() just before it returns 3242 3242 if (!system("which post-nuke > /dev/null 2> /dev/null")) { 3243 log_msg(1, "post-nuke found; find out whether we should run it...");3243 mr_msg(1, "post-nuke found; find out whether we should run it..."); 3244 3244 if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) { 3245 3245 run_postnuke = TRUE; 3246 log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");3246 mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists."); 3247 3247 } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) { 3248 3248 run_postnuke = TRUE; 3249 log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");3249 mr_msg(1, "Yes, will run post-nuke because user interactively asked for it."); 3250 3250 } else { 3251 3251 run_postnuke = FALSE; 3252 log_msg(1, "No, will not run post-nuke.");3252 mr_msg(1, "No, will not run post-nuke."); 3253 3253 } 3254 3254 } else { 3255 log_msg(1, "No post-nuke found.");3255 mr_msg(1, "No post-nuke found."); 3256 3256 } 3257 3257 if (run_postnuke) { … … 3261 3261 ("Unable to re-mount partitions for post-nuke stuff"); 3262 3262 } else { 3263 log_msg(1, "Re-mounted partitions for post-nuke stuff");3263 mr_msg(1, "Re-mounted partitions for post-nuke stuff"); 3264 3264 sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path, 3265 3265 retval); 3266 log_msg(2, "Calling '%s'", tmp);3266 mr_msg(2, "Calling '%s'", tmp); 3267 3267 if ((res = run_program_and_log_output(tmp, 0))) { 3268 3268 log_OS_error(tmp); 3269 3269 } 3270 log_msg(1, "post-nuke returned w/ res=%d", res);3270 mr_msg(1, "post-nuke returned w/ res=%d", res); 3271 3271 } 3272 3272 unmount_all_devices(mountlist); -
trunk/mondo/src/mondorestore/mondo-rstr-compare.c
r1081 r1086 57 57 insist_on_this_cd_number(bkpinfo, (++g_current_media_number)); 58 58 } else { 59 log_msg(2, "No CD's left. No biggiefiles left. No problem.");59 mr_msg(2, "No CD's left. No biggiefiles left. No problem."); 60 60 return (0); 61 61 } … … 77 77 mr_asprintf(&bigfile_fname, biggiestruct.filename); 78 78 79 log_msg(2, "biggiestruct.filename = %s", bigfile_fname);80 log_msg(2, "biggiestruct.checksum = %s", checksum);79 mr_msg(2, "biggiestruct.filename = %s", bigfile_fname); 80 mr_msg(2, "biggiestruct.checksum = %s", checksum); 81 81 82 82 if (!g_text_mode) { … … 88 88 /* BERLIOS: Useless ? 89 89 if (!checksum[0]) { 90 log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);90 mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr); 91 91 } */ 92 92 if (!strncmp(bigfile_fname, "/dev/", 5)) { 93 log_msg(2, _("Ignoring device %s"), bigfile_fname);93 mr_msg(2, _("Ignoring device %s"), bigfile_fname); 94 94 return(0); 95 95 } else { … … 98 98 MNT_RESTORING, bigfile_fname); 99 99 } 100 log_msg(2, command);100 mr_msg(2, command); 101 101 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 102 102 if (system(command)) { … … 108 108 mr_free(command); 109 109 if (!(fin = fopen("/tmp/md5sum.txt", "r"))) { 110 log_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum");110 mr_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum"); 111 111 mr_free(bigfile_fname); 112 112 return (1); … … 124 124 } 125 125 if (!strcmp(checksum, original_cksum) != 0) { 126 log_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname);127 } else { 128 log_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname);126 mr_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname); 127 } else { 128 mr_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname); 129 129 retval++; 130 130 } … … 162 162 163 163 assert(bkpinfo != NULL); 164 log_msg(1, "Comparing biggiefiles");164 mr_msg(1, "Comparing biggiefiles"); 165 165 166 166 if (length_of_file(BIGGIELIST) < 6) { 167 log_msg(1,167 mr_msg(1, 168 168 "OK, really teeny-tiny biggielist; not comparing biggiefiles"); 169 169 return (0); … … 171 171 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 172 172 if (noof_biggiefiles <= 0) { 173 log_msg(1, "OK, no biggiefiles; not comparing biggiefiles");173 mr_msg(1, "OK, no biggiefiles; not comparing biggiefiles"); 174 174 return (0); 175 175 } … … 183 183 for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) { 184 184 mr_asprintf(&tmp, "Comparing big file #%ld", bigfileno + 1); 185 log_msg(1, tmp);185 mr_msg(1, tmp); 186 186 update_progress_form(tmp); 187 187 mr_free(tmp); … … 322 322 "Differences found while processing fileset #%d ", 323 323 current_tarball_number); 324 log_msg(1, tmp);324 mr_msg(1, tmp); 325 325 mr_free(tmp); 326 326 } … … 402 402 "/archives/slice* > /dev/null 2> /dev/null") 403 403 == 0) { 404 log_msg(2, "OK, I think I'm done with tarballs...");404 mr_msg(2, "OK, I think I'm done with tarballs..."); 405 405 mr_free(tarball_fname); 406 406 break; 407 407 } 408 log_msg(2, "OK, I think it's time for another CD...");408 mr_msg(2, "OK, I think it's time for another CD..."); 409 409 g_current_media_number++; 410 410 mr_free(progress_str); … … 590 590 mr_free(tmp); 591 591 592 log_msg(2, "calling popup_changelist_from_file()");592 mr_msg(2, "calling popup_changelist_from_file()"); 593 593 popup_changelist_from_file("/tmp/changed.files"); 594 log_msg(2, "Returning from popup_changelist_from_file()");594 mr_msg(2, "Returning from popup_changelist_from_file()"); 595 595 } 596 596 } else { … … 650 650 if (length_of_file("/tmp/changed.txt") > 2 651 651 && length_of_file("/tmp/changed.files") > 2) { 652 log_msg(0,652 mr_msg(0, 653 653 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 654 log_msg(2, "Calling popup_changelist_from_file()");654 mr_msg(2, "Calling popup_changelist_from_file()"); 655 655 popup_changelist_from_file("/tmp/changed.files"); 656 log_msg(2, "Returned from popup_changelist_from_file()");656 mr_msg(2, "Returned from popup_changelist_from_file()"); 657 657 } 658 658 -
trunk/mondo/src/mondorestore/mondo-rstr-newt.c
r1084 r1086 1658 1658 sizeof(struct raid_device_record)); 1659 1659 mr_asprintf(&title_of_editraidForm_window, _("Edit %s"), raidrec->raid_device); 1660 log_msg(2, "Opening newt window");1660 mr_msg(2, "Opening newt window"); 1661 1661 newtOpenWindow(20, 5, 40, 14, title_of_editraidForm_window); 1662 1662 mr_free(title_of_editraidForm_window); 1663 1663 1664 1664 for (;;) { 1665 log_msg(2, "Main loop");1665 mr_msg(2, "Main loop"); 1666 1666 mr_asprintf(&sz_raid_level, 1667 1667 turn_raid_level_number_to_string(raidrec->raid_level)); -
trunk/mondo/src/mondorestore/mondo-rstr-tools.c
r1084 r1086 194 194 || (!does_file_exist(output_mountlist_file) 195 195 && does_file_exist(orig_fname))) { 196 log_msg(2, "Failed to extract %s and/or %s from ramdisk",196 mr_msg(2, "Failed to extract %s and/or %s from ramdisk", 197 197 output_cfg_file, output_mountlist_file); 198 198 retval = 1; … … 257 257 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 258 258 f, file); 259 log_msg(2, tmp);259 mr_msg(2, tmp); 260 260 mr_free(tmp); 261 261 … … 308 308 run_program_and_log_output(command, 5); 309 309 mr_free(command); 310 log_msg(2, "Setting isodir to %s", bkpinfo->isodir);310 mr_msg(2, "Setting isodir to %s", bkpinfo->isodir); 311 311 } 312 312 … … 331 331 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 332 332 mount_isodir_command); 333 log_msg(1, tmp);333 mr_msg(1, tmp); 334 334 mr_free(tmp); 335 335 … … 352 352 mr_asprintf(&tmp, "%s #%d has been mounted via loopback mount", 353 353 bkpinfo->backup_media_string, i); 354 log_msg(1, tmp);354 mr_msg(1, tmp); 355 355 mr_free(tmp); 356 356 … … 360 360 retval = 1; 361 361 } 362 log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,362 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 363 363 bkpinfo->isodir); 364 364 return (retval); … … 409 409 if (!strcmp(mpt, "/1")) { 410 410 mr_asprintf(&mountpoint, "/"); 411 log_msg(3, "Mommm! SME is being a dildo!");411 mr_msg(3, "Mommm! SME is being a dildo!"); 412 412 } else { 413 413 mr_asprintf(&mountpoint, mpt); … … 423 423 } 424 424 mr_asprintf(&tmp, "Mounting device %s ", device); 425 log_msg(1, tmp);425 mr_msg(1, tmp); 426 426 427 427 if (writeable) { … … 465 465 mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device, 466 466 additional_parameters, mountdir, MONDO_LOGFILE); 467 log_msg(2, "command='%s'", command);467 mr_msg(2, "command='%s'", command); 468 468 } 469 469 mr_free(additional_parameters); … … 471 471 res = run_program_and_log_output(command, TRUE); 472 472 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 473 log_msg(1, "Re-trying without the fancy extra parameters");473 mr_msg(1, "Re-trying without the fancy extra parameters"); 474 474 mr_free(command); 475 475 … … 479 479 } 480 480 if (res) { 481 log_msg(1, "Unable to mount device %s (type %s) at %s", device,481 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, 482 482 format, mountdir); 483 log_msg(1, "command was '%s'", command);483 mr_msg(1, "command was '%s'", command); 484 484 if (!strcmp(mountpoint, "swap")) { 485 485 log_to_screen(tmp); 486 486 } else { 487 log_msg(2, "Retrying w/o the '-t' switch");487 mr_msg(2, "Retrying w/o the '-t' switch"); 488 488 mr_free(command); 489 489 490 490 mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir, 491 491 MONDO_LOGFILE); 492 log_msg(2, "2nd command = '%s'", command);492 mr_msg(2, "2nd command = '%s'", command); 493 493 res = run_program_and_log_output(command, TRUE); 494 494 if (res == 0) { 495 log_msg(1,495 mr_msg(1, 496 496 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 497 497 } else { … … 505 505 506 506 if (res && !strcmp(mountpoint, "swap")) { 507 log_msg(2, "That's ok. It's just a swap partition.");508 log_msg(2, "Non-fatal error. Returning 0.");507 mr_msg(2, "That's ok. It's just a swap partition."); 508 mr_msg(2, "Non-fatal error. Returning 0."); 509 509 res = 0; 510 510 } … … 550 550 for (lino = 0; lino < mountlist->entries; lino++) { 551 551 if (!strcmp(mountlist->el[lino].device, "/proc")) { 552 log_msg(1,552 mr_msg(1, 553 553 "Again with the /proc - why is this in your mountlist?"); 554 554 } else if (is_this_device_mounted(mountlist->el[lino].device)) { … … 649 649 if (bkpinfo->backup_media_type == tape 650 650 || bkpinfo->backup_media_type == udev) { 651 log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");651 mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM."); 652 652 return 0; 653 653 } 654 654 655 655 if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) { 656 log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");656 mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough."); 657 657 return (0); 658 658 } 659 659 660 660 if (bkpinfo->backup_media_type == nfs) { 661 log_msg(2, "Mounting for NFS thingy");662 log_msg(2, "isodir = %s", bkpinfo->isodir);661 mr_msg(2, "Mounting for NFS thingy"); 662 mr_msg(2, "isodir = %s", bkpinfo->isodir); 663 663 if ((!bkpinfo->isodir || !strcmp(bkpinfo->isodir, "/")) 664 664 && am_I_in_disaster_recovery_mode()) { 665 665 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 666 log_msg(1, "isodir is being set to %s", bkpinfo->isodir);666 mr_msg(1, "isodir is being set to %s", bkpinfo->isodir); 667 667 } 668 668 #ifdef __FreeBSD__ … … 728 728 729 729 } 730 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);730 mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd); 731 731 for (i = 0; i < 2; i++) { 732 732 res = run_program_and_log_output(mount_cmd, FALSE); … … 734 734 break; 735 735 } else { 736 log_msg(2, "Failed to mount CD-ROM drive.");736 mr_msg(2, "Failed to mount CD-ROM drive."); 737 737 sleep(5); 738 738 run_program_and_log_output("sync", FALSE); … … 742 742 743 743 if (res) { 744 log_msg(2, "Failed, despite %d attempts", i);745 } else { 746 log_msg(2, "Mounted CD-ROM drive OK");744 mr_msg(2, "Failed, despite %d attempts", i); 745 } else { 746 mr_msg(2, "Mounted CD-ROM drive OK"); 747 747 } 748 748 return (res); … … 830 830 /* Check to see if CD is already mounted before mounting it... */ 831 831 if (!is_this_device_mounted("/dev/cdrom")) { 832 log_msg(2,832 mr_msg(2, 833 833 "NB: CDROM device not mounted, mounting..."); 834 834 run_program_and_log_output("mount /dev/cdrom " … … 897 897 mr_asprintf(&tmp, "Backup medium is TAPE --- dev=%s", 898 898 bkpinfo->media_device); 899 log_msg(2, tmp);899 mr_msg(2, tmp); 900 900 mr_free(tmp); 901 901 } else { … … 903 903 bkpinfo->media_size[0] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 904 904 bkpinfo->media_size[1] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 905 log_msg(2, "Backup medium is CD-R[W]");906 } 907 } else { 908 log_msg(2,905 mr_msg(2, "Backup medium is CD-R[W]"); 906 } 907 } else { 908 mr_msg(2, 909 909 "Not in Disaster Recovery Mode. No need to derive device name from config file."); 910 910 } … … 913 913 if (strstr(value, "yes")) { 914 914 bkpinfo->use_star = TRUE; 915 log_msg(1, "Goody! ... bkpinfo->use_star is now true.");915 mr_msg(1, "Goody! ... bkpinfo->use_star is now true."); 916 916 } 917 917 mr_free(value); … … 920 920 if (strstr(value, "TRUE")) { 921 921 mr_asprintf(&g_getfacl,"setfacl"); 922 log_msg(1, "We will restore ACLs");922 mr_msg(1, "We will restore ACLs"); 923 923 if (! find_home_of_exe("setfacl")) { 924 log_msg(1, "Unable to restore ACLs as no setfacl found");924 mr_msg(1, "Unable to restore ACLs as no setfacl found"); 925 925 } 926 926 } … … 928 928 if (strstr(value, "TRUE")) { 929 929 mr_asprintf(&g_getfattr,"setfattr"); 930 log_msg(1, "We will restore XATTRs");930 mr_msg(1, "We will restore XATTRs"); 931 931 if (! find_home_of_exe("setfattr")) { 932 log_msg(1, "Unable to restore XATTRs as no setfattr found");932 mr_msg(1, "Unable to restore XATTRs as no setfattr found"); 933 933 } 934 934 } … … 936 936 if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) { 937 937 bkpinfo->internal_tape_block_size = atol(value); 938 log_msg(1, "Internal tape block size has been custom-set to %ld",938 mr_msg(1, "Internal tape block size has been custom-set to %ld", 939 939 bkpinfo->internal_tape_block_size); 940 940 } else { 941 941 bkpinfo->internal_tape_block_size = 942 942 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 943 log_msg(1, "Internal tape block size = default (%ld)",943 mr_msg(1, "Internal tape block size = default (%ld)", 944 944 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 945 945 } … … 980 980 bkpinfo->differential = TRUE; 981 981 } 982 log_msg(2, "differential var = '%s'", value);982 mr_msg(2, "differential var = '%s'", value); 983 983 mr_free(value); 984 984 985 985 if (bkpinfo->differential) { 986 log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");987 } else { 988 log_msg(2, "This is a regular (full) backup");986 mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP"); 987 } else { 988 mr_msg(2, "This is a regular (full) backup"); 989 989 } 990 990 … … 997 997 if ((tmp != NULL) || strstr(tmp1,"donteject")) { 998 998 bkpinfo->please_dont_eject = TRUE; 999 log_msg(2, "Ok, I shan't eject when restoring! Groovy.");999 mr_msg(2, "Ok, I shan't eject when restoring! Groovy."); 1000 1000 } 1001 1001 mr_free(tmp); … … 1004 1004 if (bkpinfo->backup_media_type == nfs) { 1005 1005 if (!cfgf) { 1006 log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);1007 log_msg(2, "nfs_remote_dir remains %s",1006 mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount); 1007 mr_msg(2, "nfs_remote_dir remains %s", 1008 1008 bkpinfo->nfs_remote_dir); 1009 log_msg(2,1009 mr_msg(2, 1010 1010 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 1011 1011 } else { … … 1016 1016 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 1017 1017 bkpinfo->nfs_remote_dir); 1018 log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);1019 log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);1018 mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount); 1019 mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir); 1020 1020 } 1021 1021 if (strstr(call_program_and_get_last_line_of_output … … 1060 1060 mr_free(g_isodir_device); 1061 1061 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 1062 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device);1062 mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device); 1063 1063 if (bkpinfo->disaster_recovery) { 1064 1064 if (is_this_device_mounted(g_isodir_device)) { 1065 log_msg(2, "NB: isodir is already mounted");1065 mr_msg(2, "NB: isodir is already mounted"); 1066 1066 /* Find out where it's mounted */ 1067 1067 mr_asprintf(&command, … … 1081 1081 mr_asprintf(&tmp, "mount %s %s", g_isodir_device, iso_mnt); 1082 1082 if (run_program_and_log_output(tmp, 3)) { 1083 log_msg(1,1083 mr_msg(1, 1084 1084 "Unable to mount isodir. Perhaps this is really a CD backup?"); 1085 1085 bkpinfo->backup_media_type = cdr; … … 1095 1095 ("Unable to mount isodir. Failed to mount CD-ROM as well."); 1096 1096 } else { 1097 log_msg(1,1097 mr_msg(1, 1098 1098 "You backed up to disk, then burned some CDs."); 1099 1099 } … … 1114 1114 if (g_restoring_live_from_cd) { 1115 1115 if (bkpinfo->backup_media_type != media_specified_by_user) { 1116 log_msg(2,1116 mr_msg(2, 1117 1117 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1118 1118 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); … … 1163 1163 if (does_file_exist(g_filelist_full) 1164 1164 && does_file_exist(g_biggielist_txt)) { 1165 log_msg(1, "%s exists", g_filelist_full);1166 log_msg(1, "%s exists", g_biggielist_txt);1167 log_msg(2,1165 mr_msg(1, "%s exists", g_filelist_full); 1166 mr_msg(1, "%s exists", g_biggielist_txt); 1167 mr_msg(2, 1168 1168 "Filelist and biggielist already recovered from media. Yay!"); 1169 1169 } else { 1170 1170 getcwd(tmp, MAX_STR_LEN); 1171 1171 chdir(bkpinfo->tmpdir); 1172 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);1172 mr_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1173 1173 log_to_screen("Extracting filelist and biggielist from media..."); 1174 1174 unlink("/tmp/filelist.full"); … … 1183 1183 FILELIST_FULL_STUB, 1184 1184 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1185 log_msg(1, "tarcommand = %s", command);1185 mr_msg(1, "tarcommand = %s", command); 1186 1186 run_program_and_log_output(command, 1); 1187 1187 mr_free(command); 1188 1188 } else { 1189 log_msg(2,1189 mr_msg(2, 1190 1190 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1191 1191 bkpinfo->isodir); 1192 1192 insist_on_this_cd_number(bkpinfo, 1); 1193 log_msg(2, "Back from iotcn");1193 mr_msg(2, "Back from iotcn"); 1194 1194 run_program_and_log_output("mount", 1); 1195 1195 mr_asprintf(&command, … … 1201 1201 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1202 1202 1203 log_msg(1, "tarcommand = %s", command);1203 mr_msg(1, "tarcommand = %s", command); 1204 1204 run_program_and_log_output(command, 1); 1205 1205 mr_free(command); … … 1221 1221 mr_asprintf(&command, "cp -f %s/%s %s", bkpinfo->tmpdir, 1222 1222 BIGGIELIST_TXT_STUB, g_biggielist_txt); 1223 log_msg(1, "command = %s", command);1223 mr_msg(1, "command = %s", command); 1224 1224 paranoid_system(command); 1225 1225 mr_free(command); … … 1227 1227 mr_asprintf(&command, "ln -sf %s/%s %s", bkpinfo->tmpdir, 1228 1228 FILELIST_FULL_STUB, g_filelist_full); 1229 log_msg(1, "command = %s", command);1229 mr_msg(1, "command = %s", command); 1230 1230 paranoid_system(command); 1231 1231 mr_free(command); … … 1247 1247 1248 1248 if (!does_file_exist(g_biggielist_txt)) { 1249 log_msg(1, "Warning - %s not found", g_biggielist_txt);1249 mr_msg(1, "Warning - %s not found", g_biggielist_txt); 1250 1250 } 1251 1251 if (!does_file_exist(g_filelist_full)) { 1252 log_msg(1, "Warning - %s does not exist", g_filelist_full);1252 mr_msg(1, "Warning - %s does not exist", g_filelist_full); 1253 1253 } 1254 1254 // popup_and_OK("Wonderful."); 1255 1255 1256 log_msg(2, "Forking");1256 mr_msg(2, "Forking"); 1257 1257 pid = fork(); 1258 1258 switch (pid) { … … 1284 1284 close_evalcall_form(); 1285 1285 1286 log_msg(3, "loading filelist");1286 mr_msg(3, "loading filelist"); 1287 1287 filelist = load_filelist(g_filelist_full); 1288 log_msg(3, "deleting original filelist");1288 mr_msg(3, "deleting original filelist"); 1289 1289 unlink(g_filelist_full); 1290 1290 if (g_text_mode) { … … 1302 1302 } 1303 1303 if (res) { 1304 log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");1304 mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting."); 1305 1305 free_filelist(filelist); 1306 1306 return (NULL); … … 1370 1370 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1371 1371 mr_asprintf(&tmp, "run_boot_loader: device='%s', name='%s'", device, name); 1372 log_msg(2, tmp);1372 mr_msg(2, tmp); 1373 1373 mr_free(tmp); 1374 1374 … … 1386 1386 // else 1387 1387 // { 1388 // log_msg(1, "Not running run_grub(). Was a bad idea anyway.");1388 // mr_msg(1, "Not running run_grub(). Was a bad idea anyway."); 1389 1389 // res = 1; 1390 1390 // } … … 1404 1404 res = run_program_and_log_output(tmp, 3); 1405 1405 } else { 1406 log_msg(1,1406 mr_msg(1, 1407 1407 "I'm not running any boot loader. You have a DD boot drive. It's already loaded up."); 1408 1408 } … … 1464 1464 tmp = find_home_of_exe(output); 1465 1465 if (!tmp) { 1466 log_msg(2, " (find_my_editor) --- warning - %s not found", output);1466 mr_msg(2, " (find_my_editor) --- warning - %s not found", output); 1467 1467 } 1468 1468 mr_free(tmp); … … 1536 1536 /* nuke mode */ 1537 1537 if (!run_program_and_log_output("which grub-MR", FALSE)) { 1538 log_msg(1, "Yay! grub-MR found...");1538 mr_msg(1, "Yay! grub-MR found..."); 1539 1539 mr_asprintf(&command, "grub-MR %s /tmp/mountlist.txt", bd); 1540 log_msg(1, "command = %s", command);1540 mr_msg(1, "command = %s", command); 1541 1541 } else { 1542 1542 mr_asprintf(&command, "chroot " MNT_RESTORING " grub-install %s", bd); 1543 log_msg(1, "WARNING - grub-MR not found; using grub-install");1543 mr_msg(1, "WARNING - grub-MR not found; using grub-install"); 1544 1544 } 1545 1545 mvaddstr_and_log_it(g_currentY, … … 1566 1566 (_ 1567 1567 ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.")); 1568 log_msg(1, "Type:-");1569 log_msg(1, " mount-me");1570 log_msg(1, " chroot " MNT_RESTORING);1571 log_msg(1, " mount /boot");1572 log_msg(1, " grub-install '(hd0)'");1573 log_msg(1, " exit");1574 log_msg(1, " unmount-me");1575 log_msg(1,1568 mr_msg(1, "Type:-"); 1569 mr_msg(1, " mount-me"); 1570 mr_msg(1, " chroot " MNT_RESTORING); 1571 mr_msg(1, " mount /boot"); 1572 mr_msg(1, " grub-install '(hd0)'"); 1573 mr_msg(1, " exit"); 1574 mr_msg(1, " unmount-me"); 1575 mr_msg(1, 1576 1576 "If you're really stuck, please e-mail the mailing list."); 1577 1577 } else { … … 1829 1829 ("Restoring MBR... ")); 1830 1830 mr_asprintf(&command, "raw-MR %s /tmp/mountlist.txt", bd); 1831 log_msg(2, "run_raw_mbr() --- command='%s'", command);1831 mr_msg(2, "run_raw_mbr() --- command='%s'", command); 1832 1832 res = run_program_and_log_output(command, 3); 1833 1833 mr_free(command); … … 1999 1999 void termination_in_progress(int sig) 2000 2000 { 2001 log_msg(1, "Termination in progress");2001 mr_msg(1, "Termination in progress"); 2002 2002 usleep(1000); 2003 2003 pthread_exit(0); … … 2047 2047 i++) { 2048 2048 sleep(1); 2049 log_msg(2, "Waiting for buffer() to finish");2049 mr_msg(2, "Waiting for buffer() to finish"); 2050 2050 } 2051 2051 … … 2054 2054 if (run_program_and_log_output 2055 2055 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) { 2056 log_msg(1,2056 mr_msg(1, 2057 2057 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 2058 2058 } 2059 2059 if (run_program_and_log_output 2060 2060 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 2061 log_msg(1,2061 mr_msg(1, 2062 2062 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 2063 2063 } … … 2081 2081 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 2082 2082 mr_asprintf(&command, "umount %s/", MNT_RESTORING); 2083 log_msg(3,2083 mr_msg(3, 2084 2084 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2085 2085 } else { … … 2088 2088 } 2089 2089 } 2090 log_msg(10, "The 'umount' command is '%s'", command);2090 mr_msg(10, "The 'umount' command is '%s'", command); 2091 2091 res = run_program_and_log_output(command, 3); 2092 2092 mr_free(command); … … 2105 2105 log_to_screen(tmp); 2106 2106 } else { 2107 log_msg(2, tmp);2107 mr_msg(2, tmp); 2108 2108 } 2109 2109 mr_free(tmp); … … 2149 2149 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2150 2150 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); 2151 log_msg(2, "command = '%s'", command);2151 mr_msg(2, "command = '%s'", command); 2152 2152 res = run_program_and_log_output(command, -1); 2153 2153 mr_free(command); … … 2185 2185 2186 2186 assert(bkpinfo != NULL); 2187 log_msg(2, "gcffa --- starting");2187 mr_msg(2, "gcffa --- starting"); 2188 2188 log_to_screen(_("I'm thinking...")); 2189 2189 mr_asprintf(&mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); … … 2202 2202 mr_asprintf(&mountlist_file, "%s/%s", bkpinfo->tmpdir, 2203 2203 MOUNTLIST_FNAME_STUB); 2204 log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);2204 mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2205 2205 2206 2206 /* Floppy? */ … … 2217 2217 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2218 2218 command); 2219 log_msg(1, "tmp = '%s'", tmp);2219 mr_msg(1, "tmp = '%s'", tmp); 2220 2220 system(tmp); 2221 2221 mr_free(tmp); … … 2233 2233 } else { 2234 2234 try_plan_B = TRUE; 2235 log_msg(2,2235 mr_msg(2, 2236 2236 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does."); 2237 2237 // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK. 2238 log_msg(2, "Processing floppy (plan A?)");2238 mr_msg(2, "Processing floppy (plan A?)"); 2239 2239 mr_asprintf(&ramdisk_fname, "%s/mindi.rdz", mountpt); 2240 2240 if (!does_file_exist(ramdisk_fname)) { … … 2243 2243 } 2244 2244 if (!does_file_exist(ramdisk_fname)) { 2245 log_msg(2,2245 mr_msg(2, 2246 2246 "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?"); 2247 2247 } 2248 2248 if (extract_config_file_from_ramdisk 2249 2249 (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) { 2250 log_msg(2,2250 mr_msg(2, 2251 2251 "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled."); 2252 2252 } … … 2259 2259 } 2260 2260 if (!does_file_exist(cfg_file)) { 2261 log_msg(2, "gcffa --- we don't have cfg file yet.");2261 mr_msg(2, "gcffa --- we don't have cfg file yet."); 2262 2262 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2263 2263 try_plan_B = TRUE; 2264 2264 } else { 2265 log_msg(2, "gcffa --- calling mount_cdrom now :)");2265 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2266 2266 if (!mount_cdrom(bkpinfo)) { 2267 log_msg(2,2267 mr_msg(2, 2268 2268 "gcffa --- managed to mount CD; so, no need for Plan B"); 2269 2269 try_plan_B = FALSE; … … 2277 2277 } 2278 2278 if (try_plan_B) { 2279 log_msg(2, "gcffa --- OK, switching to Plan B");2279 mr_msg(2, "gcffa --- OK, switching to Plan B"); 2280 2280 chdir(bkpinfo->tmpdir); 2281 2281 run_program_and_log_output("mkdir -p tmp", FALSE); … … 2283 2283 if (bkpinfo->media_device == NULL) { 2284 2284 mr_asprintf(&bkpinfo->media_device, "/dev/st0"); 2285 log_msg(2, "media_device is blank; assuming %s",2285 mr_msg(2, "media_device is blank; assuming %s", 2286 2286 bkpinfo->media_device); 2287 2287 } … … 2298 2298 if (extract_cfg_file_and_mountlist_from_tape_dev 2299 2299 (bkpinfo->media_device)) { 2300 log_msg(3,2300 mr_msg(3, 2301 2301 "I tried lots of devices but none worked."); 2302 2302 mr_allocstr(bkpinfo->media_device, sav); … … 2313 2313 } 2314 2314 } else { 2315 log_msg(2,2315 mr_msg(2, 2316 2316 "gcffa --- looking at mounted CD for mindi-boot.2880.img"); 2317 2317 /* BERLIOS : Useless ? … … 2322 2322 mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2323 2323 if (!does_file_exist(mounted_cfgf_path)) { 2324 log_msg(2,2324 mr_msg(2, 2325 2325 "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz"); 2326 2326 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary … … 2339 2339 2340 2340 if (does_file_exist(MONDO_CFG_FILE_STUB)) { 2341 log_msg(1, "gcffa --- great! We've got the config file");2341 mr_msg(1, "gcffa --- great! We've got the config file"); 2342 2342 tmp1 = call_program_and_get_last_line_of_output("pwd"); 2343 2343 mr_asprintf(&tmp, "%s/%s", tmp1,MONDO_CFG_FILE_STUB); … … 2347 2347 if (strcmp(tmp, cfg_file) 2348 2348 && run_program_and_log_output(command, 1)) { 2349 log_msg(1,2349 mr_msg(1, 2350 2350 "... but an error occurred when I tried to move it to %s", 2351 2351 cfg_file); 2352 2352 } else { 2353 log_msg(1, "... and I moved it successfully to %s", cfg_file);2353 mr_msg(1, "... and I moved it successfully to %s", cfg_file); 2354 2354 } 2355 2355 mr_free(command); … … 2362 2362 if (strcmp(tmp, cfg_file) 2363 2363 && run_program_and_log_output(command, 1)) { 2364 log_msg(1, "Failed to get mountlist");2364 mr_msg(1, "Failed to get mountlist"); 2365 2365 } else { 2366 log_msg(1, "Got mountlist too");2366 mr_msg(1, "Got mountlist too"); 2367 2367 mr_free(command); 2368 2368 mr_asprintf(&command, "cp -f %s %s", mountlist_file, 2369 2369 g_mountlist_fname); 2370 2370 if (run_program_and_log_output(command, 1)) { 2371 log_msg(1, "Failed to copy mountlist to /tmp");2371 mr_msg(1, "Failed to copy mountlist to /tmp"); 2372 2372 } else { 2373 log_msg(1, "Copied mountlist to /tmp as well OK");2373 mr_msg(1, "Copied mountlist to /tmp as well OK"); 2374 2374 mr_free(command); 2375 2375 mr_asprintf(&command, "cp -f tmp/i-want-my-lvm /tmp/"); … … 2383 2383 if (!does_file_exist(cfg_file)) { 2384 2384 iamhere(cfg_file); 2385 log_msg(1, "%s not found", cfg_file);2385 mr_msg(1, "%s not found", cfg_file); 2386 2386 log_to_screen 2387 2387 (_ … … 2448 2448 if (parse_mdstat(raidlist, "/dev/")) { 2449 2449 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2450 log_msg(1, "Sorry, cannot read %s", MDSTAT_FILE);2450 mr_msg(1, "Sorry, cannot read %s", MDSTAT_FILE); 2451 2451 return; 2452 2452 } … … 2455 2455 if (raidlist->el[i].progress < wait_for_percentage) { 2456 2456 unfinished_mdstat_devices++; 2457 log_msg(1, "Sync'ing %s (i=%d)",2457 mr_msg(1, "Sync'ing %s (i=%d)", 2458 2458 raidlist->el[i].raid_device, i); 2459 2459 mr_asprintf(&screen_message, "Sync'ing %s", … … 2466 2466 } 2467 2467 while (raidlist->el[i].progress < wait_for_percentage) { 2468 log_msg(1, "Percentage sync'ed: %d",2468 mr_msg(1, "Percentage sync'ed: %d", 2469 2469 raidlist->el[i].progress); 2470 2470 update_evalcall_form(raidlist->el[i].progress);
Note:
See TracChangeset
for help on using the changeset viewer.