Changeset 1086 in MondoRescue for trunk/mondo/src/common
- Timestamp:
- Feb 2, 2007, 11:21:27 PM (18 years ago)
- Location:
- trunk/mondo/src/common
- Files:
-
- 13 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++) {
Note:
See TracChangeset
for help on using the changeset viewer.