Changeset 1086 in MondoRescue for trunk/mondo/src/mondorestore
- Timestamp:
- Feb 2, 2007, 11:21:27 PM (17 years ago)
- Location:
- trunk/mondo/src/mondorestore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/mondorestore/mondo-prep.c
r1081 r1086 68 68 drivelist->el[lino].device, MONDO_WAS_HERE); 69 69 if (!run_program_and_log_output(command, 1)) { 70 log_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",70 mr_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)", 71 71 lino, drivelist->el[lino].device); 72 72 mr_free(command); … … 90 90 fout = fopen(drivelist->el[lino].device, "w+"); 91 91 if (!fout) { 92 log_msg(1, "Unable to open+wipe %s",92 mr_msg(1, "Unable to open+wipe %s", 93 93 drivelist->el[lino].device); 94 94 } else { 95 95 if (1 != fwrite(buf, strlen(buf)+1, 1, fout)) { 96 log_msg(1, "Failed to wipe %s",96 mr_msg(1, "Failed to wipe %s", 97 97 drivelist->el[lino].device); 98 98 } else { 99 log_msg(1, "Successfully wiped %s",99 mr_msg(1, "Successfully wiped %s", 100 100 drivelist->el[lino].device); 101 101 } … … 114 114 } 115 115 // Still here? Cool! 116 log_msg(1, "Cool. I didn't have to wipe anything.");116 mr_msg(1, "Cool. I didn't have to wipe anything."); 117 117 } 118 118 … … 126 126 return (-1); 127 127 } 128 log_msg(5, "Writing string '%s', one char at a time", str);128 mr_msg(5, "Writing string '%s', one char at a time", str); 129 129 j = strlen(str); 130 130 for (i = 0; i < j; i++) { 131 log_msg(6, "Writing %d ('%c')", str[i], str[i]);131 mr_msg(6, "Writing %d ('%c')", str[i], str[i]); 132 132 if ((fq = fopen(FDISK_LOG, "a+"))) { 133 133 fputc(str[i], fq); … … 141 141 } 142 142 } 143 log_msg(5, "Returning");143 mr_msg(5, "Returning"); 144 144 145 145 return (i); … … 198 198 199 199 iamhere("STARTING"); 200 log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");200 mr_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes..."); 201 201 tmp = find_home_of_exe("lvm"); 202 202 if (tmp) // found it :) cool … … 239 239 if (just_erase_existing_volumes) { 240 240 paranoid_fclose(fin); 241 log_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");241 mr_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs."); 242 242 sync(); 243 243 sync(); … … 245 245 sleep(1); 246 246 iamhere("ENDING"); 247 log_msg(1, "Not many errors. Returning 0.");247 mr_msg(1, "Not many errors. Returning 0."); 248 248 return (0); 249 249 } 250 250 251 log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");251 mr_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff..."); 252 252 rewind(fin); 253 253 for (mr_getline(&incoming, &n1, fin); !feof(fin); mr_getline(&incoming, &n1, fin)) { … … 286 286 for (q = tmp1; *q > 32; q++); 287 287 *q = '\0'; 288 log_msg(1, "Deleting old entries at /dev/%s", tmp1);288 mr_msg(1, "Deleting old entries at /dev/%s", tmp1); 289 289 mr_asprintf(&tmp, "rm -Rf /dev/%s", tmp1); 290 290 mr_free(tmp1); … … 295 295 run_program_and_log_output(vgscan_sz, 1); 296 296 run_program_and_log_output(pvscan_sz, 1); 297 log_msg(3,297 mr_msg(3, 298 298 "After working around potentially broken i-want-my-lvm, incoming[] is now '%s'", 299 299 incoming); … … 311 311 res = run_program_and_log_output(command, 5); 312 312 } 313 log_msg(0, "%s --> %d", command, res);313 mr_msg(0, "%s --> %d", command, res); 314 314 if (res > 0) { 315 315 res = 1; … … 333 333 for (p = tmp; *p != '\0' && !isdigit(*p); p++); 334 334 extents = atol(p); 335 log_msg(5, "p='%s' --> extents=%ld", p, extents);335 mr_msg(5, "p='%s' --> extents=%ld", p, extents); 336 336 mr_free(tmp); 337 337 338 338 p = strstr(command, "-L"); 339 339 if (!p) { 340 log_msg(0, "Fiddlesticks. '%s' returned %d", command, res);340 mr_msg(0, "Fiddlesticks. '%s' returned %d", command, res); 341 341 } else { 342 342 if (lvmversion == 2) { … … 363 363 *(p + i) = ' '; 364 364 } 365 log_msg(5, "Retrying with '%s'", command);365 mr_msg(5, "Retrying with '%s'", command); 366 366 res = run_program_and_log_output(command, 5); 367 367 if (res > 0) { … … 371 371 fprintf(g_fprep, "%s\n", command); 372 372 } 373 log_msg(0, "%s --> %d", command, res);373 mr_msg(0, "%s --> %d", command, res); 374 374 if (!res) { 375 log_msg(5, "YAY! This time, it succeeded.");375 mr_msg(5, "YAY! This time, it succeeded."); 376 376 } 377 377 } 378 378 } 379 379 if (strstr(command, "vgcreate")) { 380 log_msg(0, "In case you're interested...");380 mr_msg(0, "In case you're interested..."); 381 381 run_program_and_log_output(vgscan_sz, 1); 382 382 run_program_and_log_output(pvscan_sz, 1); … … 396 396 mr_free(incoming); 397 397 398 log_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");398 mr_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff."); 399 399 sync(); 400 400 sync(); … … 403 403 iamhere("ENDING"); 404 404 if (retval > 2) { 405 log_msg(1, "%d errors. I'm reporting this.", retval);405 mr_msg(1, "%d errors. I'm reporting this.", retval); 406 406 return (retval); 407 407 } else { 408 log_msg(1, "Not many errors. Returning 0.");408 mr_msg(1, "Not many errors. Returning 0."); 409 409 return (0); 410 410 } … … 550 550 // leave straight away if raidlist is initial or has no entries 551 551 if (!raidlist || raidlist->entries == 0) { 552 log_msg(1, "No RAID arrays found.");552 mr_msg(1, "No RAID arrays found."); 553 553 return 1; 554 554 } else { 555 log_msg(1, "%d RAID arrays found.", raidlist->entries);555 mr_msg(1, "%d RAID arrays found.", raidlist->entries); 556 556 } 557 557 // find raidlist entry for requested device … … 561 561 // check whether RAID device was found in raidlist 562 562 if (i == raidlist->entries) { 563 log_msg(1, "RAID device %s not found in list.", device);563 mr_msg(1, "RAID device %s not found in list.", device); 564 564 return 1; 565 565 } … … 805 805 */ 806 806 807 log_msg(1, "Making %s", device);807 mr_msg(1, "Making %s", device); 808 808 // use mkraid if it exists, otherwise use mdadm 809 809 if (run_program_and_log_output("which mkraid", FALSE)) { 810 810 res = create_raid_device_via_mdadm(raidlist, device); 811 log_msg(1, "Creating RAID device %s via mdadm returned %d",811 mr_msg(1, "Creating RAID device %s via mdadm returned %d", 812 812 device, res); 813 813 } else { 814 814 mr_asprintf(&program, "mkraid --really-force %s", device); 815 815 res = run_program_and_log_output(program, 1); 816 log_msg(1, "%s returned %d", program, res);816 mr_msg(1, "%s returned %d", program, res); 817 817 sync(); 818 818 sleep(3); … … 834 834 835 835 if (!strcmp(format, "lvm")) { 836 log_msg(1, "Don't format %s - it's part of an lvm volume", device);836 mr_msg(1, "Don't format %s - it's part of an lvm volume", device); 837 837 return (0); 838 838 } … … 937 937 // start soft-raids now (because LVM might depend on them) 938 938 // ...and for simplicity's sake, let's format them at the same time :) 939 log_msg(1, "Stopping all RAID devices");939 mr_msg(1, "Stopping all RAID devices"); 940 940 stop_all_raid_devices(mountlist); 941 941 sync(); … … 943 943 sync(); 944 944 sleep(2); 945 log_msg(1, "Prepare soft-RAIDs"); // prep and format too945 mr_msg(1, "Prepare soft-RAIDs"); // prep and format too 946 946 for (lino = 0; lino < mountlist->entries; lino++) { 947 947 me = &mountlist->el[lino]; // the current mountlist entry 948 log_msg(2, "Examining %s", me->device);948 mr_msg(2, "Examining %s", me->device); 949 949 if (!strncmp(me->device, "/dev/md", 7)) { 950 950 if (interactively) { … … 974 974 // sleep(5); 975 975 // do LVMs now 976 log_msg(1, "Creating LVMs");976 mr_msg(1, "Creating LVMs"); 977 977 if (does_file_exist("/tmp/i-want-my-lvm")) { 978 978 wait_until_software_raids_are_prepped("/proc/mdstat", 100); … … 997 997 // do regulars at last 998 998 sleep(2); // woo! 999 log_msg(1, "Formatting regulars");999 mr_msg(1, "Formatting regulars"); 1000 1000 for (lino = 0; lino < mountlist->entries; lino++) { 1001 1001 me = &mountlist->el[lino]; // the current mountlist entry … … 1677 1677 sync(); 1678 1678 paranoid_pclose(pout_to_fdisk); 1679 log_msg(0,1679 mr_msg(0, 1680 1680 "------------------- fdisk.log looks like this ------------------"); 1681 1681 mr_asprintf(&tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE); … … 1683 1683 mr_free(tmp); 1684 1684 1685 log_msg(0,1685 mr_msg(0, 1686 1686 "------------------- end of fdisk.log... word! ------------------"); 1687 1687 mr_asprintf(&tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG); … … 1803 1803 if (partsize > 0) { 1804 1804 if (!strcmp(format, "7")) { 1805 log_msg(1, "Adding 512K, just in case");1805 mr_msg(1, "Adding 512K, just in case"); 1806 1806 partsize += 512; 1807 1807 } … … 1829 1829 1830 1830 if (pout_to_fdisk) { 1831 log_msg(1, "Doing the new all-in-one fdisk thing");1832 log_msg(1, "output = '%s'", output);1831 mr_msg(1, "Doing the new all-in-one fdisk thing"); 1832 mr_msg(1, "output = '%s'", output); 1833 1833 fput_string_one_char_at_a_time(pout_to_fdisk, output); 1834 1834 fput_string_one_char_at_a_time(pout_to_fdisk, "\n\np\n"); 1835 1835 tmp = last_line_of_file(FDISK_LOG); 1836 1836 if (strstr(tmp, " (m ")) { 1837 log_msg(1, "Successfully created %s%d", drive, partno);1837 mr_msg(1, "Successfully created %s%d", drive, partno); 1838 1838 } else { 1839 log_msg(1, "last line = %s", tmp);1840 log_msg(1, "Failed to create %s%d; sending 'Enter'...", drive,1839 mr_msg(1, "last line = %s", tmp); 1840 mr_msg(1, "Failed to create %s%d; sending 'Enter'...", drive, 1841 1841 partno); 1842 1842 } … … 1844 1844 1845 1845 if (!retval) { 1846 log_msg(1, "Trying to set %s%d's partition type now", drive,1846 mr_msg(1, "Trying to set %s%d's partition type now", drive, 1847 1847 partno); 1848 1848 retval = … … 1850 1850 partsize); 1851 1851 if (retval) { 1852 log_msg(1, "Failed. Trying again...");1852 mr_msg(1, "Failed. Trying again..."); 1853 1853 retval = 1854 1854 set_partition_type(pout_to_fdisk, drive, partno, … … 1857 1857 } 1858 1858 if (retval) { 1859 log_msg(1, "...but failed to set type");1859 mr_msg(1, "...but failed to set type"); 1860 1860 } 1861 1861 } else { … … 1959 1959 /* mountlist=&new_mtlist; */ 1960 1960 /* extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */ 1961 log_msg(0,1961 mr_msg(0, 1962 1962 "Mountlist, including the partitions incorporated in RAID devices:-"); 1963 1963 for (i = 0; i < mountlist->entries; i++) { 1964 1964 log_it(mountlist->el[i].device); 1965 1965 } 1966 log_msg(0, "End of mountlist.");1967 } 1968 log_msg(0, "Stopping all LVMs, just in case");1966 mr_msg(0, "End of mountlist."); 1967 } 1968 mr_msg(0, "Stopping all LVMs, just in case"); 1969 1969 if (!g_text_mode) { 1970 1970 newtSuspend(); … … 1974 1974 newtResume(); 1975 1975 } 1976 log_msg(0, "Stopping all software RAID devices, just in case");1976 mr_msg(0, "Stopping all software RAID devices, just in case"); 1977 1977 stop_all_raid_devices(mountlist); 1978 log_msg(0, "Done.");1978 mr_msg(0, "Done."); 1979 1979 1980 1980 /* … … 2096 2096 mr_free(partition); 2097 2097 2098 log_msg(1, tmp);2098 mr_msg(1, tmp); 2099 2099 mr_free(tmp); 2100 2100 if (partcode[0] != '\0' && strcmp(partcode, "83")) { /* no need to set type if 83: 83 is default */ … … 2106 2106 if (partno > 1 2107 2107 || strstr(tmp1, " (1-4)")) { 2108 log_msg(5, "Specifying partno (%d) - yay", partno);2108 mr_msg(5, "Specifying partno (%d) - yay", partno); 2109 2109 mr_asprintf(&tmp, "%d\n", partno); 2110 2110 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); … … 2112 2112 mr_free(tmp1); 2113 2113 tmp1 = last_line_of_file(FDISK_LOG); 2114 log_msg(5, "A - last line = '%s'", tmp1);2114 mr_msg(5, "A - last line = '%s'", tmp1); 2115 2115 } 2116 2116 mr_free(tmp1); … … 2120 2120 mr_free(tmp); 2121 2121 tmp1 = last_line_of_file(FDISK_LOG); 2122 log_msg(5, "B - last line = '%s'",tmp1);2122 mr_msg(5, "B - last line = '%s'",tmp1); 2123 2123 mr_free(tmp1); 2124 2124 2125 2125 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); 2126 2126 tmp1 = last_line_of_file(FDISK_LOG); 2127 log_msg(5, "C - last line = '%s'",tmp1);2127 mr_msg(5, "C - last line = '%s'",tmp1); 2128 2128 mr_free(tmp1); 2129 2129 2130 2130 tmp = last_line_of_file(FDISK_LOG); 2131 2131 if (!strstr(tmp, " (m ")) { 2132 log_msg(1, "last line = '%s'; part type set failed", tmp);2132 mr_msg(1, "last line = '%s'; part type set failed", tmp); 2133 2133 res++; 2134 2134 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); … … 2140 2140 mr_asprintf(&command, "parted2fdisk %s >> %s 2>> %s", drive, 2141 2141 MONDO_LOGFILE, MONDO_LOGFILE); 2142 log_msg(5, "output = '%s'", output);2143 log_msg(5, "partno=%d; partcode=%s", partno, partcode);2144 log_msg(5, "command = '%s'", command);2142 mr_msg(5, "output = '%s'", output); 2143 mr_msg(5, "partno=%d; partcode=%s", partno, partcode); 2144 mr_msg(5, "command = '%s'", command); 2145 2145 fout = popen(command, "w"); 2146 2146 if (!fout) { … … 2189 2189 mr_asprintf(&program, "raidstart %s", raid_device); 2190 2190 #endif 2191 log_msg(1, "program = %s", program);2191 mr_msg(1, "program = %s", program); 2192 2192 res = run_program_and_log_output(program, 1); 2193 2193 if (g_fprep) { … … 2197 2197 2198 2198 if (res) { 2199 log_msg(1, "Warning - failed to start RAID device %s",2199 mr_msg(1, "Warning - failed to start RAID device %s", 2200 2200 raid_device); 2201 2201 } … … 2238 2238 } 2239 2239 #endif 2240 log_msg(1, "program = %s", program);2240 mr_msg(1, "program = %s", program); 2241 2241 res = run_program_and_log_output(program, 1); 2242 2242 if (g_fprep) { … … 2246 2246 2247 2247 if (res) { 2248 log_msg(1, "Warning - failed to stop RAID device %s", raid_device);2248 mr_msg(1, "Warning - failed to stop RAID device %s", raid_device); 2249 2249 } 2250 2250 retval += res; … … 2263 2263 (mountlist->el[i].device, RAID_DEVICE_STUB, 2264 2264 strlen(RAID_DEVICE_STUB))) { 2265 log_msg(1, "Starting %s", mountlist->el[i].device);2265 mr_msg(1, "Starting %s", mountlist->el[i].device); 2266 2266 res = start_raid_device(mountlist->el[i].device); 2267 2267 retval += res; … … 2269 2269 } 2270 2270 if (retval) { 2271 log_msg(1, "Started all s/w raid devices OK");2271 mr_msg(1, "Started all s/w raid devices OK"); 2272 2272 } else { 2273 log_msg(1, "Failed to start some/all s/w raid devices");2273 mr_msg(1, "Failed to start some/all s/w raid devices"); 2274 2274 } 2275 2275 return (retval); … … 2346 2346 paranoid_fclose(fin); 2347 2347 if (retval) { 2348 log_msg(1, "Warning - unable to stop some RAID devices");2348 mr_msg(1, "Warning - unable to stop some RAID devices"); 2349 2349 } 2350 2350 sync(); … … 2548 2548 2549 2549 if (!strcmp(drivemntlist->el[partno]->mountpoint, "image")) { 2550 log_msg(1, "Skipping %s (%s) because it's an image",2550 mr_msg(1, "Skipping %s (%s) because it's an image", 2551 2551 drivemntlist->el[partno]->device, 2552 2552 drivemntlist->el[partno]->mountpoint); … … 2626 2626 assert(drivemntlist != NULL); 2627 2627 2628 log_msg(1, "Creating list of partitions for drive %s", drive_name);2628 mr_msg(1, "Creating list of partitions for drive %s", drive_name); 2629 2629 2630 2630 mr_asprintf(&tmp_drive_name,drive_name); -
trunk/mondo/src/mondorestore/mondo-restore.c
r1081 r1086 155 155 int retval = 0, res = 0; 156 156 157 log_msg(2, "let_user_edit_the_mountlist() --- starting");157 mr_msg(2, "let_user_edit_the_mountlist() --- starting"); 158 158 159 159 assert(bkpinfo != NULL); … … 162 162 if (!bkpinfo->disaster_recovery) { 163 163 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); 164 log_msg(2, "I guess you're testing edit_mountlist()");164 mr_msg(2, "I guess you're testing edit_mountlist()"); 165 165 } 166 166 if (!does_file_exist(g_mountlist_fname)) { … … 207 207 for (i = 0; i < mountlist->entries; i++) { 208 208 if (strstr(mountlist->el[i].format, "ompaq")) { 209 log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",209 mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)", 210 210 i, mountlist->el[i].device, mountlist->el[i].format); 211 211 … … 286 286 if (bkpinfo->backup_media_type == iso) { 287 287 if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) { 288 log_msg(2,288 mr_msg(2, 289 289 "catchall_mode --- iso_fiddly_bits returned w/ error"); 290 290 return (1); 291 291 } else { 292 log_msg(2, "catchall_mode --- iso_fiddly_bits ok");292 mr_msg(2, "catchall_mode --- iso_fiddly_bits ok"); 293 293 } 294 294 } 295 295 296 296 if (c == 'I') { 297 log_msg(2, "IM selected");297 mr_msg(2, "IM selected"); 298 298 retval += interactive_mode(bkpinfo, mountlist, raidlist); 299 299 } else if (c == 'N') { 300 log_msg(2, "NM selected");300 mr_msg(2, "NM selected"); 301 301 retval += nuke_mode(bkpinfo, mountlist, raidlist); 302 302 } else if (c == 'C') { 303 log_msg(2, "CM selected");303 mr_msg(2, "CM selected"); 304 304 retval += compare_mode(bkpinfo, mountlist, raidlist); 305 305 } … … 351 351 /* try to partition and format */ 352 352 353 log_msg(2, "interactive_mode --- starting (great, assertions OK)");353 mr_msg(2, "interactive_mode --- starting (great, assertions OK)"); 354 354 355 355 assert(bkpinfo != NULL); … … 357 357 assert(raidlist != NULL); 358 358 359 log_msg(2, "interactive_mode --- assertions OK");359 mr_msg(2, "interactive_mode --- assertions OK"); 360 360 361 361 if (g_text_mode) { … … 378 378 #endif 379 379 if (strstr(tmp,"noresize")) { 380 log_msg(1, "Not resizing mountlist.");380 mr_msg(1, "Not resizing mountlist."); 381 381 } else { 382 382 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 400 400 paranoid_MR_finish(1); 401 401 } 402 log_msg(2, "Proceeding...");402 mr_msg(2, "Proceeding..."); 403 403 save_mountlist_to_disk(mountlist, g_mountlist_fname); 404 404 save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME); … … 496 496 ("Do you want me to restore all of your data?")))) 497 497 { 498 log_msg(1, "Restoring all data");498 mr_msg(1, "Restoring all data"); 499 499 retval += restore_everything(bkpinfo, NULL); 500 500 } else if ((restore_all = … … 520 520 mr_allocstr(bkpinfo->restore_path, ""); // so we restore to [blank]/file/name :) 521 521 } 522 log_msg(1, "Restoring subset");522 mr_msg(1, "Restoring subset"); 523 523 retval += restore_everything(bkpinfo, filelist); 524 524 free_filelist(filelist); … … 626 626 assert(raidlist != NULL); 627 627 if (iso_fiddly_bits(bkpinfo, nuke_me_please)) { 628 log_msg(1, "iso_mode --- returning w/ error");628 mr_msg(1, "iso_mode --- returning w/ error"); 629 629 return (1); 630 630 } else { … … 726 726 assert(raidlist != NULL); 727 727 728 log_msg(2, "nuke_mode --- starting");728 mr_msg(2, "nuke_mode --- starting"); 729 729 730 730 get_cfg_file_from_archive_or_bust(bkpinfo); … … 736 736 #endif 737 737 if (strstr(tmp,"noresize")) { 738 log_msg(2, "Not resizing mountlist.");738 mr_msg(2, "Not resizing mountlist."); 739 739 } else { 740 740 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 776 776 #endif 777 777 if (strstr(tmp,"nopart")) { 778 log_msg(2,778 mr_msg(2, 779 779 "Not partitioning drives due to 'nopart' option."); 780 780 res = 0; … … 829 829 retval += restore_everything(bkpinfo, NULL); 830 830 if (!run_boot_loader(FALSE)) { 831 log_msg(1,831 mr_msg(1, 832 832 "Great! Boot loader was installed. No need for msg at end."); 833 833 boot_loader_installed = TRUE; … … 907 907 struct s_node *filelist = NULL; 908 908 909 log_msg(1, "restore_to_live_filesystem() - starting");909 mr_msg(1, "restore_to_live_filesystem() - starting"); 910 910 assert(bkpinfo != NULL); 911 911 … … 922 922 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); 923 923 if (bkpinfo->media_device == NULL) { 924 log_msg(2, "Warning - failed to find media dev");924 mr_msg(2, "Warning - failed to find media dev"); 925 925 } else { 926 log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);927 } 928 929 930 log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);926 mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device); 927 } 928 929 930 mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir); 931 931 932 932 open_evalcall_form(_("Thinking...")); … … 953 953 } 954 954 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 955 log_msg(2,955 mr_msg(2, 956 956 "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway."); 957 957 } … … 1038 1038 if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) < 1039 1039 sizeof(biggiestruct)) { 1040 log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",1040 mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d", 1041 1041 bigfileno + 1); 1042 1042 } … … 1048 1048 mr_asprintf(&tmp, "Warning - bigfile %ld does not have a checksum", 1049 1049 bigfileno + 1); 1050 log_msg(3, tmp);1050 mr_msg(3, tmp); 1051 1051 mr_free(tmp); 1052 1052 /* BERLIOS : Useless ??? … … 1068 1068 node = find_string_at_node(filelist, biggiestruct.filename); 1069 1069 if (!node) { 1070 log_msg(0, "Skipping %s (name isn't in filelist)",1070 mr_msg(0, "Skipping %s (name isn't in filelist)", 1071 1071 biggiestruct.filename); 1072 1072 return (pathname_of_last_file_restored); 1073 1073 } else if (!(node->selected)) { 1074 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1074 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1075 1075 biggiestruct.filename); 1076 1076 return (pathname_of_last_file_restored); … … 1079 1079 /* otherwise, continue */ 1080 1080 1081 log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);1081 mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename); 1082 1082 if (biggiestruct.use_ntfsprog) { 1083 1083 if (strncmp(biggiestruct.filename, "/dev/", 5)) { 1084 log_msg(1,1084 mr_msg(1, 1085 1085 "I was in error when I set biggiestruct.use_ntfsprog to TRUE."); 1086 log_msg(1, "%s isn't even in /dev", biggiestruct.filename);1086 mr_msg(1, "%s isn't even in /dev", biggiestruct.filename); 1087 1087 biggiestruct.use_ntfsprog = FALSE; 1088 1088 } … … 1094 1094 g_loglevel = 4; 1095 1095 use_ntfsprog_hack = TRUE; 1096 log_msg(2,1096 mr_msg(2, 1097 1097 "Calling ntfsclone in background because %s is an NTFS /dev entry", 1098 1098 outfile_fname); … … 1106 1106 fatal_error("Fork failure"); 1107 1107 case 0: 1108 log_msg(3,1108 mr_msg(3, 1109 1109 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1110 1110 biggiestruct.filename, ntfsprog_fifo); … … 1112 1112 feed_outfrom_ntfsprog(biggiestruct.filename, 1113 1113 ntfsprog_fifo); 1114 // log_msg(3, "CHILD - fip - exiting");1114 // mr_msg(3, "CHILD - fip - exiting"); 1115 1115 exit(res); 1116 1116 break; 1117 1117 default: 1118 log_msg(3,1118 mr_msg(3, 1119 1119 "feed_into_ntfsprog() called in background --- pid=%ld", 1120 1120 (long int) (pid)); … … 1133 1133 mr_asprintf(&tmp, "Reassembling big file %ld (%s)", bigfileno + 1, 1134 1134 outfile_fname); 1135 log_msg(2, tmp);1135 mr_msg(2, tmp); 1136 1136 mr_free(tmp); 1137 1137 … … 1144 1144 mr_asprintf(&pathname_of_last_file_restored, biggiestruct.filename); 1145 1145 1146 log_msg(3, "file_to_openout = %s", file_to_openout);1146 mr_msg(3, "file_to_openout = %s", file_to_openout); 1147 1147 if (!(fout = fopen(file_to_openout, "w"))) { 1148 1148 log_to_screen(_("Cannot openout outfile_fname - hard disk full?")); 1149 1149 return (pathname_of_last_file_restored); 1150 1150 } 1151 log_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself1151 mr_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself 1152 1152 1153 1153 for (sliceno = 1, finished = FALSE; !finished;) { … … 1160 1160 !does_file_exist(tmp1) && 1161 1161 !does_file_exist(tmp2)) { 1162 log_msg(3,1162 mr_msg(3, 1163 1163 "Cannot find a data slice or terminator slice on CD %d", 1164 1164 g_current_media_number); … … 1168 1168 bkpinfo->backup_media_string, 1169 1169 g_current_media_number, sliceno); 1170 log_msg(2, tmp3);1170 mr_msg(2, tmp3); 1171 1171 mr_free(tmp3); 1172 1172 … … 1181 1181 } else { 1182 1182 if (does_file_exist(tmp) && length_of_file(tmp) == 0) { 1183 log_msg(2,1183 mr_msg(2, 1184 1184 "End of bigfile # %ld (slice %ld is the terminator)", 1185 1185 bigfileno + 1, sliceno); … … 1207 1207 bkpinfo->backup_media_string, 1208 1208 g_current_media_number, bigfileno + 1, sliceno); 1209 log_msg(2, tmp3);1209 mr_msg(2, tmp3); 1210 1210 if (!g_text_mode) { 1211 1211 newtDrawRootText(0, g_noof_rows - 2, tmp3); … … 1243 1243 1244 1244 if (use_ntfsprog_hack) { 1245 log_msg(3, "Waiting for ntfsclone to finish");1245 mr_msg(3, "Waiting for ntfsclone to finish"); 1246 1246 mr_asprintf(&tmp, 1247 1247 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1321 1321 if (use_ntfsprog == BLK_START_A_PIHBIGGIE) { 1322 1322 use_ntfsprog = 1; 1323 log_msg(1, "%s --- pih=YES", orig_bf_fname);1323 mr_msg(1, "%s --- pih=YES", orig_bf_fname); 1324 1324 } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) { 1325 1325 use_ntfsprog = 0; 1326 log_msg(1, "%s --- pih=NO", orig_bf_fname);1326 mr_msg(1, "%s --- pih=NO", orig_bf_fname); 1327 1327 } else { 1328 1328 use_ntfsprog = 0; 1329 log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);1329 mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname); 1330 1330 } 1331 1331 … … 1338 1338 if (!node) { 1339 1339 dummy_restore = TRUE; 1340 log_msg(1,1340 mr_msg(1, 1341 1341 "Skipping big file %ld (%s) - not in biggielist subset", 1342 1342 biggiefile_number + 1, orig_bf_fname); … … 1344 1344 } else if (!(node->selected)) { 1345 1345 dummy_restore = TRUE; 1346 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1346 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1347 1347 orig_bf_fname); 1348 1348 pathname_of_last_file_restored = NULL; … … 1352 1352 if (use_ntfsprog) { 1353 1353 if (strncmp(orig_bf_fname, "/dev/", 5)) { 1354 log_msg(1, "I was in error when I set use_ntfsprog to TRUE.");1355 log_msg(1, "%s isn't even in /dev", orig_bf_fname);1354 mr_msg(1, "I was in error when I set use_ntfsprog to TRUE."); 1355 mr_msg(1, "%s isn't even in /dev", orig_bf_fname); 1356 1356 use_ntfsprog = FALSE; 1357 1357 } … … 1362 1362 mr_asprintf(&outfile_fname, orig_bf_fname); 1363 1363 use_ntfsprog_hack = TRUE; 1364 log_msg(2,1364 mr_msg(2, 1365 1365 "Calling ntfsclone in background because %s is a /dev entry", 1366 1366 outfile_fname); … … 1376 1376 fatal_error("Fork failure"); 1377 1377 case 0: 1378 log_msg(3,1378 mr_msg(3, 1379 1379 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1380 1380 outfile_fname, ntfsprog_fifo); 1381 1381 res = feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo); 1382 // log_msg(3, "CHILD - fip - exiting");1382 // mr_msg(3, "CHILD - fip - exiting"); 1383 1383 exit(res); 1384 1384 break; 1385 1385 default: 1386 log_msg(3,1386 mr_msg(3, 1387 1387 "feed_into_ntfsprog() called in background --- pid=%ld", 1388 1388 (long int) (pid)); … … 1406 1406 mr_asprintf(&tmp1, "Reassembling big file %ld (%s)", 1407 1407 biggiefile_number + 1, orig_bf_fname); 1408 log_msg(2, tmp1);1408 mr_msg(2, tmp1); 1409 1409 mr_free(tmp1); 1410 1410 } … … 1422 1422 } 1423 1423 mr_asprintf(&tmp1, "Pipe command = '%s'", command); 1424 log_msg(3, tmp1);1424 mr_msg(3, tmp1); 1425 1425 mr_free(tmp1); 1426 1426 … … 1439 1439 mr_asprintf(&tmp1, "Working on file #%ld, slice #%ld ", 1440 1440 biggiefile_number + 1, current_slice_number); 1441 log_msg(2, tmp1);1441 mr_msg(2, tmp1); 1442 1442 1443 1443 if (!g_text_mode) { … … 1460 1460 ((void *) &biggiestruct, 1, sizeof(biggiestruct), 1461 1461 fin) < sizeof(biggiestruct)) { 1462 log_msg(2,1462 mr_msg(2, 1463 1463 "Warning - unable to get biggiestruct of bigfile #%d", 1464 1464 biggiefile_number + 1); … … 1481 1481 paranoid_pclose(pout); 1482 1482 1483 log_msg(1, "pathname_of_last_file_restored is now %s",1483 mr_msg(1, "pathname_of_last_file_restored is now %s", 1484 1484 pathname_of_last_file_restored); 1485 1485 1486 1486 if (use_ntfsprog_hack) { 1487 log_msg(3, "Waiting for ntfsclone to finish");1487 mr_msg(3, "Waiting for ntfsclone to finish"); 1488 1488 mr_asprintf(&tmp, 1489 1489 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1492 1492 } 1493 1493 mr_free(tmp); 1494 log_msg(3, "OK, ntfsclone has really finished");1495 } 1496 1497 log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);1498 log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);1494 mr_msg(3, "OK, ntfsclone has really finished"); 1495 } 1496 1497 mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename); 1498 mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum); 1499 1499 if (strcmp(outfile_fname, "/dev/null")) { 1500 1500 chmod(outfile_fname, biggiestruct.properties.st_mode); … … 1550 1550 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); 1551 1551 1552 log_msg(5, "Entering");1552 mr_msg(5, "Entering"); 1553 1553 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; 1554 1554 mr_asprintf(&command, "mkdir -p %s/tmp", MNT_RESTORING); … … 1559 1559 current_tarball_number); 1560 1560 if (length_of_file(filelist_name) <= 2) { 1561 log_msg(2, "There are _zero_ files in filelist '%s'",1561 mr_msg(2, "There are _zero_ files in filelist '%s'", 1562 1562 filelist_name); 1563 log_msg(2,1563 mr_msg(2, 1564 1564 "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)"); 1565 log_msg(2,1565 mr_msg(2, 1566 1566 "but it's non-critical. It's cosmetic. Don't worry about it."); 1567 1567 retval = 0; 1568 log_msg(5, "Leaving");1568 mr_msg(5, "Leaving"); 1569 1569 return (retval); 1570 1570 } 1571 1571 if (count_lines_in_file(filelist_name) <= 0 1572 1572 || length_of_file(tarball_fname) <= 0) { 1573 log_msg(3, "length_of_file(%s) = %llu", tarball_fname,1573 mr_msg(3, "length_of_file(%s) = %llu", tarball_fname, 1574 1574 length_of_file(tarball_fname)); 1575 1575 mr_asprintf(&tmp, "Unable to restore fileset #%ld (CD I/O error)", … … 1578 1578 mr_free(tmp); 1579 1579 retval = 1; 1580 log_msg(5, "Leaving");1580 mr_msg(5, "Leaving"); 1581 1581 return (retval); 1582 1582 } … … 1591 1591 <= 0) { 1592 1592 mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number); 1593 log_msg(1, tmp);1593 mr_msg(1, tmp); 1594 1594 mr_free(tmp); 1595 1595 } else { 1596 log_msg(3, "Saved fileset %ld's subset to %s",1596 mr_msg(3, "Saved fileset %ld's subset to %s", 1597 1597 current_tarball_number, filelist_subset_fname); 1598 1598 } … … 1678 1678 1679 1679 #undef BUFSIZE 1680 log_msg(1, "command = '%s'", command);1680 mr_msg(1, "command = '%s'", command); 1681 1681 unlink(temp_log); 1682 1682 res = system(command); … … 1685 1685 if (p) { 1686 1686 p[0] = p[1] = p[2] = p[3] = ' '; 1687 log_msg(1, "new command = '%s'", command);1687 mr_msg(1, "new command = '%s'", command); 1688 1688 res = system(command); 1689 1689 } … … 1696 1696 1697 1697 if (g_getfattr) { 1698 log_msg(1, "Setting fattr list %s", xattr_fname);1698 mr_msg(1, "Setting fattr list %s", xattr_fname); 1699 1699 if (length_of_file(xattr_fname) > 0) { 1700 1700 res = set_fattr_list(filelist_subset_fname, xattr_fname); … … 1703 1703 ("Errors occurred while setting extended attributes"); 1704 1704 } else { 1705 log_msg(1, "I set xattr OK");1705 mr_msg(1, "I set xattr OK"); 1706 1706 } 1707 1707 retval += res; … … 1709 1709 } 1710 1710 if (g_getfacl) { 1711 log_msg(1, "Setting acl list %s", acl_fname);1711 mr_msg(1, "Setting acl list %s", acl_fname); 1712 1712 if (length_of_file(acl_fname) > 0) { 1713 1713 res = set_acl_list(filelist_subset_fname, acl_fname); … … 1716 1716 ("Errors occurred while setting access control lists"); 1717 1717 } else { 1718 log_msg(1, "I set ACL OK");1718 mr_msg(1, "I set ACL OK"); 1719 1719 } 1720 1720 retval += res; … … 1725 1725 system(command); 1726 1726 mr_free(command); 1727 log_msg(2, "Errors occurred while processing fileset #%d",1727 mr_msg(2, "Errors occurred while processing fileset #%d", 1728 1728 current_tarball_number); 1729 1729 } else { 1730 log_msg(2, "Fileset #%d processed OK", current_tarball_number);1730 mr_msg(2, "Fileset #%d processed OK", current_tarball_number); 1731 1731 } 1732 1732 unlink(xattr_fname); … … 1745 1745 mr_free(acl_fname); 1746 1746 mr_free(temp_log); 1747 log_msg(5, "Leaving");1747 mr_msg(5, "Leaving"); 1748 1748 return (retval); 1749 1749 } … … 1800 1800 bkpinfo->backup_media_string, 1801 1801 g_current_media_number); 1802 log_msg(2, tmp);1802 mr_msg(2, tmp); 1803 1803 mr_free(tmp); 1804 1804 run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE); … … 1820 1820 } 1821 1821 if (res) { 1822 log_msg(1, "Warning - error reading afioball from tape");1822 mr_msg(1, "Warning - error reading afioball from tape"); 1823 1823 } 1824 1824 if (bkpinfo->compression_level != 0) { … … 1843 1843 executable, afio_fname, filelist_fname, MONDO_LOGFILE); 1844 1844 } 1845 log_msg(1, "command = %s", command);1845 mr_msg(1, "command = %s", command); 1846 1846 if (system(command)) { 1847 log_msg(4, "Warning - error occurred while retrieving TOC");1847 mr_msg(4, "Warning - error occurred while retrieving TOC"); 1848 1848 } 1849 1849 mr_free(command); … … 1854 1854 <= 0 || length_of_file(filelist_subset_fname) < 2) { 1855 1855 if (length_of_file(filelist_subset_fname) < 2) { 1856 log_msg(1, "No matches found in fileset %ld",1856 mr_msg(1, "No matches found in fileset %ld", 1857 1857 current_tarball_number); 1858 1858 } 1859 1859 mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number); 1860 log_msg(2, tmp);1860 mr_msg(2, tmp); 1861 1861 mr_free(tmp); 1862 1862 restore_this_fileset = FALSE; 1863 1863 } else { 1864 log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",1864 mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s", 1865 1865 matches, current_tarball_number, 1866 1866 filelist_subset_fname); … … 1892 1892 // Call if IF there are files to restore (selectively/unconditionally) 1893 1893 if (restore_this_fileset) { 1894 log_msg(1, "Calling command='%s'", command);1894 mr_msg(1, "Calling command='%s'", command); 1895 1895 paranoid_system(command); 1896 1896 … … 1899 1899 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1900 1900 if (res) { 1901 log_msg(1, "Errors occurred while setting xattr");1901 mr_msg(1, "Errors occurred while setting xattr"); 1902 1902 } else { 1903 log_msg(1, "I set xattr OK");1903 mr_msg(1, "I set xattr OK"); 1904 1904 } 1905 1905 retval += res; … … 1910 1910 res = set_acl_list(filelist_subset_fname, acl_fname); 1911 1911 if (res) { 1912 log_msg(1, "Errors occurred while setting ACL");1912 mr_msg(1, "Errors occurred while setting ACL"); 1913 1913 } else { 1914 log_msg(1, "I set ACL OK");1914 mr_msg(1, "I set ACL OK"); 1915 1915 } 1916 1916 retval += res; … … 1918 1918 1919 1919 } else { 1920 log_msg(1, "NOT CALLING '%s'", command);1920 mr_msg(1, "NOT CALLING '%s'", command); 1921 1921 } 1922 1922 mr_free(command); … … 1970 1970 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 1971 1971 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 1972 log_msg(1, "Warning - cannot openout %s",1972 mr_msg(1, "Warning - cannot openout %s", 1973 1973 biggies_whose_EXATs_we_should_set); 1974 1974 } … … 1983 1983 1984 1984 if (length_of_file(BIGGIELIST) < 6) { 1985 log_msg(1, "OK, no biggielist; not restoring biggiefiles");1985 mr_msg(1, "OK, no biggielist; not restoring biggiefiles"); 1986 1986 return (0); 1987 1987 } 1988 1988 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 1989 1989 if (noof_biggiefiles <= 0) { 1990 log_msg(2,1990 mr_msg(2, 1991 1991 "OK, no biggiefiles in biggielist; not restoring biggiefiles"); 1992 1992 return (0); … … 1994 1994 mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives", 1995 1995 noof_biggiefiles); 1996 log_msg(2, tmp);1996 mr_msg(2, tmp); 1997 1997 mr_free(tmp); 1998 1998 … … 2002 2002 "", total_slices); 2003 2003 for (bigfileno = 0, finished = FALSE; !finished;) { 2004 log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);2004 mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1); 2005 2005 tmp = slice_fname(bigfileno, 0, ARCHIVES_PATH, ""); 2006 2006 if (!does_file_exist(tmp)) { 2007 log_msg(3,2007 mr_msg(3, 2008 2008 "...but its first slice isn't on this CD. Perhaps this was a selective restore?"); 2009 log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",2009 mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d", 2010 2010 bigfileno + 1, 2011 2011 bkpinfo->backup_media_string, 2012 2012 g_current_media_number); 2013 2013 tmp1 = slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""); 2014 log_msg(3, "Slicename would have been %s", tmp1);2014 mr_msg(3, "Slicename would have been %s", tmp1); 2015 2015 mr_free(tmp1); 2016 2016 … … 2018 2018 if (just_changed_cds) { 2019 2019 just_changed_cds = FALSE; 2020 log_msg(3,2020 mr_msg(3, 2021 2021 "I'll continue to scan this CD for bigfiles to be restored."); 2022 2022 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { … … 2031 2031 just_changed_cds = TRUE; 2032 2032 } else { 2033 log_msg(2, "There was no bigfile #%ld. That's OK.",2033 mr_msg(2, "There was no bigfile #%ld. That's OK.", 2034 2034 bigfileno + 1); 2035 log_msg(2, "I'm going to stop restoring bigfiles now.");2035 mr_msg(2, "I'm going to stop restoring bigfiles now."); 2036 2036 finished = TRUE; 2037 2037 } … … 2122 2122 2123 2123 mvaddstr_and_log_it(g_currentY, 0, _("Restoring from archives")); 2124 log_msg(2,2124 mr_msg(2, 2125 2125 "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER"); 2126 2126 if (g_current_media_number != 1) { 2127 log_msg(3, "OK, that's jacked up.");2127 mr_msg(3, "OK, that's jacked up."); 2128 2128 g_current_media_number = 1; 2129 2129 } … … 2199 2199 bkpinfo->backup_media_string, 2200 2200 g_current_media_number); 2201 // log_msg(3, "progress_str = %s", progress_str);2201 // mr_msg(3, "progress_str = %s", progress_str); 2202 2202 for (res = 999, attempts = 0; attempts < 3 && res != 0; 2203 2203 attempts++) { … … 2299 2299 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 2300 2300 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 2301 log_msg(1, "Warning - cannot openout %s",2301 mr_msg(1, "Warning - cannot openout %s", 2302 2302 biggies_whose_EXATs_we_should_set); 2303 2303 } … … 2315 2315 mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives", 2316 2316 noof_biggiefiles); 2317 log_msg(2, tmp);2317 mr_msg(2, tmp); 2318 2318 mr_free(tmp); 2319 2319 … … 2350 2350 current_bigfile_number, 2351 2351 filelist, ctrl_chr); 2352 log_msg(1, "I believe I have restored %s",2352 mr_msg(1, "I believe I have restored %s", 2353 2353 pathname_of_last_biggie_restored); 2354 2354 if (fbw && pathname_of_last_biggie_restored[0]) { … … 2370 2370 noof_biggiefiles, current_bigfile_number); 2371 2371 } 2372 log_msg(1, tmp);2372 mr_msg(1, tmp); 2373 2373 mr_free(tmp); 2374 2374 … … 2379 2379 if (g_getfattr) { 2380 2380 if (length_of_file(xattr_fname) > 0) { 2381 log_msg(1, "set_fattr_List(%s,%s)",2381 mr_msg(1, "set_fattr_List(%s,%s)", 2382 2382 biggies_whose_EXATs_we_should_set, xattr_fname); 2383 2383 set_fattr_list(biggies_whose_EXATs_we_should_set, … … 2387 2387 if (g_getfacl) { 2388 2388 if (length_of_file(acl_fname) > 0) { 2389 log_msg(1, "set_acl_list(%s,%s)",2389 mr_msg(1, "set_acl_list(%s,%s)", 2390 2390 biggies_whose_EXATs_we_should_set, acl_fname); 2391 2391 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname); … … 2469 2469 progress_str, max_val); 2470 2470 2471 log_msg(3, "hey");2471 mr_msg(3, "hey"); 2472 2472 2473 2473 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2474 2474 if (res) { 2475 log_msg(2, "Warning - error reading afioball from tape");2475 mr_msg(2, "Warning - error reading afioball from tape"); 2476 2476 } 2477 2477 retval += res; … … 2479 2479 wrong_marker(BLK_START_AFIOBALLS, ctrl_chr); 2480 2480 } 2481 log_msg(2, "ho");2481 mr_msg(2, "ho"); 2482 2482 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2483 2483 while (ctrl_chr != BLK_STOP_AFIOBALLS) { … … 2548 2548 mr_free(tmp_fname); 2549 2549 2550 log_msg(1, "All done with afioballs");2550 mr_msg(1, "All done with afioballs"); 2551 2551 close_progress_form(); 2552 2552 if (retval) { … … 2586 2586 malloc_string(cwd); 2587 2587 malloc_string(newpath); 2588 log_msg(2, "restore_everything() --- starting");2588 mr_msg(2, "restore_everything() --- starting"); 2589 2589 g_current_media_number = 1; 2590 2590 /* BERLIOS: should test return value, or better change the function */ … … 2594 2594 mr_free(tmp); 2595 2595 2596 log_msg(1, "Changing dir to %s", bkpinfo->restore_path);2596 mr_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2597 2597 chdir(bkpinfo->restore_path); 2598 2598 /* BERLIOS: should test return value, or better change the function */ 2599 2599 getcwd(newpath, MAX_STR_LEN - 1); 2600 log_msg(1, "path is now %s", newpath);2601 log_msg(1, "restoring everything");2600 mr_msg(1, "path is now %s", newpath); 2601 mr_msg(1, "restoring everything"); 2602 2602 tmp = find_home_of_exe("petris"); 2603 2603 if (!tmp && !g_text_mode) { … … 2642 2642 } 2643 2643 if (length_of_file("/etc/raidtab") > 0) { 2644 log_msg(2, "Copying local raidtab to restored filesystem");2644 mr_msg(2, "Copying local raidtab to restored filesystem"); 2645 2645 run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING 2646 2646 "/etc/raidtab", FALSE); 2647 2647 } 2648 2648 kill_petris(); 2649 log_msg(2, "restore_everything() --- leaving");2649 mr_msg(2, "restore_everything() --- leaving"); 2650 2650 mr_free(cwd); 2651 2651 mr_free(newpath); … … 2690 2690 sprintf(tmp, "restore_here = '%s'", restore_here); 2691 2691 2692 log_msg(2, tmp);2693 2694 log_msg(2, "restore_live_from_monitas_server() - starting");2692 mr_msg(2, tmp); 2693 2694 mr_msg(2, "restore_live_from_monitas_server() - starting"); 2695 2695 unlink("/tmp/mountlist.txt"); 2696 2696 unlink("/tmp/filelist.full"); … … 2701 2701 strcpy(bkpinfo->restore_path, restore_here); 2702 2702 } 2703 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2703 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2704 2704 sprintf(tmp, "FYI - data will be restored to %s", 2705 2705 bkpinfo->restore_path); 2706 log_msg(3, tmp);2707 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2706 mr_msg(3, tmp); 2707 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2708 2708 sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d", 2709 2709 (int) (random() % 32768)); … … 2756 2756 restore_this_directory, g_biggielist_txt, g_biggielist_txt); 2757 2757 if (system(command)) { 2758 log_msg(1,2758 mr_msg(1, 2759 2759 "Error(s) occurred while processing biggielist and wildcard"); 2760 2760 } … … 2764 2764 retval += restore_everything(bkpinfo, filelist); 2765 2765 free_filelist(filelist); 2766 log_msg(2, "--------End of restore_live_from_monitas_server--------");2766 mr_msg(2, "--------End of restore_live_from_monitas_server--------"); 2767 2767 return (retval); 2768 2768 } … … 2785 2785 void welcome_to_mondorestore() 2786 2786 { 2787 log_msg(0, "-------------- Mondo Restore v%s -------------",2787 mr_msg(0, "-------------- Mondo Restore v%s -------------", 2788 2788 PACKAGE_VERSION); 2789 log_msg(0,2789 mr_msg(0, 2790 2790 "DON'T PANIC! Mondorestore logs almost everything, so please "); 2791 log_msg(0,2791 mr_msg(0, 2792 2792 "don't break out in a cold sweat just because you see a few "); 2793 log_msg(0,2793 mr_msg(0, 2794 2794 "error messages in the log. Read them; analyze them; see if "); 2795 log_msg(0,2795 mr_msg(0, 2796 2796 "they are significant; above all, verify your backups! Please"); 2797 log_msg(0,2797 mr_msg(0, 2798 2798 "attach a compressed copy of this log to any e-mail you send "); 2799 log_msg(0,2799 mr_msg(0, 2800 2800 "to the Mondo mailing list when you are seeking technical "); 2801 log_msg(0,2801 mr_msg(0, 2802 2802 "support. Without it, we can't help you. - DevTeam"); 2803 log_msg(0,2803 mr_msg(0, 2804 2804 "------------------------------------------------------------"); 2805 log_msg(0,2805 mr_msg(0, 2806 2806 "BTW, despite (or perhaps because of) the wealth of messages,"); 2807 log_msg(0,2807 mr_msg(0, 2808 2808 "some users are inclined to stop reading this log. If Mondo "); 2809 log_msg(0,2809 mr_msg(0, 2810 2810 "stopped for some reason, chances are it's detailed here. "); 2811 log_msg(0,2811 mr_msg(0, 2812 2812 "More than likely there's a message near the end of this "); 2813 log_msg(0,2813 mr_msg(0, 2814 2814 "log that will tell you what is wrong. Please read it! "); 2815 log_msg(0,2815 mr_msg(0, 2816 2816 "------------------------------------------------------------"); 2817 2817 } … … 2863 2863 if (strstr(tmp,"textonly")) { 2864 2864 g_text_mode = TRUE; 2865 log_msg(1, "TEXTONLY MODE");2865 mr_msg(1, "TEXTONLY MODE"); 2866 2866 } else { 2867 2867 g_text_mode = FALSE; … … 2896 2896 g_kernel_version = get_kernel_version(); 2897 2897 2898 log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);2898 mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname); 2899 2899 mkdir(MNT_CDROM, 0x770); 2900 2900 … … 2902 2902 mr_asprintf(&tmp, "%s.orig", g_mountlist_fname); 2903 2903 if (!does_file_exist(g_mountlist_fname)) { 2904 log_msg(2,2904 mr_msg(2, 2905 2905 "%ld: Warning - g_mountlist_fname (%s) does not exist yet", 2906 2906 __LINE__, g_mountlist_fname); … … 2932 2932 welcome_to_mondorestore(); 2933 2933 if (bkpinfo->disaster_recovery) { 2934 log_msg(1, "I am in disaster recovery mode");2934 mr_msg(1, "I am in disaster recovery mode"); 2935 2935 } else { 2936 log_msg(1, "I am in normal, live mode");2936 mr_msg(1, "I am in normal, live mode"); 2937 2937 } 2938 2938 … … 3019 3019 3020 3020 if (argc == 5 && strcmp(argv[1], "--copy") == 0) { 3021 log_msg(1, "SCORE");3021 mr_msg(1, "SCORE"); 3022 3022 g_loglevel = 10; 3023 3023 if (strstr(argv[2], "save")) { 3024 log_msg(1, "Saving from %s to %s", argv[3], argv[4]);3024 mr_msg(1, "Saving from %s to %s", argv[3], argv[4]); 3025 3025 fin = fopen(argv[3], "r"); 3026 3026 fout = fopen(argv[4], "w"); … … 3075 3075 // return(1); 3076 3076 } 3077 log_msg(1, "I am in normal, live mode.");3078 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);3077 mr_msg(1, "I am in normal, live mode."); 3078 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 3079 3079 mount_boot_if_necessary(); /* for Gentoo users */ 3080 log_msg(2, "Still here.");3080 mr_msg(2, "Still here."); 3081 3081 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) { 3082 3082 g_restoring_live_from_cd = TRUE; 3083 3083 } else { 3084 log_msg(2, "Calling restore_to_live_filesystem()");3084 mr_msg(2, "Calling restore_to_live_filesystem()"); 3085 3085 retval = restore_to_live_filesystem(bkpinfo); 3086 3086 } 3087 log_msg(2, "Still here. Yay.");3087 mr_msg(2, "Still here. Yay."); 3088 3088 if (strlen(bkpinfo->tmpdir) > 0) { 3089 3089 mr_asprintf(&tmp, "rm -Rf %s/*", bkpinfo->tmpdir); … … 3095 3095 } else { 3096 3096 /* Disaster recovery mode (must be) */ 3097 log_msg(1, "I must be in disaster recovery mode.");3098 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);3097 mr_msg(1, "I must be in disaster recovery mode."); 3098 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 3099 3099 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) { 3100 3100 log_to_screen(_("Uh, that hasn't been implemented yet.")); … … 3115 3115 if (bkpinfo->backup_media_type == nfs 3116 3116 && !is_this_device_mounted(bkpinfo->nfs_mount)) { 3117 log_msg(1, "Mounting nfs dir");3117 mr_msg(1, "Mounting nfs dir"); 3118 3118 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 3119 3119 run_program_and_log_output("mkdir -p /tmp/isodir", 5); … … 3133 3133 3134 3134 3135 log_msg(1, "Send in the clowns.");3135 mr_msg(1, "Send in the clowns."); 3136 3136 3137 3137 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) { 3138 log_msg(0, "Partitioning only.");3138 mr_msg(0, "Partitioning only."); 3139 3139 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3140 3140 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3145 3145 3146 3146 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) { 3147 log_msg(0, "Formatting only.");3147 mr_msg(0, "Formatting only."); 3148 3148 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3149 3149 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3154 3154 3155 3155 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) { 3156 log_msg(0, "Stopping LVM and RAID");3156 mr_msg(0, "Stopping LVM and RAID"); 3157 3157 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3158 3158 mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3241 3241 // g_I_have_just_nuked is set true by nuke_mode() just before it returns 3242 3242 if (!system("which post-nuke > /dev/null 2> /dev/null")) { 3243 log_msg(1, "post-nuke found; find out whether we should run it...");3243 mr_msg(1, "post-nuke found; find out whether we should run it..."); 3244 3244 if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) { 3245 3245 run_postnuke = TRUE; 3246 log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");3246 mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists."); 3247 3247 } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) { 3248 3248 run_postnuke = TRUE; 3249 log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");3249 mr_msg(1, "Yes, will run post-nuke because user interactively asked for it."); 3250 3250 } else { 3251 3251 run_postnuke = FALSE; 3252 log_msg(1, "No, will not run post-nuke.");3252 mr_msg(1, "No, will not run post-nuke."); 3253 3253 } 3254 3254 } else { 3255 log_msg(1, "No post-nuke found.");3255 mr_msg(1, "No post-nuke found."); 3256 3256 } 3257 3257 if (run_postnuke) { … … 3261 3261 ("Unable to re-mount partitions for post-nuke stuff"); 3262 3262 } else { 3263 log_msg(1, "Re-mounted partitions for post-nuke stuff");3263 mr_msg(1, "Re-mounted partitions for post-nuke stuff"); 3264 3264 sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path, 3265 3265 retval); 3266 log_msg(2, "Calling '%s'", tmp);3266 mr_msg(2, "Calling '%s'", tmp); 3267 3267 if ((res = run_program_and_log_output(tmp, 0))) { 3268 3268 log_OS_error(tmp); 3269 3269 } 3270 log_msg(1, "post-nuke returned w/ res=%d", res);3270 mr_msg(1, "post-nuke returned w/ res=%d", res); 3271 3271 } 3272 3272 unmount_all_devices(mountlist); -
trunk/mondo/src/mondorestore/mondo-rstr-compare.c
r1081 r1086 57 57 insist_on_this_cd_number(bkpinfo, (++g_current_media_number)); 58 58 } else { 59 log_msg(2, "No CD's left. No biggiefiles left. No problem.");59 mr_msg(2, "No CD's left. No biggiefiles left. No problem."); 60 60 return (0); 61 61 } … … 77 77 mr_asprintf(&bigfile_fname, biggiestruct.filename); 78 78 79 log_msg(2, "biggiestruct.filename = %s", bigfile_fname);80 log_msg(2, "biggiestruct.checksum = %s", checksum);79 mr_msg(2, "biggiestruct.filename = %s", bigfile_fname); 80 mr_msg(2, "biggiestruct.checksum = %s", checksum); 81 81 82 82 if (!g_text_mode) { … … 88 88 /* BERLIOS: Useless ? 89 89 if (!checksum[0]) { 90 log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);90 mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr); 91 91 } */ 92 92 if (!strncmp(bigfile_fname, "/dev/", 5)) { 93 log_msg(2, _("Ignoring device %s"), bigfile_fname);93 mr_msg(2, _("Ignoring device %s"), bigfile_fname); 94 94 return(0); 95 95 } else { … … 98 98 MNT_RESTORING, bigfile_fname); 99 99 } 100 log_msg(2, command);100 mr_msg(2, command); 101 101 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 102 102 if (system(command)) { … … 108 108 mr_free(command); 109 109 if (!(fin = fopen("/tmp/md5sum.txt", "r"))) { 110 log_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum");110 mr_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum"); 111 111 mr_free(bigfile_fname); 112 112 return (1); … … 124 124 } 125 125 if (!strcmp(checksum, original_cksum) != 0) { 126 log_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname);127 } else { 128 log_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname);126 mr_msg(1, "bigfile #%ld ('%s') ... OK", bigfileno + 1, bigfile_fname); 127 } else { 128 mr_msg(1, "bigfile #%ld ('%s') ... changed", bigfileno + 1, bigfile_fname); 129 129 retval++; 130 130 } … … 162 162 163 163 assert(bkpinfo != NULL); 164 log_msg(1, "Comparing biggiefiles");164 mr_msg(1, "Comparing biggiefiles"); 165 165 166 166 if (length_of_file(BIGGIELIST) < 6) { 167 log_msg(1,167 mr_msg(1, 168 168 "OK, really teeny-tiny biggielist; not comparing biggiefiles"); 169 169 return (0); … … 171 171 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 172 172 if (noof_biggiefiles <= 0) { 173 log_msg(1, "OK, no biggiefiles; not comparing biggiefiles");173 mr_msg(1, "OK, no biggiefiles; not comparing biggiefiles"); 174 174 return (0); 175 175 } … … 183 183 for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) { 184 184 mr_asprintf(&tmp, "Comparing big file #%ld", bigfileno + 1); 185 log_msg(1, tmp);185 mr_msg(1, tmp); 186 186 update_progress_form(tmp); 187 187 mr_free(tmp); … … 322 322 "Differences found while processing fileset #%d ", 323 323 current_tarball_number); 324 log_msg(1, tmp);324 mr_msg(1, tmp); 325 325 mr_free(tmp); 326 326 } … … 402 402 "/archives/slice* > /dev/null 2> /dev/null") 403 403 == 0) { 404 log_msg(2, "OK, I think I'm done with tarballs...");404 mr_msg(2, "OK, I think I'm done with tarballs..."); 405 405 mr_free(tarball_fname); 406 406 break; 407 407 } 408 log_msg(2, "OK, I think it's time for another CD...");408 mr_msg(2, "OK, I think it's time for another CD..."); 409 409 g_current_media_number++; 410 410 mr_free(progress_str); … … 590 590 mr_free(tmp); 591 591 592 log_msg(2, "calling popup_changelist_from_file()");592 mr_msg(2, "calling popup_changelist_from_file()"); 593 593 popup_changelist_from_file("/tmp/changed.files"); 594 log_msg(2, "Returning from popup_changelist_from_file()");594 mr_msg(2, "Returning from popup_changelist_from_file()"); 595 595 } 596 596 } else { … … 650 650 if (length_of_file("/tmp/changed.txt") > 2 651 651 && length_of_file("/tmp/changed.files") > 2) { 652 log_msg(0,652 mr_msg(0, 653 653 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 654 log_msg(2, "Calling popup_changelist_from_file()");654 mr_msg(2, "Calling popup_changelist_from_file()"); 655 655 popup_changelist_from_file("/tmp/changed.files"); 656 log_msg(2, "Returned from popup_changelist_from_file()");656 mr_msg(2, "Returned from popup_changelist_from_file()"); 657 657 } 658 658 -
trunk/mondo/src/mondorestore/mondo-rstr-newt.c
r1084 r1086 1658 1658 sizeof(struct raid_device_record)); 1659 1659 mr_asprintf(&title_of_editraidForm_window, _("Edit %s"), raidrec->raid_device); 1660 log_msg(2, "Opening newt window");1660 mr_msg(2, "Opening newt window"); 1661 1661 newtOpenWindow(20, 5, 40, 14, title_of_editraidForm_window); 1662 1662 mr_free(title_of_editraidForm_window); 1663 1663 1664 1664 for (;;) { 1665 log_msg(2, "Main loop");1665 mr_msg(2, "Main loop"); 1666 1666 mr_asprintf(&sz_raid_level, 1667 1667 turn_raid_level_number_to_string(raidrec->raid_level)); -
trunk/mondo/src/mondorestore/mondo-rstr-tools.c
r1084 r1086 194 194 || (!does_file_exist(output_mountlist_file) 195 195 && does_file_exist(orig_fname))) { 196 log_msg(2, "Failed to extract %s and/or %s from ramdisk",196 mr_msg(2, "Failed to extract %s and/or %s from ramdisk", 197 197 output_cfg_file, output_mountlist_file); 198 198 retval = 1; … … 257 257 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 258 258 f, file); 259 log_msg(2, tmp);259 mr_msg(2, tmp); 260 260 mr_free(tmp); 261 261 … … 308 308 run_program_and_log_output(command, 5); 309 309 mr_free(command); 310 log_msg(2, "Setting isodir to %s", bkpinfo->isodir);310 mr_msg(2, "Setting isodir to %s", bkpinfo->isodir); 311 311 } 312 312 … … 331 331 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 332 332 mount_isodir_command); 333 log_msg(1, tmp);333 mr_msg(1, tmp); 334 334 mr_free(tmp); 335 335 … … 352 352 mr_asprintf(&tmp, "%s #%d has been mounted via loopback mount", 353 353 bkpinfo->backup_media_string, i); 354 log_msg(1, tmp);354 mr_msg(1, tmp); 355 355 mr_free(tmp); 356 356 … … 360 360 retval = 1; 361 361 } 362 log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,362 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 363 363 bkpinfo->isodir); 364 364 return (retval); … … 409 409 if (!strcmp(mpt, "/1")) { 410 410 mr_asprintf(&mountpoint, "/"); 411 log_msg(3, "Mommm! SME is being a dildo!");411 mr_msg(3, "Mommm! SME is being a dildo!"); 412 412 } else { 413 413 mr_asprintf(&mountpoint, mpt); … … 423 423 } 424 424 mr_asprintf(&tmp, "Mounting device %s ", device); 425 log_msg(1, tmp);425 mr_msg(1, tmp); 426 426 427 427 if (writeable) { … … 465 465 mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device, 466 466 additional_parameters, mountdir, MONDO_LOGFILE); 467 log_msg(2, "command='%s'", command);467 mr_msg(2, "command='%s'", command); 468 468 } 469 469 mr_free(additional_parameters); … … 471 471 res = run_program_and_log_output(command, TRUE); 472 472 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 473 log_msg(1, "Re-trying without the fancy extra parameters");473 mr_msg(1, "Re-trying without the fancy extra parameters"); 474 474 mr_free(command); 475 475 … … 479 479 } 480 480 if (res) { 481 log_msg(1, "Unable to mount device %s (type %s) at %s", device,481 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, 482 482 format, mountdir); 483 log_msg(1, "command was '%s'", command);483 mr_msg(1, "command was '%s'", command); 484 484 if (!strcmp(mountpoint, "swap")) { 485 485 log_to_screen(tmp); 486 486 } else { 487 log_msg(2, "Retrying w/o the '-t' switch");487 mr_msg(2, "Retrying w/o the '-t' switch"); 488 488 mr_free(command); 489 489 490 490 mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir, 491 491 MONDO_LOGFILE); 492 log_msg(2, "2nd command = '%s'", command);492 mr_msg(2, "2nd command = '%s'", command); 493 493 res = run_program_and_log_output(command, TRUE); 494 494 if (res == 0) { 495 log_msg(1,495 mr_msg(1, 496 496 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 497 497 } else { … … 505 505 506 506 if (res && !strcmp(mountpoint, "swap")) { 507 log_msg(2, "That's ok. It's just a swap partition.");508 log_msg(2, "Non-fatal error. Returning 0.");507 mr_msg(2, "That's ok. It's just a swap partition."); 508 mr_msg(2, "Non-fatal error. Returning 0."); 509 509 res = 0; 510 510 } … … 550 550 for (lino = 0; lino < mountlist->entries; lino++) { 551 551 if (!strcmp(mountlist->el[lino].device, "/proc")) { 552 log_msg(1,552 mr_msg(1, 553 553 "Again with the /proc - why is this in your mountlist?"); 554 554 } else if (is_this_device_mounted(mountlist->el[lino].device)) { … … 649 649 if (bkpinfo->backup_media_type == tape 650 650 || bkpinfo->backup_media_type == udev) { 651 log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");651 mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM."); 652 652 return 0; 653 653 } 654 654 655 655 if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) { 656 log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");656 mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough."); 657 657 return (0); 658 658 } 659 659 660 660 if (bkpinfo->backup_media_type == nfs) { 661 log_msg(2, "Mounting for NFS thingy");662 log_msg(2, "isodir = %s", bkpinfo->isodir);661 mr_msg(2, "Mounting for NFS thingy"); 662 mr_msg(2, "isodir = %s", bkpinfo->isodir); 663 663 if ((!bkpinfo->isodir || !strcmp(bkpinfo->isodir, "/")) 664 664 && am_I_in_disaster_recovery_mode()) { 665 665 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 666 log_msg(1, "isodir is being set to %s", bkpinfo->isodir);666 mr_msg(1, "isodir is being set to %s", bkpinfo->isodir); 667 667 } 668 668 #ifdef __FreeBSD__ … … 728 728 729 729 } 730 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);730 mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd); 731 731 for (i = 0; i < 2; i++) { 732 732 res = run_program_and_log_output(mount_cmd, FALSE); … … 734 734 break; 735 735 } else { 736 log_msg(2, "Failed to mount CD-ROM drive.");736 mr_msg(2, "Failed to mount CD-ROM drive."); 737 737 sleep(5); 738 738 run_program_and_log_output("sync", FALSE); … … 742 742 743 743 if (res) { 744 log_msg(2, "Failed, despite %d attempts", i);745 } else { 746 log_msg(2, "Mounted CD-ROM drive OK");744 mr_msg(2, "Failed, despite %d attempts", i); 745 } else { 746 mr_msg(2, "Mounted CD-ROM drive OK"); 747 747 } 748 748 return (res); … … 830 830 /* Check to see if CD is already mounted before mounting it... */ 831 831 if (!is_this_device_mounted("/dev/cdrom")) { 832 log_msg(2,832 mr_msg(2, 833 833 "NB: CDROM device not mounted, mounting..."); 834 834 run_program_and_log_output("mount /dev/cdrom " … … 897 897 mr_asprintf(&tmp, "Backup medium is TAPE --- dev=%s", 898 898 bkpinfo->media_device); 899 log_msg(2, tmp);899 mr_msg(2, tmp); 900 900 mr_free(tmp); 901 901 } else { … … 903 903 bkpinfo->media_size[0] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 904 904 bkpinfo->media_size[1] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 905 log_msg(2, "Backup medium is CD-R[W]");906 } 907 } else { 908 log_msg(2,905 mr_msg(2, "Backup medium is CD-R[W]"); 906 } 907 } else { 908 mr_msg(2, 909 909 "Not in Disaster Recovery Mode. No need to derive device name from config file."); 910 910 } … … 913 913 if (strstr(value, "yes")) { 914 914 bkpinfo->use_star = TRUE; 915 log_msg(1, "Goody! ... bkpinfo->use_star is now true.");915 mr_msg(1, "Goody! ... bkpinfo->use_star is now true."); 916 916 } 917 917 mr_free(value); … … 920 920 if (strstr(value, "TRUE")) { 921 921 mr_asprintf(&g_getfacl,"setfacl"); 922 log_msg(1, "We will restore ACLs");922 mr_msg(1, "We will restore ACLs"); 923 923 if (! find_home_of_exe("setfacl")) { 924 log_msg(1, "Unable to restore ACLs as no setfacl found");924 mr_msg(1, "Unable to restore ACLs as no setfacl found"); 925 925 } 926 926 } … … 928 928 if (strstr(value, "TRUE")) { 929 929 mr_asprintf(&g_getfattr,"setfattr"); 930 log_msg(1, "We will restore XATTRs");930 mr_msg(1, "We will restore XATTRs"); 931 931 if (! find_home_of_exe("setfattr")) { 932 log_msg(1, "Unable to restore XATTRs as no setfattr found");932 mr_msg(1, "Unable to restore XATTRs as no setfattr found"); 933 933 } 934 934 } … … 936 936 if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) { 937 937 bkpinfo->internal_tape_block_size = atol(value); 938 log_msg(1, "Internal tape block size has been custom-set to %ld",938 mr_msg(1, "Internal tape block size has been custom-set to %ld", 939 939 bkpinfo->internal_tape_block_size); 940 940 } else { 941 941 bkpinfo->internal_tape_block_size = 942 942 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 943 log_msg(1, "Internal tape block size = default (%ld)",943 mr_msg(1, "Internal tape block size = default (%ld)", 944 944 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 945 945 } … … 980 980 bkpinfo->differential = TRUE; 981 981 } 982 log_msg(2, "differential var = '%s'", value);982 mr_msg(2, "differential var = '%s'", value); 983 983 mr_free(value); 984 984 985 985 if (bkpinfo->differential) { 986 log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");987 } else { 988 log_msg(2, "This is a regular (full) backup");986 mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP"); 987 } else { 988 mr_msg(2, "This is a regular (full) backup"); 989 989 } 990 990 … … 997 997 if ((tmp != NULL) || strstr(tmp1,"donteject")) { 998 998 bkpinfo->please_dont_eject = TRUE; 999 log_msg(2, "Ok, I shan't eject when restoring! Groovy.");999 mr_msg(2, "Ok, I shan't eject when restoring! Groovy."); 1000 1000 } 1001 1001 mr_free(tmp); … … 1004 1004 if (bkpinfo->backup_media_type == nfs) { 1005 1005 if (!cfgf) { 1006 log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);1007 log_msg(2, "nfs_remote_dir remains %s",1006 mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount); 1007 mr_msg(2, "nfs_remote_dir remains %s", 1008 1008 bkpinfo->nfs_remote_dir); 1009 log_msg(2,1009 mr_msg(2, 1010 1010 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 1011 1011 } else { … … 1016 1016 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 1017 1017 bkpinfo->nfs_remote_dir); 1018 log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);1019 log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);1018 mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount); 1019 mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir); 1020 1020 } 1021 1021 if (strstr(call_program_and_get_last_line_of_output … … 1060 1060 mr_free(g_isodir_device); 1061 1061 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 1062 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device);1062 mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device); 1063 1063 if (bkpinfo->disaster_recovery) { 1064 1064 if (is_this_device_mounted(g_isodir_device)) { 1065 log_msg(2, "NB: isodir is already mounted");1065 mr_msg(2, "NB: isodir is already mounted"); 1066 1066 /* Find out where it's mounted */ 1067 1067 mr_asprintf(&command, … … 1081 1081 mr_asprintf(&tmp, "mount %s %s", g_isodir_device, iso_mnt); 1082 1082 if (run_program_and_log_output(tmp, 3)) { 1083 log_msg(1,1083 mr_msg(1, 1084 1084 "Unable to mount isodir. Perhaps this is really a CD backup?"); 1085 1085 bkpinfo->backup_media_type = cdr; … … 1095 1095 ("Unable to mount isodir. Failed to mount CD-ROM as well."); 1096 1096 } else { 1097 log_msg(1,1097 mr_msg(1, 1098 1098 "You backed up to disk, then burned some CDs."); 1099 1099 } … … 1114 1114 if (g_restoring_live_from_cd) { 1115 1115 if (bkpinfo->backup_media_type != media_specified_by_user) { 1116 log_msg(2,1116 mr_msg(2, 1117 1117 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1118 1118 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); … … 1163 1163 if (does_file_exist(g_filelist_full) 1164 1164 && does_file_exist(g_biggielist_txt)) { 1165 log_msg(1, "%s exists", g_filelist_full);1166 log_msg(1, "%s exists", g_biggielist_txt);1167 log_msg(2,1165 mr_msg(1, "%s exists", g_filelist_full); 1166 mr_msg(1, "%s exists", g_biggielist_txt); 1167 mr_msg(2, 1168 1168 "Filelist and biggielist already recovered from media. Yay!"); 1169 1169 } else { 1170 1170 getcwd(tmp, MAX_STR_LEN); 1171 1171 chdir(bkpinfo->tmpdir); 1172 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);1172 mr_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1173 1173 log_to_screen("Extracting filelist and biggielist from media..."); 1174 1174 unlink("/tmp/filelist.full"); … … 1183 1183 FILELIST_FULL_STUB, 1184 1184 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1185 log_msg(1, "tarcommand = %s", command);1185 mr_msg(1, "tarcommand = %s", command); 1186 1186 run_program_and_log_output(command, 1); 1187 1187 mr_free(command); 1188 1188 } else { 1189 log_msg(2,1189 mr_msg(2, 1190 1190 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1191 1191 bkpinfo->isodir); 1192 1192 insist_on_this_cd_number(bkpinfo, 1); 1193 log_msg(2, "Back from iotcn");1193 mr_msg(2, "Back from iotcn"); 1194 1194 run_program_and_log_output("mount", 1); 1195 1195 mr_asprintf(&command, … … 1201 1201 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1202 1202 1203 log_msg(1, "tarcommand = %s", command);1203 mr_msg(1, "tarcommand = %s", command); 1204 1204 run_program_and_log_output(command, 1); 1205 1205 mr_free(command); … … 1221 1221 mr_asprintf(&command, "cp -f %s/%s %s", bkpinfo->tmpdir, 1222 1222 BIGGIELIST_TXT_STUB, g_biggielist_txt); 1223 log_msg(1, "command = %s", command);1223 mr_msg(1, "command = %s", command); 1224 1224 paranoid_system(command); 1225 1225 mr_free(command); … … 1227 1227 mr_asprintf(&command, "ln -sf %s/%s %s", bkpinfo->tmpdir, 1228 1228 FILELIST_FULL_STUB, g_filelist_full); 1229 log_msg(1, "command = %s", command);1229 mr_msg(1, "command = %s", command); 1230 1230 paranoid_system(command); 1231 1231 mr_free(command); … … 1247 1247 1248 1248 if (!does_file_exist(g_biggielist_txt)) { 1249 log_msg(1, "Warning - %s not found", g_biggielist_txt);1249 mr_msg(1, "Warning - %s not found", g_biggielist_txt); 1250 1250 } 1251 1251 if (!does_file_exist(g_filelist_full)) { 1252 log_msg(1, "Warning - %s does not exist", g_filelist_full);1252 mr_msg(1, "Warning - %s does not exist", g_filelist_full); 1253 1253 } 1254 1254 // popup_and_OK("Wonderful."); 1255 1255 1256 log_msg(2, "Forking");1256 mr_msg(2, "Forking"); 1257 1257 pid = fork(); 1258 1258 switch (pid) { … … 1284 1284 close_evalcall_form(); 1285 1285 1286 log_msg(3, "loading filelist");1286 mr_msg(3, "loading filelist"); 1287 1287 filelist = load_filelist(g_filelist_full); 1288 log_msg(3, "deleting original filelist");1288 mr_msg(3, "deleting original filelist"); 1289 1289 unlink(g_filelist_full); 1290 1290 if (g_text_mode) { … … 1302 1302 } 1303 1303 if (res) { 1304 log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");1304 mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting."); 1305 1305 free_filelist(filelist); 1306 1306 return (NULL); … … 1370 1370 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1371 1371 mr_asprintf(&tmp, "run_boot_loader: device='%s', name='%s'", device, name); 1372 log_msg(2, tmp);1372 mr_msg(2, tmp); 1373 1373 mr_free(tmp); 1374 1374 … … 1386 1386 // else 1387 1387 // { 1388 // log_msg(1, "Not running run_grub(). Was a bad idea anyway.");1388 // mr_msg(1, "Not running run_grub(). Was a bad idea anyway."); 1389 1389 // res = 1; 1390 1390 // } … … 1404 1404 res = run_program_and_log_output(tmp, 3); 1405 1405 } else { 1406 log_msg(1,1406 mr_msg(1, 1407 1407 "I'm not running any boot loader. You have a DD boot drive. It's already loaded up."); 1408 1408 } … … 1464 1464 tmp = find_home_of_exe(output); 1465 1465 if (!tmp) { 1466 log_msg(2, " (find_my_editor) --- warning - %s not found", output);1466 mr_msg(2, " (find_my_editor) --- warning - %s not found", output); 1467 1467 } 1468 1468 mr_free(tmp); … … 1536 1536 /* nuke mode */ 1537 1537 if (!run_program_and_log_output("which grub-MR", FALSE)) { 1538 log_msg(1, "Yay! grub-MR found...");1538 mr_msg(1, "Yay! grub-MR found..."); 1539 1539 mr_asprintf(&command, "grub-MR %s /tmp/mountlist.txt", bd); 1540 log_msg(1, "command = %s", command);1540 mr_msg(1, "command = %s", command); 1541 1541 } else { 1542 1542 mr_asprintf(&command, "chroot " MNT_RESTORING " grub-install %s", bd); 1543 log_msg(1, "WARNING - grub-MR not found; using grub-install");1543 mr_msg(1, "WARNING - grub-MR not found; using grub-install"); 1544 1544 } 1545 1545 mvaddstr_and_log_it(g_currentY, … … 1566 1566 (_ 1567 1567 ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.")); 1568 log_msg(1, "Type:-");1569 log_msg(1, " mount-me");1570 log_msg(1, " chroot " MNT_RESTORING);1571 log_msg(1, " mount /boot");1572 log_msg(1, " grub-install '(hd0)'");1573 log_msg(1, " exit");1574 log_msg(1, " unmount-me");1575 log_msg(1,1568 mr_msg(1, "Type:-"); 1569 mr_msg(1, " mount-me"); 1570 mr_msg(1, " chroot " MNT_RESTORING); 1571 mr_msg(1, " mount /boot"); 1572 mr_msg(1, " grub-install '(hd0)'"); 1573 mr_msg(1, " exit"); 1574 mr_msg(1, " unmount-me"); 1575 mr_msg(1, 1576 1576 "If you're really stuck, please e-mail the mailing list."); 1577 1577 } else { … … 1829 1829 ("Restoring MBR... ")); 1830 1830 mr_asprintf(&command, "raw-MR %s /tmp/mountlist.txt", bd); 1831 log_msg(2, "run_raw_mbr() --- command='%s'", command);1831 mr_msg(2, "run_raw_mbr() --- command='%s'", command); 1832 1832 res = run_program_and_log_output(command, 3); 1833 1833 mr_free(command); … … 1999 1999 void termination_in_progress(int sig) 2000 2000 { 2001 log_msg(1, "Termination in progress");2001 mr_msg(1, "Termination in progress"); 2002 2002 usleep(1000); 2003 2003 pthread_exit(0); … … 2047 2047 i++) { 2048 2048 sleep(1); 2049 log_msg(2, "Waiting for buffer() to finish");2049 mr_msg(2, "Waiting for buffer() to finish"); 2050 2050 } 2051 2051 … … 2054 2054 if (run_program_and_log_output 2055 2055 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) { 2056 log_msg(1,2056 mr_msg(1, 2057 2057 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 2058 2058 } 2059 2059 if (run_program_and_log_output 2060 2060 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 2061 log_msg(1,2061 mr_msg(1, 2062 2062 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 2063 2063 } … … 2081 2081 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 2082 2082 mr_asprintf(&command, "umount %s/", MNT_RESTORING); 2083 log_msg(3,2083 mr_msg(3, 2084 2084 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2085 2085 } else { … … 2088 2088 } 2089 2089 } 2090 log_msg(10, "The 'umount' command is '%s'", command);2090 mr_msg(10, "The 'umount' command is '%s'", command); 2091 2091 res = run_program_and_log_output(command, 3); 2092 2092 mr_free(command); … … 2105 2105 log_to_screen(tmp); 2106 2106 } else { 2107 log_msg(2, tmp);2107 mr_msg(2, tmp); 2108 2108 } 2109 2109 mr_free(tmp); … … 2149 2149 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2150 2150 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); 2151 log_msg(2, "command = '%s'", command);2151 mr_msg(2, "command = '%s'", command); 2152 2152 res = run_program_and_log_output(command, -1); 2153 2153 mr_free(command); … … 2185 2185 2186 2186 assert(bkpinfo != NULL); 2187 log_msg(2, "gcffa --- starting");2187 mr_msg(2, "gcffa --- starting"); 2188 2188 log_to_screen(_("I'm thinking...")); 2189 2189 mr_asprintf(&mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); … … 2202 2202 mr_asprintf(&mountlist_file, "%s/%s", bkpinfo->tmpdir, 2203 2203 MOUNTLIST_FNAME_STUB); 2204 log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);2204 mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2205 2205 2206 2206 /* Floppy? */ … … 2217 2217 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2218 2218 command); 2219 log_msg(1, "tmp = '%s'", tmp);2219 mr_msg(1, "tmp = '%s'", tmp); 2220 2220 system(tmp); 2221 2221 mr_free(tmp); … … 2233 2233 } else { 2234 2234 try_plan_B = TRUE; 2235 log_msg(2,2235 mr_msg(2, 2236 2236 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does."); 2237 2237 // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK. 2238 log_msg(2, "Processing floppy (plan A?)");2238 mr_msg(2, "Processing floppy (plan A?)"); 2239 2239 mr_asprintf(&ramdisk_fname, "%s/mindi.rdz", mountpt); 2240 2240 if (!does_file_exist(ramdisk_fname)) { … … 2243 2243 } 2244 2244 if (!does_file_exist(ramdisk_fname)) { 2245 log_msg(2,2245 mr_msg(2, 2246 2246 "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?"); 2247 2247 } 2248 2248 if (extract_config_file_from_ramdisk 2249 2249 (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) { 2250 log_msg(2,2250 mr_msg(2, 2251 2251 "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled."); 2252 2252 } … … 2259 2259 } 2260 2260 if (!does_file_exist(cfg_file)) { 2261 log_msg(2, "gcffa --- we don't have cfg file yet.");2261 mr_msg(2, "gcffa --- we don't have cfg file yet."); 2262 2262 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2263 2263 try_plan_B = TRUE; 2264 2264 } else { 2265 log_msg(2, "gcffa --- calling mount_cdrom now :)");2265 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2266 2266 if (!mount_cdrom(bkpinfo)) { 2267 log_msg(2,2267 mr_msg(2, 2268 2268 "gcffa --- managed to mount CD; so, no need for Plan B"); 2269 2269 try_plan_B = FALSE; … … 2277 2277 } 2278 2278 if (try_plan_B) { 2279 log_msg(2, "gcffa --- OK, switching to Plan B");2279 mr_msg(2, "gcffa --- OK, switching to Plan B"); 2280 2280 chdir(bkpinfo->tmpdir); 2281 2281 run_program_and_log_output("mkdir -p tmp", FALSE); … … 2283 2283 if (bkpinfo->media_device == NULL) { 2284 2284 mr_asprintf(&bkpinfo->media_device, "/dev/st0"); 2285 log_msg(2, "media_device is blank; assuming %s",2285 mr_msg(2, "media_device is blank; assuming %s", 2286 2286 bkpinfo->media_device); 2287 2287 } … … 2298 2298 if (extract_cfg_file_and_mountlist_from_tape_dev 2299 2299 (bkpinfo->media_device)) { 2300 log_msg(3,2300 mr_msg(3, 2301 2301 "I tried lots of devices but none worked."); 2302 2302 mr_allocstr(bkpinfo->media_device, sav); … … 2313 2313 } 2314 2314 } else { 2315 log_msg(2,2315 mr_msg(2, 2316 2316 "gcffa --- looking at mounted CD for mindi-boot.2880.img"); 2317 2317 /* BERLIOS : Useless ? … … 2322 2322 mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2323 2323 if (!does_file_exist(mounted_cfgf_path)) { 2324 log_msg(2,2324 mr_msg(2, 2325 2325 "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz"); 2326 2326 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary … … 2339 2339 2340 2340 if (does_file_exist(MONDO_CFG_FILE_STUB)) { 2341 log_msg(1, "gcffa --- great! We've got the config file");2341 mr_msg(1, "gcffa --- great! We've got the config file"); 2342 2342 tmp1 = call_program_and_get_last_line_of_output("pwd"); 2343 2343 mr_asprintf(&tmp, "%s/%s", tmp1,MONDO_CFG_FILE_STUB); … … 2347 2347 if (strcmp(tmp, cfg_file) 2348 2348 && run_program_and_log_output(command, 1)) { 2349 log_msg(1,2349 mr_msg(1, 2350 2350 "... but an error occurred when I tried to move it to %s", 2351 2351 cfg_file); 2352 2352 } else { 2353 log_msg(1, "... and I moved it successfully to %s", cfg_file);2353 mr_msg(1, "... and I moved it successfully to %s", cfg_file); 2354 2354 } 2355 2355 mr_free(command); … … 2362 2362 if (strcmp(tmp, cfg_file) 2363 2363 && run_program_and_log_output(command, 1)) { 2364 log_msg(1, "Failed to get mountlist");2364 mr_msg(1, "Failed to get mountlist"); 2365 2365 } else { 2366 log_msg(1, "Got mountlist too");2366 mr_msg(1, "Got mountlist too"); 2367 2367 mr_free(command); 2368 2368 mr_asprintf(&command, "cp -f %s %s", mountlist_file, 2369 2369 g_mountlist_fname); 2370 2370 if (run_program_and_log_output(command, 1)) { 2371 log_msg(1, "Failed to copy mountlist to /tmp");2371 mr_msg(1, "Failed to copy mountlist to /tmp"); 2372 2372 } else { 2373 log_msg(1, "Copied mountlist to /tmp as well OK");2373 mr_msg(1, "Copied mountlist to /tmp as well OK"); 2374 2374 mr_free(command); 2375 2375 mr_asprintf(&command, "cp -f tmp/i-want-my-lvm /tmp/"); … … 2383 2383 if (!does_file_exist(cfg_file)) { 2384 2384 iamhere(cfg_file); 2385 log_msg(1, "%s not found", cfg_file);2385 mr_msg(1, "%s not found", cfg_file); 2386 2386 log_to_screen 2387 2387 (_ … … 2448 2448 if (parse_mdstat(raidlist, "/dev/")) { 2449 2449 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2450 log_msg(1, "Sorry, cannot read %s", MDSTAT_FILE);2450 mr_msg(1, "Sorry, cannot read %s", MDSTAT_FILE); 2451 2451 return; 2452 2452 } … … 2455 2455 if (raidlist->el[i].progress < wait_for_percentage) { 2456 2456 unfinished_mdstat_devices++; 2457 log_msg(1, "Sync'ing %s (i=%d)",2457 mr_msg(1, "Sync'ing %s (i=%d)", 2458 2458 raidlist->el[i].raid_device, i); 2459 2459 mr_asprintf(&screen_message, "Sync'ing %s", … … 2466 2466 } 2467 2467 while (raidlist->el[i].progress < wait_for_percentage) { 2468 log_msg(1, "Percentage sync'ed: %d",2468 mr_msg(1, "Percentage sync'ed: %d", 2469 2469 raidlist->el[i].progress); 2470 2470 update_evalcall_form(raidlist->el[i].progress);
Note:
See TracChangeset
for help on using the changeset viewer.