Changeset 1108 in MondoRescue
- Timestamp:
- Feb 8, 2007, 12:10:16 AM (18 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondoarchive/main.c
r1102 r1108 61 61 void welcome_to_mondoarchive() 62 62 { 63 log_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org",63 mr_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org", 64 64 PACKAGE_VERSION); 65 log_msg(0, "running on %s architecture", get_architecture());66 log_msg(0,65 mr_msg(0, "running on %s architecture", get_architecture()); 66 mr_msg(0, 67 67 "-----------------------------------------------------------"); 68 log_msg(0,68 mr_msg(0, 69 69 "NB: Mondo logs almost everything, so don't panic if you see"); 70 log_msg(0,70 mr_msg(0, 71 71 "some error messages. Please read them carefully before you"); 72 log_msg(0,72 mr_msg(0, 73 73 "decide to break out in a cold sweat. Despite (or perhaps"); 74 log_msg(0,74 mr_msg(0, 75 75 "because of) the wealth of messages. some users are inclined"); 76 log_msg(0,76 mr_msg(0, 77 77 "to stop reading this log. If Mondo stopped for some reason,"); 78 log_msg(0,78 mr_msg(0, 79 79 "chances are it's detailed here. More than likely there's a"); 80 log_msg(0,80 mr_msg(0, 81 81 "message at the very end of this log that will tell you what"); 82 log_msg(0,82 mr_msg(0, 83 83 "is wrong. Please read it! -Devteam"); 84 log_msg(0,84 mr_msg(0, 85 85 "-----------------------------------------------------------"); 86 86 87 log_msg(0, "Zero...");88 log_msg(1, "One...");89 log_msg(2, "Two...");90 log_msg(3, "Three...");91 log_msg(4, "Four...");92 log_msg(5, "Five...");93 log_msg(6, "Six...");94 log_msg(7, "Seven...");95 log_msg(8, "Eight...");87 mr_msg(0, "Zero..."); 88 mr_msg(1, "One..."); 89 mr_msg(2, "Two..."); 90 mr_msg(3, "Three..."); 91 mr_msg(4, "Four..."); 92 mr_msg(5, "Five..."); 93 mr_msg(6, "Six..."); 94 mr_msg(7, "Seven..."); 95 mr_msg(8, "Eight..."); 96 96 printf("See %s for details of backup run.\n", MONDO_LOGFILE); 97 97 } … … 106 106 void distro_specific_kludges_at_start_of_mondoarchive() 107 107 { 108 log_msg(2, "Unmounting old ramdisks if necessary");108 mr_msg(2, "Unmounting old ramdisks if necessary"); 109 109 stop_magicdev_if_necessary(); // for RH+Gnome users 110 110 run_program_and_log_output … … 124 124 { 125 125 // char tmp[500]; 126 log_msg(2, "Restarting magicdev if necessary");126 mr_msg(2, "Restarting magicdev if necessary"); 127 127 sync(); 128 128 restart_magicdev_if_necessary(); // for RH+Gnome users 129 129 130 log_msg(2, "Restarting autofs if necessary");130 mr_msg(2, "Restarting autofs if necessary"); 131 131 sync(); 132 132 // restart_autofs_if_necessary(); // for Xandros users 133 133 134 log_msg(2, "Restarting supermounts if necessary");134 mr_msg(2, "Restarting supermounts if necessary"); 135 135 sync(); 136 136 remount_supermounts_if_necessary(); // for Mandrake users 137 137 138 log_msg(2, "Unmounting /boot if necessary");138 mr_msg(2, "Unmounting /boot if necessary"); 139 139 sync(); 140 140 unmount_boot_if_necessary(); // for Gentoo users 141 141 142 // log_msg( 2, "Cleaning up KDE desktop");142 // mr_msg( 2, "Cleaning up KDE desktop"); 143 143 // clean_up_KDE_desktop_if_necessary(); 144 144 } … … 189 189 /* initialize log file with time stamp */ 190 190 unlink(MONDO_LOGFILE); 191 log_msg(0, "Time started: %s", mr_date());191 mr_msg(0, "Time started: %s", mr_date()); 192 192 193 193 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ … … 215 215 /* Configure the bkpinfo structure, global file paths, etc. */ 216 216 g_main_pid = getpid(); 217 log_msg(9, "This");217 mr_msg(9, "This"); 218 218 219 219 register_pid(g_main_pid, "mondo"); … … 221 221 run_program_and_log_output("dmesg -n1", TRUE); 222 222 223 log_msg(9, "Next");223 mr_msg(9, "Next"); 224 224 welcome_to_mondoarchive(); 225 225 distro_specific_kludges_at_start_of_mondoarchive(); … … 340 340 ("Errors were detected in the command line you supplied.\n"); 341 341 printf("Please review the log file - " MONDO_LOGFILE "\n"); 342 log_msg(1, "Mondoarchive will now exit.");342 mr_msg(1, "Mondoarchive will now exit."); 343 343 finish(1); 344 344 } … … 410 410 ("Type 'less /tmp/changed.files' to see which files don't match the archives"); 411 411 } else { 412 log_msg(1,412 mr_msg(1, 413 413 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 414 log_msg(2, "Calling popup_changelist_from_file()");414 mr_msg(2, "Calling popup_changelist_from_file()"); 415 415 popup_changelist_from_file("/tmp/changed.files"); 416 log_msg(2, "Returned from popup_changelist_from_file()");416 mr_msg(2, "Returned from popup_changelist_from_file()"); 417 417 } 418 418 } else { … … 447 447 448 448 if (!g_cdrom_drive_is_here) { 449 log_msg(10, "FYI, g_cdrom_drive_is_here was never used");449 mr_msg(10, "FYI, g_cdrom_drive_is_here was never used"); 450 450 } 451 451 if (!g_dvd_drive_is_here) { 452 log_msg(10, "FYI, g_dvd_drive_is_here was never used");452 mr_msg(10, "FYI, g_dvd_drive_is_here was never used"); 453 453 } 454 454 455 455 /* finalize log file with time stamp */ 456 log_msg(0, "Time finished: %s", mr_date());456 mr_msg(0, "Time finished: %s", mr_date()); 457 457 458 458 if (!g_text_mode) { -
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r1080 r1108 109 109 { 110 110 */ 111 log_msg(3, "Switches:-");111 mr_msg(3, "Switches:-"); 112 112 for (i = 0; i < 128; i++) { 113 113 if (flag_set[i]) { 114 114 sprintf(tmp, "-%c %s", i, flag_val[i]); 115 log_msg(3, tmp);115 mr_msg(3, tmp); 116 116 } 117 117 } … … 162 162 sprintf(comment, "media_size[%d] = %ld", j, 163 163 bkpinfo->media_size[j]); 164 log_msg(3, comment);164 mr_msg(3, comment); 165 165 } 166 166 for (; j <= MAX_NOOF_MEDIA; j++) { … … 170 170 for (j = 1; j <= MAX_NOOF_MEDIA; j++) { 171 171 if (bkpinfo->media_size[j] <= 0) { 172 log_msg(1, "You gave media #%d an invalid size\n", j);172 mr_msg(1, "You gave media #%d an invalid size\n", j); 173 173 return (-1); 174 174 } … … 253 253 if (find_home_of_exe("star")) { 254 254 flag_set['R'] = TRUE; 255 log_msg(1, "Using star instead of afio");255 mr_msg(1, "Using star instead of afio"); 256 256 } else { 257 257 fatal_error … … 284 284 if (flag_set['I']) { 285 285 if (!strcmp(bkpinfo->include_paths, "/")) { 286 log_msg(2, "'/' is pleonastic.");286 mr_msg(2, "'/' is pleonastic."); 287 287 bkpinfo->include_paths[0] = '\0'; 288 288 } … … 300 300 *q = '\0'; 301 301 if (stat(p, &buf) != 0) { 302 log_msg(1, "ERROR ! %s doesn't exist", p);302 mr_msg(1, "ERROR ! %s doesn't exist", p); 303 303 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 304 304 } … … 306 306 } else { 307 307 if (stat(p, &buf) != 0) { 308 log_msg(1, "ERROR ! %s doesn't exist", p);308 mr_msg(1, "ERROR ! %s doesn't exist", p); 309 309 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 310 310 } … … 317 317 flag_val['I'], 318 318 4*MAX_STR_LEN - strlen(bkpinfo->include_paths)); 319 log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);319 mr_msg(1, "include_paths is now '%s'", bkpinfo->include_paths); 320 320 if (bkpinfo->include_paths[0] == '-') { 321 321 retval++; … … 374 374 } 375 375 } else { 376 log_msg(3, "flag_val['c'] = %s", flag_val['c']);377 log_msg(3, "flag_val['w'] = %s", flag_val['w']);378 // log_msg(3, "flag_set['r'] = %i", flag_set['r'] );376 mr_msg(3, "flag_val['c'] = %s", flag_val['c']); 377 mr_msg(3, "flag_val['w'] = %s", flag_val['w']); 378 // mr_msg(3, "flag_set['r'] = %i", flag_set['r'] ); 379 379 if (flag_set['c']) { 380 380 bkpinfo->cdrw_speed = atoi(flag_val['c']); … … 502 502 log_to_screen("NFS share is not mounted. Please mount it.\n"); 503 503 } 504 log_msg(3, "mount = %s", bkpinfo->nfs_mount);505 log_msg(3, "isodir= %s", bkpinfo->isodir);504 mr_msg(3, "mount = %s", bkpinfo->nfs_mount); 505 mr_msg(3, "isodir= %s", bkpinfo->isodir); 506 506 } 507 507 if (flag_set['c']) { … … 568 568 /* End of bug fix */ 569 569 if (stat(p, &buf) != 0) { 570 log_msg(1, "WARNING ! %s doesn't exist", p);570 mr_msg(1, "WARNING ! %s doesn't exist", p); 571 571 } 572 572 p = q+1 ; 573 573 } else { 574 574 if (stat(p, &buf) != 0) { 575 log_msg(1, "WARNING ! %s doesn't exist", p);575 mr_msg(1, "WARNING ! %s doesn't exist", p); 576 576 } 577 577 p = NULL; … … 595 595 } 596 596 strncat(bkpinfo->exclude_paths, psz, MAX_STR_LEN); 597 log_msg(3, "-N means we're now excluding %s",597 mr_msg(3, "-N means we're now excluding %s", 598 598 bkpinfo->exclude_paths); 599 599 } … … 604 604 if (flag_set['b']) { 605 605 strcpy(psz, flag_val['b']); 606 log_msg(1, "psz = '%s'", psz);606 mr_msg(1, "psz = '%s'", psz); 607 607 if (psz[strlen(psz) - 1] == 'k') { 608 608 psz[strlen(psz) - 1] = '\0'; … … 611 611 itbs = atol(psz); 612 612 } 613 log_msg(1, "'%s' --> %ld", flag_val['b'], itbs);614 log_msg(1, "Internal tape block size is now %ld bytes", itbs);613 mr_msg(1, "'%s' --> %ld", flag_val['b'], itbs); 614 mr_msg(1, "Internal tape block size is now %ld bytes", itbs); 615 615 if (itbs % 512 != 0 || itbs < 256 || itbs > 1024L * 1024) { 616 616 fatal_error … … 761 761 (BOOT_LOADER_CHARS, 762 762 (bkpinfo->boot_loader = flag_val['l'][0]))) { 763 log_msg(1, "%c? WTF is %c? I need G, L, E or R.",763 mr_msg(1, "%c? WTF is %c? I need G, L, E or R.", 764 764 bkpinfo->boot_loader, bkpinfo->boot_loader); 765 765 fatal_error … … 779 779 if (flag_set['Q']) { 780 780 i = which_boot_loader(tmp); 781 log_msg(3, "boot loader is %c, residing at %s", i, tmp);781 mr_msg(3, "boot loader is %c, residing at %s", i, tmp); 782 782 printf("boot loader is %c, residing at %s\n", i, tmp); 783 783 finish(0); … … 948 948 void help_screen() 949 949 { 950 log_msg(1, "Type 'man mondo-archive' for more information\n");950 mr_msg(1, "Type 'man mondo-archive' for more information\n"); 951 951 exit(1); 952 952 } … … 1044 1044 void termination_in_progress(int sig) 1045 1045 { 1046 log_msg(1, "Termination in progress");1046 mr_msg(1, "Termination in progress"); 1047 1047 usleep(1000); 1048 1048 pthread_exit(0); -
branches/stable/mondo/src/mondorestore/mondo-prep.c
r1103 r1108 86 86 drivelist->el[lino].device, MONDO_WAS_HERE); 87 87 if (!run_program_and_log_output(command, 1)) { 88 log_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)",88 mr_msg(1, "Found MONDO_WAS_HERE marker on drive#%d (%s)", 89 89 lino, drivelist->el[lino].device); 90 90 break; … … 108 108 fout = fopen(drivelist->el[lino].device, "w+"); 109 109 if (!fout) { 110 log_msg(1, "Unable to open+wipe %s",110 mr_msg(1, "Unable to open+wipe %s", 111 111 drivelist->el[lino].device); 112 112 } else { 113 113 if (1 != fwrite(buf, blocksize, 1, fout)) { 114 log_msg(1, "Failed to wipe %s",114 mr_msg(1, "Failed to wipe %s", 115 115 drivelist->el[lino].device); 116 116 } else { 117 log_msg(1, "Successfully wiped %s",117 mr_msg(1, "Successfully wiped %s", 118 118 drivelist->el[lino].device); 119 119 } … … 132 132 mr_free(command); 133 133 mr_free(tmp); 134 log_msg(1, "Cool. I didn't have to wipe anything.");134 mr_msg(1, "Cool. I didn't have to wipe anything."); 135 135 } 136 136 … … 148 148 return (-1); 149 149 } 150 log_msg(5, "Writing string '%s', one char at a time", str);150 mr_msg(5, "Writing string '%s', one char at a time", str); 151 151 j = strlen(str); 152 152 for (i = 0; i < j; i++) { 153 log_msg(6, "Writing %d ('%c')", str[i], str[i]);153 mr_msg(6, "Writing %d ('%c')", str[i], str[i]); 154 154 if ((fq = fopen(FDISK_LOG, "a+"))) { 155 155 fputc(str[i], fq); … … 163 163 } 164 164 } 165 log_msg(5, "Returning");165 mr_msg(5, "Returning"); 166 166 167 167 return (i); … … 244 244 // do_this_last[0] = '\0'; 245 245 iamhere("STARTING"); 246 log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");246 mr_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes..."); 247 247 if (find_home_of_exe("lvm")) // found it :) cool 248 248 { … … 274 274 if (just_erase_existing_volumes) { 275 275 paranoid_fclose(fin); 276 log_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs.");276 mr_msg(1, "Closed i-want-my-lvm. Finished erasing LVMs."); 277 277 retval = 0; 278 278 goto end_of_i_want_my_lvm; 279 279 } 280 280 281 log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");281 mr_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff..."); 282 282 rewind(fin); 283 283 for (fgets(incoming, 512, fin); !feof(fin); fgets(incoming, 512, fin)) { … … 311 311 for (q = tmp; *q > 32; q++); 312 312 *q = '\0'; 313 log_msg(1, "Deleting old entries at /dev/%s", tmp);313 mr_msg(1, "Deleting old entries at /dev/%s", tmp); 314 314 // sprintf(command, "%s -f %s", vgremove_sz, tmp); 315 315 // run_program_and_log_output(command, 1); … … 318 318 run_program_and_log_output(vgscan_sz, 1); 319 319 run_program_and_log_output(pvscan_sz, 1); 320 log_msg(3,320 mr_msg(3, 321 321 "After working around potentially broken i-want-my-lvm, incoming[] is now '%s'", 322 322 incoming); … … 332 332 res = run_program_and_log_output(command, 5); 333 333 } 334 log_msg(0, "%s --> %d", command, res);334 mr_msg(0, "%s --> %d", command, res); 335 335 if (res > 0) { 336 336 res = 1; … … 350 350 for (p = tmp; *p != '\0' && !isdigit(*p); p++); 351 351 extents = atol(p); 352 log_msg(5, "p='%s' --> extents=%ld", p, extents);352 mr_msg(5, "p='%s' --> extents=%ld", p, extents); 353 353 p = strstr(command, "-L"); 354 354 if (!p) { 355 log_msg(0, "Fiddlesticks. '%s' returned %d", command, res);355 mr_msg(0, "Fiddlesticks. '%s' returned %d", command, res); 356 356 } else { 357 357 if (lvmversion == 2) { … … 376 376 *(p + i) = ' '; 377 377 } 378 log_msg(5, "Retrying with '%s'", command);378 mr_msg(5, "Retrying with '%s'", command); 379 379 res = run_program_and_log_output(command, 5); 380 380 if (res > 0) { … … 384 384 fprintf(g_fprep, "%s\n", command); 385 385 } 386 log_msg(0, "%s --> %d", command, res);386 mr_msg(0, "%s --> %d", command, res); 387 387 if (!res) { 388 log_msg(5, "YAY! This time, it succeeded.");388 mr_msg(5, "YAY! This time, it succeeded."); 389 389 } 390 390 } 391 391 } 392 392 if (strstr(command, "vgcreate")) { 393 log_msg(0, "In case you're interested...");393 mr_msg(0, "In case you're interested..."); 394 394 run_program_and_log_output(vgscan_sz, 1); 395 395 run_program_and_log_output(pvscan_sz, 1); … … 403 403 } 404 404 paranoid_fclose(fin); 405 log_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff.");405 mr_msg(1, "Closed i-want-my-lvm. Finished doing funky stuff."); 406 406 end_of_i_want_my_lvm: 407 407 mr_free(tmp); … … 422 422 iamhere("ENDING"); 423 423 if (retval > 2) { 424 log_msg(1, "%d errors. I'm reporting this.", retval);424 mr_msg(1, "%d errors. I'm reporting this.", retval); 425 425 return (retval); 426 426 } else { 427 log_msg(1, "Not many errors. Returning 0.");427 mr_msg(1, "Not many errors. Returning 0."); 428 428 return (0); 429 429 } … … 572 572 // leave straight away if raidlist is initial or has no entries 573 573 if (!raidlist || raidlist->entries == 0) { 574 log_msg(1, "No RAID arrays found.");574 mr_msg(1, "No RAID arrays found."); 575 575 return 1; 576 576 } else { 577 log_msg(1, "%d RAID arrays found.", raidlist->entries);577 mr_msg(1, "%d RAID arrays found.", raidlist->entries); 578 578 } 579 579 // find raidlist entry for requested device … … 583 583 // check whether RAID device was found in raidlist 584 584 if (i == raidlist->entries) { 585 log_msg(1, "RAID device %s not found in list.", device);585 mr_msg(1, "RAID device %s not found in list.", device); 586 586 return 1; 587 587 } … … 809 809 } 810 810 811 log_msg(1, "Making %s", device);811 mr_msg(1, "Making %s", device); 812 812 // use mkraid if it exists, otherwise use mdadm 813 813 if (run_program_and_log_output("which mkraid", FALSE)) { 814 814 res = create_raid_device_via_mdadm(raidlist, device); 815 log_msg(1, "Creating RAID device %s via mdadm returned %d", device, res);815 mr_msg(1, "Creating RAID device %s via mdadm returned %d", device, res); 816 816 } else { 817 817 sprintf(program, "mkraid --really-force %s", device); 818 818 res = run_program_and_log_output(program, 1); 819 log_msg(1, "%s returned %d", program, res);819 mr_msg(1, "%s returned %d", program, res); 820 820 system("sync"); 821 821 sleep(3); … … 830 830 // sprintf(program, "raidstart %s", device); 831 831 // res = run_program_and_log_output(program, 1); 832 // log_msg(1, "%s returned %d", program, res);832 // mr_msg(1, "%s returned %d", program, res); 833 833 // system("sync"); sleep(1); 834 834 #endif … … 841 841 842 842 if (!strcmp(format, "lvm")) { 843 log_msg(1, "Don't format %s - it's part of an lvm volume", device);843 mr_msg(1, "Don't format %s - it's part of an lvm volume", device); 844 844 mr_free(program); 845 845 mr_free(tmp); … … 938 938 // start soft-raids now (because LVM might depend on them) 939 939 // ...and for simplicity's sake, let's format them at the same time :) 940 log_msg(1, "Stopping all RAID devices");940 mr_msg(1, "Stopping all RAID devices"); 941 941 stop_all_raid_devices(mountlist); 942 942 system("sync"); … … 944 944 system("sync"); 945 945 sleep(2); 946 log_msg(1, "Prepare soft-RAIDs"); // prep and format too946 mr_msg(1, "Prepare soft-RAIDs"); // prep and format too 947 947 for (lino = 0; lino < mountlist->entries; lino++) { 948 948 me = &mountlist->el[lino]; // the current mountlist entry 949 log_msg(2, "Examining %s", me->device);949 mr_msg(2, "Examining %s", me->device); 950 950 if (!strncmp(me->device, "/dev/md", 7)) { 951 951 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); … … 991 991 } 992 992 if (res) { 993 log_msg(1, "Vacuum-packing...");993 mr_msg(1, "Vacuum-packing..."); 994 994 */ 995 995 res = do_my_funky_lvm_stuff(FALSE, TRUE); … … 1013 1013 // do regulars at last 1014 1014 sleep(2); // woo! 1015 log_msg(1, "Formatting regulars");1015 mr_msg(1, "Formatting regulars"); 1016 1016 for (lino = 0; lino < mountlist->entries; lino++) { 1017 1017 me = &mountlist->el[lino]; // the current mountlist entry … … 1668 1668 system("sync"); 1669 1669 paranoid_pclose(pout_to_fdisk); 1670 log_msg(0,1670 mr_msg(0, 1671 1671 "------------------- fdisk.log looks like this ------------------"); 1672 1672 sprintf(tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE); 1673 1673 system(tmp); 1674 log_msg(0,1674 mr_msg(0, 1675 1675 "------------------- end of fdisk.log... word! ------------------"); 1676 1676 sprintf(tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG); … … 1809 1809 if (partsize > 0) { 1810 1810 if (!strcmp(format, "7")) { 1811 log_msg(1, "Adding 512K, just in case");1811 mr_msg(1, "Adding 512K, just in case"); 1812 1812 partsize += 512; 1813 1813 } … … 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 strcpy(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 } 1843 1843 if (!retval) { 1844 log_msg(1, "Trying to set %s%d's partition type now", drive,1844 mr_msg(1, "Trying to set %s%d's partition type now", drive, 1845 1845 partno); 1846 1846 retval = … … 1848 1848 partsize); 1849 1849 if (retval) { 1850 log_msg(1, "Failed. Trying again...");1850 mr_msg(1, "Failed. Trying again..."); 1851 1851 retval = 1852 1852 set_partition_type(pout_to_fdisk, drive, partno, … … 1855 1855 } 1856 1856 if (retval) { 1857 log_msg(1, "...but failed to set type");1857 mr_msg(1, "...but failed to set type"); 1858 1858 } 1859 1859 } else { … … 1952 1952 /* mountlist=&new_mtlist; */ 1953 1953 /* extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */ 1954 log_msg(0,1954 mr_msg(0, 1955 1955 "Mountlist, including the partitions incorporated in RAID devices:-"); 1956 1956 for (i = 0; i < mountlist->entries; i++) { 1957 1957 log_it(mountlist->el[i].device); 1958 1958 } 1959 log_msg(0, "End of mountlist.");1960 } 1961 log_msg(0, "Stopping all LVMs, just in case");1959 mr_msg(0, "End of mountlist."); 1960 } 1961 mr_msg(0, "Stopping all LVMs, just in case"); 1962 1962 if (!g_text_mode) { 1963 1963 newtSuspend(); … … 1967 1967 newtResume(); 1968 1968 } 1969 log_msg(0, "Stopping all software RAID devices, just in case");1969 mr_msg(0, "Stopping all software RAID devices, just in case"); 1970 1970 stop_all_raid_devices(mountlist); 1971 log_msg(0, "Done.");1971 mr_msg(0, "Done."); 1972 1972 1973 1973 /* … … 2093 2093 sprintf(tmp, "Setting %s's type to %s (%s)", partition, format, 2094 2094 partcode); 2095 log_msg(1, tmp);2095 mr_msg(1, tmp); 2096 2096 if (partcode[0] != '\0' && strcmp(partcode, "83")) { /* no need to set type if 83: 83 is default */ 2097 2097 … … 2101 2101 if (partno > 1 2102 2102 || strstr(last_line_of_file(FDISK_LOG), " (1-4)")) { 2103 log_msg(5, "Specifying partno (%d) - yay", partno);2103 mr_msg(5, "Specifying partno (%d) - yay", partno); 2104 2104 sprintf(tmp, "%d\n", partno); 2105 2105 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); 2106 log_msg(5, "A - last line = '%s'",2106 mr_msg(5, "A - last line = '%s'", 2107 2107 last_line_of_file(FDISK_LOG)); 2108 2108 } … … 2110 2110 sprintf(tmp, "%s\n", partcode); 2111 2111 fput_string_one_char_at_a_time(pout_to_fdisk, tmp); 2112 log_msg(5, "B - last line = '%s'",2112 mr_msg(5, "B - last line = '%s'", 2113 2113 last_line_of_file(FDISK_LOG)); 2114 2114 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); 2115 log_msg(5, "C - last line = '%s'",2115 mr_msg(5, "C - last line = '%s'", 2116 2116 last_line_of_file(FDISK_LOG)); 2117 2117 2118 2118 strcpy(tmp, last_line_of_file(FDISK_LOG)); 2119 2119 if (!strstr(tmp, " (m ")) { 2120 log_msg(1, "last line = '%s'; part type set failed", tmp);2120 mr_msg(1, "last line = '%s'; part type set failed", tmp); 2121 2121 res++; 2122 2122 fput_string_one_char_at_a_time(pout_to_fdisk, "\n"); … … 2128 2128 sprintf(command, "parted2fdisk %s >> %s 2>> %s", drive, 2129 2129 MONDO_LOGFILE, MONDO_LOGFILE); 2130 log_msg(5, "output = '%s'", output);2131 log_msg(5, "partno=%d; partcode=%s", partno, partcode);2132 log_msg(5, "command = '%s'", command);2130 mr_msg(5, "output = '%s'", output); 2131 mr_msg(5, "partno=%d; partcode=%s", partno, partcode); 2132 mr_msg(5, "command = '%s'", command); 2133 2133 fout = popen(command, "w"); 2134 2134 if (!fout) { … … 2180 2180 sprintf(program, "raidstart %s", raid_device); 2181 2181 #endif 2182 log_msg(1, "program = %s", program);2182 mr_msg(1, "program = %s", program); 2183 2183 res = run_program_and_log_output(program, 1); 2184 2184 if (g_fprep) { … … 2186 2186 } 2187 2187 if (res) { 2188 log_msg(1, "Warning - failed to start RAID device %s",2188 mr_msg(1, "Warning - failed to start RAID device %s", 2189 2189 raid_device); 2190 2190 } … … 2229 2229 } 2230 2230 #endif 2231 log_msg(1, "program = %s", program);2231 mr_msg(1, "program = %s", program); 2232 2232 res = run_program_and_log_output(program, 1); 2233 2233 if (g_fprep) { … … 2235 2235 } 2236 2236 if (res) { 2237 log_msg(1, "Warning - failed to stop RAID device %s", raid_device);2237 mr_msg(1, "Warning - failed to stop RAID device %s", raid_device); 2238 2238 } 2239 2239 retval += res; … … 2252 2252 (mountlist->el[i].device, RAID_DEVICE_STUB, 2253 2253 strlen(RAID_DEVICE_STUB))) { 2254 log_msg(1, "Starting %s", mountlist->el[i].device);2254 mr_msg(1, "Starting %s", mountlist->el[i].device); 2255 2255 res = start_raid_device(mountlist->el[i].device); 2256 2256 retval += res; … … 2258 2258 } 2259 2259 if (retval) { 2260 log_msg(1, "Started all s/w raid devices OK");2260 mr_msg(1, "Started all s/w raid devices OK"); 2261 2261 } else { 2262 log_msg(1, "Failed to start some/all s/w raid devices");2262 mr_msg(1, "Failed to start some/all s/w raid devices"); 2263 2263 } 2264 2264 return (retval); … … 2336 2336 paranoid_fclose(fin); 2337 2337 if (retval) { 2338 log_msg(1, "Warning - unable to stop some RAID devices");2338 mr_msg(1, "Warning - unable to stop some RAID devices"); 2339 2339 } 2340 2340 mr_free(dev); … … 2550 2550 2551 2551 if (!strcmp(drivemntlist->el[partno]->mountpoint, "image")) { 2552 log_msg(1, "Skipping %s (%s) because it's an image",2552 mr_msg(1, "Skipping %s (%s) because it's an image", 2553 2553 drivemntlist->el[partno]->device, 2554 2554 drivemntlist->el[partno]->mountpoint); … … 2627 2627 assert(drivemntlist != NULL); 2628 2628 2629 log_msg(1, "Creating list of partitions for drive %s", drive_name);2629 mr_msg(1, "Creating list of partitions for drive %s", drive_name); 2630 2630 2631 2631 tmp_drive_name = strdup(drive_name); -
branches/stable/mondo/src/mondorestore/mondo-restore.c
r1080 r1108 163 163 int retval = 0, res = 0; 164 164 165 log_msg(2, "let_user_edit_the_mountlist() --- starting");165 mr_msg(2, "let_user_edit_the_mountlist() --- starting"); 166 166 167 167 assert(bkpinfo != NULL); … … 170 170 if (!bkpinfo->disaster_recovery) { 171 171 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 172 log_msg(2, "I guess you're testing edit_mountlist()");172 mr_msg(2, "I guess you're testing edit_mountlist()"); 173 173 } 174 174 if (!does_file_exist(g_mountlist_fname)) { … … 218 218 for (i = 0; i < mountlist->entries; i++) { 219 219 if (strstr(mountlist->el[i].format, "ompaq")) { 220 log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",220 mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)", 221 221 i, mountlist->el[i].device, mountlist->el[i].format); 222 222 … … 296 296 if (bkpinfo->backup_media_type == iso) { 297 297 if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) { 298 log_msg(2,298 mr_msg(2, 299 299 "catchall_mode --- iso_fiddly_bits returned w/ error"); 300 300 return (1); 301 301 } else { 302 log_msg(2, "catchall_mode --- iso_fiddly_bits ok");302 mr_msg(2, "catchall_mode --- iso_fiddly_bits ok"); 303 303 } 304 304 } 305 305 306 306 if (c == 'I') { 307 log_msg(2, "IM selected");307 mr_msg(2, "IM selected"); 308 308 retval += interactive_mode(bkpinfo, mountlist, raidlist); 309 309 } else if (c == 'N') { 310 log_msg(2, "NM selected");310 mr_msg(2, "NM selected"); 311 311 retval += nuke_mode(bkpinfo, mountlist, raidlist); 312 312 } else if (c == 'C') { 313 log_msg(2, "CM selected");313 mr_msg(2, "CM selected"); 314 314 retval += compare_mode(bkpinfo, mountlist, raidlist); 315 315 } … … 400 400 /* try to partition and format */ 401 401 402 log_msg(2, "interactive_mode --- starting (great, assertions OK)");402 mr_msg(2, "interactive_mode --- starting (great, assertions OK)"); 403 403 404 404 malloc_string(tmp); … … 409 409 assert(raidlist != NULL); 410 410 411 log_msg(2, "interactive_mode --- assertions OK");411 mr_msg(2, "interactive_mode --- assertions OK"); 412 412 413 413 if (g_text_mode) { … … 433 433 #endif 434 434 { 435 log_msg(1, "Not resizing mountlist.");435 mr_msg(1, "Not resizing mountlist."); 436 436 } else { 437 437 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 451 451 paranoid_MR_finish(1); 452 452 } 453 log_msg(2, "Proceeding...");453 mr_msg(2, "Proceeding..."); 454 454 save_mountlist_to_disk(mountlist, g_mountlist_fname); 455 455 save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME); … … 534 534 ask_me_yes_or_no("Do you want me to restore all of your data?"))) 535 535 { 536 log_msg(1, "Restoring all data");536 mr_msg(1, "Restoring all data"); 537 537 retval += restore_everything(bkpinfo, NULL); 538 538 } else … … 561 561 } 562 562 strcpy(bkpinfo->restore_path, tmp); 563 log_msg(1, "Restoring subset");563 mr_msg(1, "Restoring subset"); 564 564 retval += restore_everything(bkpinfo, filelist); 565 565 free_filelist(filelist); … … 666 666 assert(raidlist != NULL); 667 667 if (iso_fiddly_bits(bkpinfo, nuke_me_please)) { 668 log_msg(1, "iso_mode --- returning w/ error");668 mr_msg(1, "iso_mode --- returning w/ error"); 669 669 return (1); 670 670 } else { … … 732 732 assert(raidlist != NULL); 733 733 734 log_msg(2, "nuke_mode --- starting");734 mr_msg(2, "nuke_mode --- starting"); 735 735 736 736 get_cfg_file_from_archive_or_bust(bkpinfo); … … 746 746 #endif 747 747 { 748 log_msg(2, "Not resizing mountlist.");748 mr_msg(2, "Not resizing mountlist."); 749 749 } else { 750 750 resize_mountlist_proportionately_to_suit_new_drives(mountlist); … … 784 784 #endif 785 785 { 786 log_msg(2,786 mr_msg(2, 787 787 "Not partitioning drives due to 'nopart' option."); 788 788 res = 0; … … 831 831 retval += restore_everything(bkpinfo, NULL); 832 832 if (!run_boot_loader(FALSE)) { 833 log_msg(1,833 mr_msg(1, 834 834 "Great! Boot loader was installed. No need for msg at end."); 835 835 boot_loader_installed = TRUE; … … 910 910 struct s_node *filelist; 911 911 912 log_msg(1, "restore_to_live_filesystem() - starting");912 mr_msg(1, "restore_to_live_filesystem() - starting"); 913 913 assert(bkpinfo != NULL); 914 914 malloc_string(old_restpath); … … 923 923 } 924 924 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE); 925 log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);925 mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device); 926 926 if (!bkpinfo->media_device[0]) { 927 log_msg(2, "Warning - failed to find media dev");928 } 929 930 931 log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);927 mr_msg(2, "Warning - failed to find media dev"); 928 } 929 930 931 mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir); 932 932 933 933 open_evalcall_form("Thinking..."); … … 957 957 } 958 958 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 959 log_msg(2,959 mr_msg(2, 960 960 "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway."); 961 961 } … … 1046 1046 if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) < 1047 1047 sizeof(biggiestruct)) { 1048 log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",1048 mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d", 1049 1049 bigfileno + 1); 1050 1050 } … … 1056 1056 sprintf(tmp, "Warning - bigfile %ld does not have a checksum", 1057 1057 bigfileno + 1); 1058 log_msg(3, tmp);1058 mr_msg(3, tmp); 1059 1059 p = checksum; 1060 1060 } … … 1072 1072 node = find_string_at_node(filelist, biggiestruct.filename); 1073 1073 if (!node) { 1074 log_msg(0, "Skipping %s (name isn't in filelist)",1074 mr_msg(0, "Skipping %s (name isn't in filelist)", 1075 1075 biggiestruct.filename); 1076 1076 pathname_of_last_file_restored[0] = '\0'; 1077 1077 return (0); 1078 1078 } else if (!(node->selected)) { 1079 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1079 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1080 1080 biggiestruct.filename); 1081 1081 pathname_of_last_file_restored[0] = '\0'; … … 1085 1085 /* otherwise, continue */ 1086 1086 1087 log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);1087 mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename); 1088 1088 if (biggiestruct.use_ntfsprog) { 1089 1089 if (strncmp(biggiestruct.filename, "/dev/", 5)) { 1090 log_msg(1,1090 mr_msg(1, 1091 1091 "I was in error when I set biggiestruct.use_ntfsprog to TRUE."); 1092 log_msg(1, "%s isn't even in /dev", biggiestruct.filename);1092 mr_msg(1, "%s isn't even in /dev", biggiestruct.filename); 1093 1093 biggiestruct.use_ntfsprog = FALSE; 1094 1094 } … … 1100 1100 g_loglevel = 4; 1101 1101 use_ntfsprog_hack = TRUE; 1102 log_msg(2,1102 mr_msg(2, 1103 1103 "Calling ntfsclone in background because %s is an NTFS /dev entry", 1104 1104 outfile_fname); … … 1112 1112 fatal_error("Fork failure"); 1113 1113 case 0: 1114 log_msg(3,1114 mr_msg(3, 1115 1115 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1116 1116 biggiestruct.filename, ntfsprog_fifo); … … 1118 1118 feed_outfrom_ntfsprog(biggiestruct.filename, 1119 1119 ntfsprog_fifo); 1120 // log_msg(3, "CHILD - fip - exiting");1120 // mr_msg(3, "CHILD - fip - exiting"); 1121 1121 exit(res); 1122 1122 break; 1123 1123 default: 1124 log_msg(3,1124 mr_msg(3, 1125 1125 "feed_into_ntfsprog() called in background --- pid=%ld", 1126 1126 (long int) (pid)); … … 1138 1138 sprintf(tmp, "Reassembling big file %ld (%s)", bigfileno + 1, 1139 1139 outfile_fname); 1140 log_msg(2, tmp);1140 mr_msg(2, tmp); 1141 1141 1142 1142 /* … … 1150 1150 pathname_of_last_file_restored[MAX_STR_LEN - 1] = '\0'; 1151 1151 1152 log_msg(3, "file_to_openout = %s", file_to_openout);1152 mr_msg(3, "file_to_openout = %s", file_to_openout); 1153 1153 if (!(fout = fopen(file_to_openout, "w"))) { 1154 1154 log_to_screen("Cannot openout outfile_fname - hard disk full?"); 1155 1155 return (1); 1156 1156 } 1157 log_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself1157 mr_msg(3, "Opened out to %s", outfile_fname); // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself 1158 1158 1159 1159 for (sliceno = 1, finished = FALSE; !finished;) { … … 1169 1169 !does_file_exist(slice_fname 1170 1170 (bigfileno, sliceno, ARCHIVES_PATH, "bz2"))) { 1171 log_msg(3,1171 mr_msg(3, 1172 1172 "Cannot find a data slice or terminator slice on CD %d", 1173 1173 g_current_media_number); … … 1177 1177 media_descriptor_string(bkpinfo->backup_media_type), 1178 1178 g_current_media_number, sliceno); 1179 log_msg(2, tmp);1179 mr_msg(2, tmp); 1180 1180 sprintf(tmp, "Restoring from %s #%d", 1181 1181 media_descriptor_string(bkpinfo->backup_media_type), … … 1188 1188 slice_fname(bigfileno, sliceno, ARCHIVES_PATH, "")); 1189 1189 if (does_file_exist(tmp) && length_of_file(tmp) == 0) { 1190 log_msg(2,1190 mr_msg(2, 1191 1191 "End of bigfile # %ld (slice %ld is the terminator)", 1192 1192 bigfileno + 1, sliceno); … … 1235 1235 media_descriptor_string(bkpinfo->backup_media_type), 1236 1236 g_current_media_number, bigfileno + 1, sliceno); 1237 log_msg(2, tmp);1237 mr_msg(2, tmp); 1238 1238 1239 1239 if (!g_text_mode) { … … 1253 1253 sprintf(sz_msg + strlen(sz_msg), 1254 1254 "; written %ld to fout", siz); 1255 // log_msg(2. sz_msg);1255 // mr_msg(2. sz_msg); 1256 1256 } 1257 1257 } … … 1274 1274 1275 1275 if (use_ntfsprog_hack) { 1276 log_msg(3, "Waiting for ntfsclone to finish");1276 mr_msg(3, "Waiting for ntfsclone to finish"); 1277 1277 sprintf(tmp, 1278 1278 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1370 1370 if (use_ntfsprog == BLK_START_A_PIHBIGGIE) { 1371 1371 use_ntfsprog = 1; 1372 log_msg(1, "%s --- pih=YES", orig_bf_fname);1372 mr_msg(1, "%s --- pih=YES", orig_bf_fname); 1373 1373 } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) { 1374 1374 use_ntfsprog = 0; 1375 log_msg(1, "%s --- pih=NO", orig_bf_fname);1375 mr_msg(1, "%s --- pih=NO", orig_bf_fname); 1376 1376 } else { 1377 1377 use_ntfsprog = 0; 1378 log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);1378 mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname); 1379 1379 } 1380 1380 … … 1389 1389 if (!node) { 1390 1390 dummy_restore = TRUE; 1391 log_msg(1,1391 mr_msg(1, 1392 1392 "Skipping big file %ld (%s) - not in biggielist subset", 1393 1393 biggiefile_number + 1, orig_bf_fname); … … 1395 1395 } else if (!(node->selected)) { 1396 1396 dummy_restore = TRUE; 1397 log_msg(1, "Skipping %s (name isn't in biggielist subset)",1397 mr_msg(1, "Skipping %s (name isn't in biggielist subset)", 1398 1398 orig_bf_fname); 1399 1399 pathname_of_last_file_restored[0] = '\0'; … … 1403 1403 if (use_ntfsprog) { 1404 1404 if (strncmp(orig_bf_fname, "/dev/", 5)) { 1405 log_msg(1,1405 mr_msg(1, 1406 1406 "I was in error when I set use_ntfsprog to TRUE."); 1407 log_msg(1, "%s isn't even in /dev", orig_bf_fname);1407 mr_msg(1, "%s isn't even in /dev", orig_bf_fname); 1408 1408 use_ntfsprog = FALSE; 1409 1409 } … … 1414 1414 strcpy(outfile_fname, orig_bf_fname); 1415 1415 use_ntfsprog_hack = TRUE; 1416 log_msg(2,1416 mr_msg(2, 1417 1417 "Calling ntfsclone in background because %s is a /dev entry", 1418 1418 outfile_fname); … … 1428 1428 fatal_error("Fork failure"); 1429 1429 case 0: 1430 log_msg(3,1430 mr_msg(3, 1431 1431 "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)", 1432 1432 outfile_fname, ntfsprog_fifo); 1433 1433 res = 1434 1434 feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo); 1435 // log_msg(3, "CHILD - fip - exiting");1435 // mr_msg(3, "CHILD - fip - exiting"); 1436 1436 exit(res); 1437 1437 break; 1438 1438 default: 1439 log_msg(3,1439 mr_msg(3, 1440 1440 "feed_into_ntfsprog() called in background --- pid=%ld", 1441 1441 (long int) (pid)); … … 1459 1459 sprintf(tmp, "Reassembling big file %ld (%s)", 1460 1460 biggiefile_number + 1, orig_bf_fname); 1461 log_msg(2, tmp);1461 mr_msg(2, tmp); 1462 1462 } 1463 1463 … … 1473 1473 } 1474 1474 sprintf(tmp, "Pipe command = '%s'", command); 1475 log_msg(3, tmp);1475 mr_msg(3, tmp); 1476 1476 1477 1477 /* restore biggiefile, one slice at a time */ … … 1487 1487 sprintf(tmp, "Working on file #%ld, slice #%ld ", 1488 1488 biggiefile_number + 1, current_slice_number); 1489 log_msg(2, tmp);1489 mr_msg(2, tmp); 1490 1490 if (!g_text_mode) { 1491 1491 newtDrawRootText(0, g_noof_rows - 2, tmp); … … 1505 1505 ((void *) &biggiestruct, 1, sizeof(biggiestruct), 1506 1506 fin) < sizeof(biggiestruct)) { 1507 log_msg(2,1507 mr_msg(2, 1508 1508 "Warning - unable to get biggiestruct of bigfile #%d", 1509 1509 biggiefile_number + 1); … … 1525 1525 paranoid_pclose(pout); 1526 1526 1527 log_msg(1, "pathname_of_last_file_restored is now %s",1527 mr_msg(1, "pathname_of_last_file_restored is now %s", 1528 1528 pathname_of_last_file_restored); 1529 1529 1530 1530 if (use_ntfsprog_hack) { 1531 log_msg(3, "Waiting for ntfsclone to finish");1531 mr_msg(3, "Waiting for ntfsclone to finish"); 1532 1532 sprintf(tmp, 1533 1533 " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null"); … … 1535 1535 sleep(1); 1536 1536 } 1537 log_msg(3, "OK, ntfsclone has really finished");1538 } 1539 1540 log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);1541 log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);1537 mr_msg(3, "OK, ntfsclone has really finished"); 1538 } 1539 1540 mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename); 1541 mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum); 1542 1542 if (strcmp(outfile_fname, "/dev/null")) { 1543 1543 chmod(outfile_fname, biggiestruct.properties.st_mode); … … 1609 1609 malloc_string(acl_fname); 1610 1610 1611 log_msg(5, "Entering");1611 mr_msg(5, "Entering"); 1612 1612 filelist_subset_fname[0] = '\0'; 1613 1613 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; … … 1621 1621 current_tarball_number); 1622 1622 if (length_of_file(filelist_name) <= 2) { 1623 log_msg(2, "There are _zero_ files in filelist '%s'",1623 mr_msg(2, "There are _zero_ files in filelist '%s'", 1624 1624 filelist_name); 1625 log_msg(2,1625 mr_msg(2, 1626 1626 "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)"); 1627 log_msg(2,1627 mr_msg(2, 1628 1628 "but it's non-critical. It's cosmetic. Don't worry about it."); 1629 1629 retval = 0; … … 1632 1632 if (count_lines_in_file(filelist_name) <= 0 1633 1633 || length_of_file(tarball_fname) <= 0) { 1634 log_msg(3, "length_of_file(%s) = %llu", tarball_fname,1634 mr_msg(3, "length_of_file(%s) = %llu", tarball_fname, 1635 1635 length_of_file(tarball_fname)); 1636 1636 sprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)", … … 1650 1650 <= 0) { 1651 1651 sprintf(tmp, "Skipping fileset %ld", current_tarball_number); 1652 log_msg(1, tmp);1652 mr_msg(1, tmp); 1653 1653 } else { 1654 log_msg(3, "Saved fileset %ld's subset to %s",1654 mr_msg(3, "Saved fileset %ld's subset to %s", 1655 1655 current_tarball_number, filelist_subset_fname); 1656 1656 } … … 1722 1722 sprintf(command + strlen(command), " 2>> %s >> %s", temp_log, 1723 1723 temp_log); 1724 log_msg(1, "command = '%s'", command);1724 mr_msg(1, "command = '%s'", command); 1725 1725 unlink(temp_log); 1726 1726 res = system(command); … … 1729 1729 if (p) { 1730 1730 p[0] = p[1] = p[2] = p[3] = ' '; 1731 log_msg(1, "new command = '%s'", command);1731 mr_msg(1, "new command = '%s'", command); 1732 1732 res = system(command); 1733 1733 } … … 1738 1738 1739 1739 if (g_getfattr) { 1740 log_msg(1, "Setting fattr list %s", xattr_fname);1740 mr_msg(1, "Setting fattr list %s", xattr_fname); 1741 1741 if (length_of_file(xattr_fname) > 0) { 1742 1742 res = set_fattr_list(filelist_subset_fname, xattr_fname); … … 1745 1745 ("Errors occurred while setting extended attributes"); 1746 1746 } else { 1747 log_msg(1, "I set xattr OK");1747 mr_msg(1, "I set xattr OK"); 1748 1748 } 1749 1749 retval += res; … … 1751 1751 } 1752 1752 if (g_getfacl) { 1753 log_msg(1, "Setting acl list %s", acl_fname);1753 mr_msg(1, "Setting acl list %s", acl_fname); 1754 1754 if (length_of_file(acl_fname) > 0) { 1755 1755 res = set_acl_list(filelist_subset_fname, acl_fname); … … 1758 1758 ("Errors occurred while setting access control lists"); 1759 1759 } else { 1760 log_msg(1, "I set ACL OK");1760 mr_msg(1, "I set ACL OK"); 1761 1761 } 1762 1762 retval += res; … … 1766 1766 sprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE); 1767 1767 system(command); 1768 log_msg(2, "Errors occurred while processing fileset #%d",1768 mr_msg(2, "Errors occurred while processing fileset #%d", 1769 1769 current_tarball_number); 1770 1770 } else { 1771 log_msg(2, "Fileset #%d processed OK", current_tarball_number);1771 mr_msg(2, "Fileset #%d processed OK", current_tarball_number); 1772 1772 } 1773 1773 } … … 1790 1790 mr_free(xattr_fname); 1791 1791 mr_free(acl_fname); 1792 log_msg(5, "Leaving");1792 mr_msg(5, "Leaving"); 1793 1793 return (retval); 1794 1794 } … … 1852 1852 media_descriptor_string(bkpinfo->backup_media_type), 1853 1853 g_current_media_number); 1854 log_msg(2, tmp);1854 mr_msg(2, tmp); 1855 1855 run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE); 1856 1856 … … 1873 1873 } 1874 1874 if (res) { 1875 log_msg(1, "Warning - error reading afioball from tape");1875 mr_msg(1, "Warning - error reading afioball from tape"); 1876 1876 } 1877 1877 if (bkpinfo->compression_level == 0) { … … 1900 1900 sprintf(command + strlen(command), " > %s 2>> %s", filelist_fname, 1901 1901 MONDO_LOGFILE); 1902 log_msg(1, "command = %s", command);1902 mr_msg(1, "command = %s", command); 1903 1903 if (system(command)) { 1904 log_msg(4, "Warning - error occurred while retrieving TOC");1904 mr_msg(4, "Warning - error occurred while retrieving TOC"); 1905 1905 } 1906 1906 if ((matches = … … 1910 1910 <= 0 || length_of_file(filelist_subset_fname) < 2) { 1911 1911 if (length_of_file(filelist_subset_fname) < 2) { 1912 log_msg(1, "No matches found in fileset %ld",1912 mr_msg(1, "No matches found in fileset %ld", 1913 1913 current_tarball_number); 1914 1914 } 1915 1915 sprintf(tmp, "Skipping fileset %ld", current_tarball_number); 1916 log_msg(2, tmp);1916 mr_msg(2, tmp); 1917 1917 restore_this_fileset = FALSE; 1918 1918 } else { 1919 log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",1919 mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s", 1920 1920 matches, current_tarball_number, 1921 1921 filelist_subset_fname); … … 1946 1946 // Call if IF there are files to restore (selectively/unconditionally) 1947 1947 if (restore_this_fileset) { 1948 log_msg(1, "Calling command='%s'", command);1948 mr_msg(1, "Calling command='%s'", command); 1949 1949 paranoid_system(command); 1950 1950 … … 1953 1953 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1954 1954 if (res) { 1955 log_msg(1, "Errors occurred while setting xattr");1955 mr_msg(1, "Errors occurred while setting xattr"); 1956 1956 } else { 1957 log_msg(1, "I set xattr OK");1957 mr_msg(1, "I set xattr OK"); 1958 1958 } 1959 1959 retval += res; … … 1964 1964 res = set_acl_list(filelist_subset_fname, acl_fname); 1965 1965 if (res) { 1966 log_msg(1, "Errors occurred while setting ACL");1966 mr_msg(1, "Errors occurred while setting ACL"); 1967 1967 } else { 1968 log_msg(1, "I set ACL OK");1968 mr_msg(1, "I set ACL OK"); 1969 1969 } 1970 1970 retval += res; … … 1972 1972 1973 1973 } else { 1974 log_msg(1, "NOT CALLING '%s'", command);1974 mr_msg(1, "NOT CALLING '%s'", command); 1975 1975 } 1976 1976 … … 2034 2034 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 2035 2035 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 2036 log_msg(1, "Warning - cannot openout %s",2036 mr_msg(1, "Warning - cannot openout %s", 2037 2037 biggies_whose_EXATs_we_should_set); 2038 2038 } … … 2043 2043 mvaddstr_and_log_it(g_currentY, 0, tmp); 2044 2044 if (length_of_file(BIGGIELIST) < 6) { 2045 log_msg(1, "OK, no biggielist; not restoring biggiefiles");2045 mr_msg(1, "OK, no biggielist; not restoring biggiefiles"); 2046 2046 return (0); 2047 2047 } 2048 2048 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 2049 2049 if (noof_biggiefiles <= 0) { 2050 log_msg(2,2050 mr_msg(2, 2051 2051 "OK, no biggiefiles in biggielist; not restoring biggiefiles"); 2052 2052 return (0); … … 2054 2054 sprintf(tmp, "OK, there are %ld biggiefiles in the archives", 2055 2055 noof_biggiefiles); 2056 log_msg(2, tmp);2056 mr_msg(2, tmp); 2057 2057 2058 2058 open_progress_form("Reassembling large files", … … 2061 2061 "", total_slices); 2062 2062 for (bigfileno = 0, finished = FALSE; !finished;) { 2063 log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);2063 mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1); 2064 2064 if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) { 2065 log_msg(3,2065 mr_msg(3, 2066 2066 "...but its first slice isn't on this CD. Perhaps this was a selective restore?"); 2067 log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",2067 mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d", 2068 2068 bigfileno + 1, 2069 2069 media_descriptor_string(bkpinfo->backup_media_type), 2070 2070 g_current_media_number); 2071 log_msg(3, "Slicename would have been %s",2071 mr_msg(3, "Slicename would have been %s", 2072 2072 slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, "")); 2073 2073 // I'm not positive 'just_changed_cds' is even necessary... 2074 2074 if (just_changed_cds) { 2075 2075 just_changed_cds = FALSE; 2076 log_msg(3,2076 mr_msg(3, 2077 2077 "I'll continue to scan this CD for bigfiles to be restored."); 2078 2078 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { … … 2086 2086 just_changed_cds = TRUE; 2087 2087 } else { 2088 log_msg(2, "There was no bigfile #%ld. That's OK.",2088 mr_msg(2, "There was no bigfile #%ld. That's OK.", 2089 2089 bigfileno + 1); 2090 log_msg(2, "I'm going to stop restoring bigfiles now.");2090 mr_msg(2, "I'm going to stop restoring bigfiles now."); 2091 2091 finished = TRUE; 2092 2092 } … … 2180 2180 2181 2181 mvaddstr_and_log_it(g_currentY, 0, "Restoring from archives"); 2182 log_msg(2,2182 mr_msg(2, 2183 2183 "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER"); 2184 2184 if (g_current_media_number != 1) { 2185 log_msg(3, "OK, that's jacked up.");2185 mr_msg(3, "OK, that's jacked up."); 2186 2186 g_current_media_number = 1; 2187 2187 } … … 2244 2244 media_descriptor_string(bkpinfo->backup_media_type), 2245 2245 g_current_media_number); 2246 // log_msg(3, "progress_str = %s", progress_str);2246 // mr_msg(3, "progress_str = %s", progress_str); 2247 2247 for (res = 999, attempts = 0; attempts < 3 && res != 0; 2248 2248 attempts++) { … … 2350 2350 "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir); 2351 2351 if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) { 2352 log_msg(1, "Warning - cannot openout %s",2352 mr_msg(1, "Warning - cannot openout %s", 2353 2353 biggies_whose_EXATs_we_should_set); 2354 2354 } … … 2366 2366 sprintf(tmp, "OK, there are %ld biggiefiles in the archives", 2367 2367 noof_biggiefiles); 2368 log_msg(2, tmp);2368 mr_msg(2, tmp); 2369 2369 open_progress_form("Reassembling large files", 2370 2370 "I am now reassembling all the large files.", … … 2398 2398 filelist, ctrl_chr, 2399 2399 pathname_of_last_biggie_restored); 2400 log_msg(1, "I believe I have restored %s",2400 mr_msg(1, "I believe I have restored %s", 2401 2401 pathname_of_last_biggie_restored); 2402 2402 if (fbw && pathname_of_last_biggie_restored[0]) { … … 2416 2416 noof_biggiefiles, current_bigfile_number); 2417 2417 } 2418 log_msg(1, tmp);2418 mr_msg(1, tmp); 2419 2419 2420 2420 if (fbw) { … … 2424 2424 if (g_getfattr) { 2425 2425 if (length_of_file(xattr_fname) > 0) { 2426 log_msg(1, "set_fattr_List(%s,%s)",2426 mr_msg(1, "set_fattr_List(%s,%s)", 2427 2427 biggies_whose_EXATs_we_should_set, xattr_fname); 2428 2428 set_fattr_list(biggies_whose_EXATs_we_should_set, … … 2432 2432 if (g_getfacl) { 2433 2433 if (length_of_file(acl_fname) > 0) { 2434 log_msg(1, "set_acl_list(%s,%s)",2434 mr_msg(1, "set_acl_list(%s,%s)", 2435 2435 biggies_whose_EXATs_we_should_set, acl_fname); 2436 2436 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname); … … 2523 2523 progress_str, max_val); 2524 2524 2525 log_msg(3, "hey");2525 mr_msg(3, "hey"); 2526 2526 2527 2527 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2528 2528 if (res) { 2529 log_msg(2, "Warning - error reading afioball from tape");2529 mr_msg(2, "Warning - error reading afioball from tape"); 2530 2530 } 2531 2531 retval += res; … … 2533 2533 wrong_marker(BLK_START_AFIOBALLS, ctrl_chr); 2534 2534 } 2535 log_msg(2, "ho");2535 mr_msg(2, "ho"); 2536 2536 res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr); 2537 2537 while (ctrl_chr != BLK_STOP_AFIOBALLS) { … … 2592 2592 } 2593 2593 } // next 2594 log_msg(1, "All done with afioballs");2594 mr_msg(1, "All done with afioballs"); 2595 2595 close_progress_form(); 2596 2596 if (retval) { … … 2636 2636 malloc_string(newpath); 2637 2637 malloc_string(tmp); 2638 log_msg(2, "restore_everything() --- starting");2638 mr_msg(2, "restore_everything() --- starting"); 2639 2639 g_current_media_number = 1; 2640 2640 getcwd(cwd, MAX_STR_LEN - 1); 2641 2641 sprintf(tmp, "mkdir -p %s", bkpinfo->restore_path); 2642 2642 run_program_and_log_output(tmp, FALSE); 2643 log_msg(1, "Changing dir to %s", bkpinfo->restore_path);2643 mr_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2644 2644 chdir(bkpinfo->restore_path); 2645 2645 getcwd(newpath, MAX_STR_LEN - 1); 2646 log_msg(1, "path is now %s", newpath);2647 log_msg(1, "restoring everything");2646 mr_msg(1, "path is now %s", newpath); 2647 mr_msg(1, "restoring everything"); 2648 2648 if (!find_home_of_exe("petris") && !g_text_mode) { 2649 2649 newtDrawRootText(0, g_noof_rows - 2, … … 2682 2682 } 2683 2683 if (length_of_file("/etc/raidtab") > 0) { 2684 log_msg(2, "Copying local raidtab to restored filesystem");2684 mr_msg(2, "Copying local raidtab to restored filesystem"); 2685 2685 run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING 2686 2686 "/etc/raidtab", FALSE); 2687 2687 } 2688 2688 kill_petris(); 2689 log_msg(2, "restore_everything() --- leaving");2689 mr_msg(2, "restore_everything() --- leaving"); 2690 2690 mr_free(cwd); 2691 2691 mr_free(newpath); … … 2732 2732 sprintf(tmp, "restore_here = '%s'", restore_here); 2733 2733 2734 log_msg(2, tmp);2735 2736 log_msg(2, "restore_live_from_monitas_server() - starting");2734 mr_msg(2, tmp); 2735 2736 mr_msg(2, "restore_live_from_monitas_server() - starting"); 2737 2737 unlink("/tmp/mountlist.txt"); 2738 2738 unlink("/tmp/filelist.full"); … … 2743 2743 strcpy(bkpinfo->restore_path, restore_here); 2744 2744 } 2745 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2745 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2746 2746 sprintf(tmp, "FYI - data will be restored to %s", 2747 2747 bkpinfo->restore_path); 2748 log_msg(3, tmp);2749 log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");2748 mr_msg(3, tmp); 2749 mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI"); 2750 2750 sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d", 2751 2751 (int) (random() % 32768)); … … 2798 2798 restore_this_directory, g_biggielist_txt, g_biggielist_txt); 2799 2799 if (system(command)) { 2800 log_msg(1,2800 mr_msg(1, 2801 2801 "Error(s) occurred while processing biggielist and wildcard"); 2802 2802 } … … 2806 2806 retval += restore_everything(bkpinfo, filelist); 2807 2807 free_filelist(filelist); 2808 log_msg(2, "--------End of restore_live_from_monitas_server--------");2808 mr_msg(2, "--------End of restore_live_from_monitas_server--------"); 2809 2809 return (retval); 2810 2810 } … … 2828 2828 void welcome_to_mondorestore() 2829 2829 { 2830 log_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION);2831 log_msg(0,2830 mr_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION); 2831 mr_msg(0, 2832 2832 "DON'T PANIC! Mondorestore logs almost everything, so please "); 2833 log_msg(0,2833 mr_msg(0, 2834 2834 "don't break out in a cold sweat just because you see a few "); 2835 log_msg(0,2835 mr_msg(0, 2836 2836 "error messages in the log. Read them; analyze them; see if "); 2837 log_msg(0,2837 mr_msg(0, 2838 2838 "they are significant; above all, verify your backups! Please"); 2839 log_msg(0,2839 mr_msg(0, 2840 2840 "attach a compressed copy of this log to any e-mail you send "); 2841 log_msg(0,2841 mr_msg(0, 2842 2842 "to the Mondo mailing list when you are seeking technical "); 2843 log_msg(0,2843 mr_msg(0, 2844 2844 "support. Without it, we can't help you. - DevTeam"); 2845 log_msg(0,2845 mr_msg(0, 2846 2846 "------------------------------------------------------------"); 2847 log_msg(0,2847 mr_msg(0, 2848 2848 "BTW, despite (or perhaps because of) the wealth of messages,"); 2849 log_msg(0,2849 mr_msg(0, 2850 2850 "some users are inclined to stop reading this log. If Mondo "); 2851 log_msg(0,2851 mr_msg(0, 2852 2852 "stopped for some reason, chances are it's detailed here. "); 2853 log_msg(0,2853 mr_msg(0, 2854 2854 "More than likely there's a message at the very end of this "); 2855 log_msg(0,2855 mr_msg(0, 2856 2856 "log that will tell you what is wrong. Please read it! "); 2857 log_msg(0,2857 mr_msg(0, 2858 2858 "------------------------------------------------------------"); 2859 2859 } … … 2906 2906 { 2907 2907 g_text_mode = TRUE; 2908 log_msg(1, "TEXTONLY MODE");2908 mr_msg(1, "TEXTONLY MODE"); 2909 2909 } else { 2910 2910 g_text_mode = FALSE; … … 2941 2941 g_kernel_version = get_kernel_version(); 2942 2942 2943 log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);2943 mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname); 2944 2944 if (strlen(g_mountlist_fname) < 3) { 2945 2945 fatal_error … … 2951 2951 sprintf(tmp, "%s.orig", g_mountlist_fname); 2952 2952 if (!does_file_exist(g_mountlist_fname)) { 2953 log_msg(2,2953 mr_msg(2, 2954 2954 "%ld: Warning - g_mountlist_fname (%s) does not exist yet", 2955 2955 __LINE__, g_mountlist_fname); … … 2978 2978 welcome_to_mondorestore(); 2979 2979 if (bkpinfo->disaster_recovery) { 2980 log_msg(1, "I am in disaster recovery mode");2980 mr_msg(1, "I am in disaster recovery mode"); 2981 2981 } else { 2982 log_msg(1, "I am in normal, live mode");2982 mr_msg(1, "I am in normal, live mode"); 2983 2983 } 2984 2984 … … 3061 3061 3062 3062 if (argc == 5 && strcmp(argv[1], "--copy") == 0) { 3063 log_msg(1, "SCORE");3063 mr_msg(1, "SCORE"); 3064 3064 g_loglevel = 10; 3065 3065 if (strstr(argv[2], "save")) { 3066 log_msg(1, "Saving from %s to %s", argv[3], argv[4]);3066 mr_msg(1, "Saving from %s to %s", argv[3], argv[4]); 3067 3067 fin = fopen(argv[3], "r"); 3068 3068 fout = fopen(argv[4], "w"); … … 3116 3116 // return(1); 3117 3117 } 3118 log_msg(1, "I am in normal, live mode.");3119 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);3118 mr_msg(1, "I am in normal, live mode."); 3119 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 3120 3120 mount_boot_if_necessary(); /* for Gentoo users */ 3121 log_msg(2, "Still here.");3121 mr_msg(2, "Still here."); 3122 3122 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) { 3123 3123 g_restoring_live_from_cd = TRUE; … … 3129 3129 argv[3], argv[4]); 3130 3130 } else { 3131 log_msg(2, "Calling restore_to_live_filesystem()");3131 mr_msg(2, "Calling restore_to_live_filesystem()"); 3132 3132 retval = restore_to_live_filesystem(bkpinfo); 3133 3133 } 3134 log_msg(2, "Still here. Yay.");3134 mr_msg(2, "Still here. Yay."); 3135 3135 if (strlen(bkpinfo->tmpdir) > 0) { 3136 3136 sprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir); … … 3141 3141 } else { 3142 3142 /* Disaster recovery mode (must be) */ 3143 log_msg(1, "I must be in disaster recovery mode.");3144 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);3143 mr_msg(1, "I must be in disaster recovery mode."); 3144 mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 3145 3145 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) { 3146 3146 log_to_screen("Uh, that hasn't been implemented yet."); … … 3161 3161 if (bkpinfo->backup_media_type == nfs 3162 3162 && !is_this_device_mounted(bkpinfo->nfs_mount)) { 3163 log_msg(1, "Mounting nfs dir");3163 mr_msg(1, "Mounting nfs dir"); 3164 3164 sprintf(bkpinfo->isodir, "/tmp/isodir"); 3165 3165 run_program_and_log_output("mkdir -p /tmp/isodir", 5); … … 3177 3177 3178 3178 3179 log_msg(1, "Send in the clowns.");3179 mr_msg(1, "Send in the clowns."); 3180 3180 3181 3181 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) { 3182 log_msg(0, "Partitioning only.");3182 mr_msg(0, "Partitioning only."); 3183 3183 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3184 3184 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3189 3189 3190 3190 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) { 3191 log_msg(0, "Formatting only.");3191 mr_msg(0, "Formatting only."); 3192 3192 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3193 3193 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3198 3198 3199 3199 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) { 3200 log_msg(0, "Stopping LVM and RAID");3200 mr_msg(0, "Stopping LVM and RAID"); 3201 3201 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3202 3202 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); … … 3281 3281 // g_I_have_just_nuked is set true by nuke_mode() just before it returns 3282 3282 if (!system("which post-nuke > /dev/null 2> /dev/null")) { 3283 log_msg(1, "post-nuke found; find out whether we should run it...");3283 mr_msg(1, "post-nuke found; find out whether we should run it..."); 3284 3284 if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) { 3285 3285 run_postnuke = TRUE; 3286 log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");3286 mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists."); 3287 3287 } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) { 3288 3288 run_postnuke = TRUE; 3289 log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");3289 mr_msg(1, "Yes, will run post-nuke because user interactively asked for it."); 3290 3290 } else { 3291 3291 run_postnuke = FALSE; 3292 log_msg(1, "No, will not run post-nuke.");3292 mr_msg(1, "No, will not run post-nuke."); 3293 3293 } 3294 3294 } else { 3295 log_msg(1, "No post-nuke found.");3295 mr_msg(1, "No post-nuke found."); 3296 3296 } 3297 3297 if (run_postnuke) { … … 3301 3301 ("Unable to re-mount partitions for post-nuke stuff"); 3302 3302 } else { 3303 log_msg(1, "Re-mounted partitions for post-nuke stuff");3303 mr_msg(1, "Re-mounted partitions for post-nuke stuff"); 3304 3304 sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path, 3305 3305 retval); 3306 log_msg(2, "Calling '%s'", tmp);3306 mr_msg(2, "Calling '%s'", tmp); 3307 3307 if ((res = run_program_and_log_output(tmp, 0))) { 3308 3308 log_OS_error(tmp); 3309 3309 } 3310 log_msg(1, "post-nuke returned w/ res=%d", res);3310 mr_msg(1, "post-nuke returned w/ res=%d", res); 3311 3311 } 3312 3312 unmount_all_devices(mountlist); -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c
r1080 r1108 78 78 sprintf(tmp_ptr, 79 79 "No CD's left. No biggiefiles left. No prob, Bob."); 80 log_msg(2, tmp_ptr);80 mr_msg(2, tmp_ptr); 81 81 return (0); 82 82 } … … 95 95 strcpy(bigfile_fname_ptr, biggiestruct.filename); 96 96 97 log_msg(2, "biggiestruct.filename = %s", biggiestruct.filename);98 log_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum);97 mr_msg(2, "biggiestruct.filename = %s", biggiestruct.filename); 98 mr_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum); 99 99 100 100 sprintf(tmp_ptr, "Comparing %s", bigfile_fname_ptr); … … 105 105 } 106 106 if (!checksum[0]) { 107 log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);107 mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr); 108 108 } 109 109 if (!strncmp(bigfile_fname_ptr, "/dev/", 5)) { … … 114 114 MNT_RESTORING, bigfile_fname_ptr); 115 115 } 116 log_msg(2, command_ptr);116 mr_msg(2, command_ptr); 117 117 paranoid_system 118 118 ("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); … … 123 123 } else { 124 124 if (!(fin = fopen("/tmp/md5sum.txt", "r"))) { 125 log_msg(2,125 mr_msg(2, 126 126 "Unable to open /tmp/md5sum.txt; can't get live checksum"); 127 127 original_cksum[0] = '\0'; … … 147 147 retval++; 148 148 } 149 log_msg(1, tmp_ptr);149 mr_msg(1, tmp_ptr); 150 150 if (retval) { 151 151 if (!(fout = fopen("/tmp/changed.txt", "a"))) { … … 188 188 189 189 assert(bkpinfo != NULL); 190 log_msg(1, "Comparing biggiefiles");190 mr_msg(1, "Comparing biggiefiles"); 191 191 192 192 if (length_of_file(BIGGIELIST) < 6) { 193 log_msg(1,193 mr_msg(1, 194 194 "OK, really teeny-tiny biggielist; not comparing biggiefiles"); 195 195 return (0); … … 197 197 noof_biggiefiles = count_lines_in_file(BIGGIELIST); 198 198 if (noof_biggiefiles <= 0) { 199 log_msg(1, "OK, no biggiefiles; not comparing biggiefiles");199 mr_msg(1, "OK, no biggiefiles; not comparing biggiefiles"); 200 200 return (0); 201 201 } … … 208 208 for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) { 209 209 sprintf(tmp, "Comparing big file #%ld", bigfileno + 1); 210 log_msg(1, tmp);210 mr_msg(1, tmp); 211 211 update_progress_form(tmp); 212 212 res = compare_a_biggiefile(bkpinfo, bigfileno); … … 341 341 "Differences found while processing fileset #%d ", 342 342 current_tarball_number); 343 log_msg(1, tmp);343 mr_msg(1, tmp); 344 344 } 345 345 unlink(logfile); … … 421 421 "/archives/slice* > /dev/null 2> /dev/null") 422 422 == 0) { 423 log_msg(2, "OK, I think I'm done with tarballs...");423 mr_msg(2, "OK, I think I'm done with tarballs..."); 424 424 break; 425 425 } 426 log_msg(2, "OK, I think it's time for another CD...");426 mr_msg(2, "OK, I think it's time for another CD..."); 427 427 g_current_media_number++; 428 428 sprintf(progress_str, "Comparing with %s #%d ", … … 603 603 log_to_screen(tmp); 604 604 605 log_msg(2, "calling popup_changelist_from_file()");605 mr_msg(2, "calling popup_changelist_from_file()"); 606 606 popup_changelist_from_file("/tmp/changed.files"); 607 log_msg(2, "Returning from popup_changelist_from_file()");607 mr_msg(2, "Returning from popup_changelist_from_file()"); 608 608 } 609 609 } else { … … 658 658 if (length_of_file("/tmp/changed.txt") > 2 659 659 && length_of_file("/tmp/changed.files") > 2) { 660 log_msg(0,660 mr_msg(0, 661 661 "Type 'less /tmp/changed.files' to see which files don't match the archives"); 662 log_msg(2, "Calling popup_changelist_from_file()");662 mr_msg(2, "Calling popup_changelist_from_file()"); 663 663 popup_changelist_from_file("/tmp/changed.files"); 664 log_msg(2, "Returned from popup_changelist_from_file()");664 mr_msg(2, "Returned from popup_changelist_from_file()"); 665 665 } 666 666 -
branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c
r1103 r1108 1586 1586 sizeof(struct raid_device_record)); 1587 1587 sprintf(title_of_editraidForm_window, "%s", raidrec->raid_device); 1588 log_msg(2, "Opening newt window");1588 mr_msg(2, "Opening newt window"); 1589 1589 newtOpenWindow(20, 5, 40, 14, title_of_editraidForm_window); 1590 1590 for (;;) { 1591 log_msg(2, "Main loop");1591 mr_msg(2, "Main loop"); 1592 1592 sprintf(title_of_editraidForm_window, "Edit %s", 1593 1593 raidrec->raid_device); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1103 r1108 207 207 || (!does_file_exist(output_mountlist_file) 208 208 && does_file_exist(orig_fname))) { 209 log_msg(2, "Failed to extract %s and/or %s from ramdisk",209 mr_msg(2, "Failed to extract %s and/or %s from ramdisk", 210 210 output_cfg_file, output_mountlist_file); 211 211 retval = 1; … … 275 275 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 276 276 f, file); 277 log_msg(2, tmp);277 mr_msg(2, tmp); 278 278 sprintf(command, "grep -E '^%s$' %s", file, list_fname); 279 279 res = run_program_and_log_output(command, FALSE); … … 324 324 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 325 325 run_program_and_log_output(command, 5); 326 log_msg(2, "Setting isodir to %s", bkpinfo->isodir);326 mr_msg(2, "Setting isodir to %s", bkpinfo->isodir); 327 327 } 328 328 … … 349 349 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 350 350 mount_isodir_command); 351 log_msg(1, tmp);351 mr_msg(1, tmp); 352 352 if (run_program_and_log_output(mount_isodir_command, FALSE)) { 353 353 popup_and_OK … … 364 364 sprintf(tmp, "%s #%d has been mounted via loopback mount", 365 365 media_descriptor_string(bkpinfo->backup_media_type), i); 366 log_msg(1, tmp);366 mr_msg(1, tmp); 367 367 if (i < 0) { 368 368 popup_and_OK … … 370 370 retval = 1; 371 371 } 372 log_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__,372 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 373 373 bkpinfo->isodir); 374 374 mr_free(mount_isodir_command); … … 501 501 for (lino = 0; lino < mountlist->entries; lino++) { 502 502 if (!strcmp(mountlist->el[lino].device, "/proc")) { 503 log_msg(1,503 mr_msg(1, 504 504 "Again with the /proc - why is this in your mountlist?"); 505 505 } else if (is_this_device_mounted(mountlist->el[lino].device)) { … … 591 591 if (bkpinfo->backup_media_type == tape 592 592 || bkpinfo->backup_media_type == udev) { 593 log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");593 mr_msg(8, "Tape/udev. Therefore, no need to mount CDROM."); 594 594 mr_free(mount_cmd); 595 595 return 0; … … 597 597 598 598 if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) { 599 log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");599 mr_msg(2, "mount_cdrom() - CD already mounted. Fair enough."); 600 600 mr_free(mount_cmd); 601 601 return (0); … … 603 603 604 604 if (bkpinfo->backup_media_type == nfs) { 605 log_msg(2, "Mounting for NFS thingy");606 log_msg(2, "isodir = %s", bkpinfo->isodir);605 mr_msg(2, "Mounting for NFS thingy"); 606 mr_msg(2, "isodir = %s", bkpinfo->isodir); 607 607 if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/")) 608 608 && am_I_in_disaster_recovery_mode()) { 609 609 strcpy(bkpinfo->isodir, "/tmp/isodir"); 610 log_msg(1, "isodir is being set to %s", bkpinfo->isodir);610 mr_msg(1, "isodir is being set to %s", bkpinfo->isodir); 611 611 } 612 612 #ifdef __FreeBSD__ … … 663 663 664 664 } 665 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);665 mr_msg(2, "(mount_cdrom) --- command = %s", mount_cmd); 666 666 for (i = 0; i < 2; i++) { 667 667 res = run_program_and_log_output(mount_cmd, FALSE); … … 669 669 break; 670 670 } else { 671 log_msg(2, "Failed to mount CD-ROM drive.");671 mr_msg(2, "Failed to mount CD-ROM drive."); 672 672 sleep(5); 673 673 run_program_and_log_output("sync", FALSE); … … 675 675 } 676 676 if (res) { 677 log_msg(2, "Failed, despite %d attempts", i);678 } else { 679 log_msg(2, "Mounted CD-ROM drive OK");677 mr_msg(2, "Failed, despite %d attempts", i); 678 } else { 679 mr_msg(2, "Mounted CD-ROM drive OK"); 680 680 } 681 681 mr_free(mount_cmd); … … 718 718 if (!strcmp(mpt, "/1")) { 719 719 strcpy(mountpoint, "/"); 720 log_msg(3, "Mommm! SME is being a dildo!");720 mr_msg(3, "Mommm! SME is being a dildo!"); 721 721 } else { 722 722 strcpy(mountpoint, mpt); … … 730 730 } 731 731 sprintf(tmp, "Mounting device %s ", device); 732 log_msg(1, tmp);732 mr_msg(1, tmp); 733 733 if (writeable) { 734 734 strcpy(additional_parameters, "-o rw"); … … 755 755 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device, 756 756 additional_parameters, mountdir, MONDO_LOGFILE); 757 log_msg(2, "command='%s'", command);757 mr_msg(2, "command='%s'", command); 758 758 } 759 759 res = run_program_and_log_output(command, TRUE); 760 760 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 761 log_msg(1, "Re-trying without the fancy extra parameters");761 mr_msg(1, "Re-trying without the fancy extra parameters"); 762 762 sprintf(command, "mount -t %s %s %s 2>> %s", format, device, 763 763 mountdir, MONDO_LOGFILE); … … 765 765 } 766 766 if (res) { 767 log_msg(1, "Unable to mount device %s (type %s) at %s", device,767 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, 768 768 format, mountdir); 769 log_msg(1, "command was '%s'", command);769 mr_msg(1, "command was '%s'", command); 770 770 if (!strcmp(mountpoint, "swap")) { 771 771 log_to_screen(tmp); 772 772 } else { 773 log_msg(2, "Retrying w/o the '-t' switch");773 mr_msg(2, "Retrying w/o the '-t' switch"); 774 774 sprintf(command, "mount %s %s 2>> %s", device, mountdir, 775 775 MONDO_LOGFILE); 776 log_msg(2, "2nd command = '%s'", command);776 mr_msg(2, "2nd command = '%s'", command); 777 777 res = run_program_and_log_output(command, TRUE); 778 778 if (res == 0) { 779 log_msg(1,779 mr_msg(1, 780 780 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 781 781 } else { … … 785 785 } 786 786 if (res && !strcmp(mountpoint, "swap")) { 787 log_msg(2, "That's ok. It's just a swap partition.");788 log_msg(2, "Non-fatal error. Returning 0.");787 mr_msg(2, "That's ok. It's just a swap partition."); 788 mr_msg(2, "Non-fatal error. Returning 0."); 789 789 res = 0; 790 790 } … … 898 898 /* Check to see if CD is already mounted before mounting it... */ 899 899 if (!is_this_device_mounted("/dev/cdrom")) { 900 log_msg(2,900 mr_msg(2, 901 901 "NB: CDROM device not mounted, mounting..."); 902 902 run_program_and_log_output("mount /dev/cdrom " … … 959 959 sprintf(tmp, "Backup medium is TAPE --- dev=%s", 960 960 bkpinfo->media_device); 961 log_msg(2, tmp);961 mr_msg(2, tmp); 962 962 } else { 963 963 strcpy(bkpinfo->media_device, "/dev/cdrom"); /* we don't really need this var */ 964 964 bkpinfo->media_size[0] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 965 965 bkpinfo->media_size[1] = 1999 * 1024; /* 650, probably, but we don't need this var anyway */ 966 log_msg(2, "Backup medium is CD-R[W]");967 } 968 } else { 969 log_msg(2,966 mr_msg(2, "Backup medium is CD-R[W]"); 967 } 968 } else { 969 mr_msg(2, 970 970 "Not in Disaster Recovery Mode. No need to derive device name from config file."); 971 971 } … … 974 974 if (strstr(value, "yes")) { 975 975 bkpinfo->use_star = TRUE; 976 log_msg(1, "Goody! ... bkpinfo->use_star is now true.");976 mr_msg(1, "Goody! ... bkpinfo->use_star is now true."); 977 977 } 978 978 … … 980 980 if (strstr(value, "yes")) { 981 981 mr_asprintf(&g_getfacl,"setfacl"); 982 log_msg(1, "We will restore ACLs");982 mr_msg(1, "We will restore ACLs"); 983 983 if (! find_home_of_exe("setfacl")) { 984 log_msg(1, "Unable to restore ACLs as no setfacl found");984 mr_msg(1, "Unable to restore ACLs as no setfacl found"); 985 985 } 986 986 } … … 988 988 if (strstr(value, "yes")) { 989 989 mr_asprintf(&g_getfattr,"setfattr"); 990 log_msg(1, "We will restore XATTRs");990 mr_msg(1, "We will restore XATTRs"); 991 991 if (! find_home_of_exe("setfattr")) { 992 log_msg(1, "Unable to restore XATTRs as no setfattr found");992 mr_msg(1, "Unable to restore XATTRs as no setfattr found"); 993 993 } 994 994 } … … 996 996 if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) { 997 997 bkpinfo->internal_tape_block_size = atol(value); 998 log_msg(1, "Internal tape block size has been custom-set to %ld",998 mr_msg(1, "Internal tape block size has been custom-set to %ld", 999 999 bkpinfo->internal_tape_block_size); 1000 1000 } else { 1001 1001 bkpinfo->internal_tape_block_size = 1002 1002 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 1003 log_msg(1, "Internal tape block size = default (%ld)",1003 mr_msg(1, "Internal tape block size = default (%ld)", 1004 1004 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 1005 1005 } … … 1036 1036 bkpinfo->differential = TRUE; 1037 1037 } 1038 log_msg(2, "differential var = '%s'", value);1038 mr_msg(2, "differential var = '%s'", value); 1039 1039 if (bkpinfo->differential) { 1040 log_msg(2, "THIS IS A DIFFERENTIAL BACKUP");1041 } else { 1042 log_msg(2, "This is a regular (full) backup");1040 mr_msg(2, "THIS IS A DIFFERENTIAL BACKUP"); 1041 } else { 1042 mr_msg(2, "This is a regular (full) backup"); 1043 1043 } 1044 1044 … … 1049 1049 ("cat /proc/cmdline"), "donteject")) { 1050 1050 bkpinfo->please_dont_eject = TRUE; 1051 log_msg(2, "Ok, I shan't eject when restoring! Groovy.");1051 mr_msg(2, "Ok, I shan't eject when restoring! Groovy."); 1052 1052 } 1053 1053 1054 1054 if (bkpinfo->backup_media_type == nfs) { 1055 1055 if (!cfgf) { 1056 log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);1057 log_msg(2, "nfs_remote_dir remains %s",1056 mr_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount); 1057 mr_msg(2, "nfs_remote_dir remains %s", 1058 1058 bkpinfo->nfs_remote_dir); 1059 log_msg(2,1059 mr_msg(2, 1060 1060 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 1061 1061 } else { … … 1064 1064 read_cfg_var(g_mondo_cfg_file, "nfs-server-path", 1065 1065 bkpinfo->nfs_remote_dir); 1066 log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);1067 log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);1066 mr_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount); 1067 mr_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir); 1068 1068 } 1069 1069 if (strstr(call_program_and_get_last_line_of_output … … 1103 1103 } 1104 1104 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 1105 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,1105 mr_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, 1106 1106 g_isodir_device); 1107 1107 if (bkpinfo->disaster_recovery) { 1108 1108 if (is_this_device_mounted(g_isodir_device)) { 1109 log_msg(2, "NB: isodir is already mounted");1109 mr_msg(2, "NB: isodir is already mounted"); 1110 1110 /* Find out where it's mounted */ 1111 1111 sprintf(command, … … 1123 1123 sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt); 1124 1124 if (run_program_and_log_output(tmp, 3)) { 1125 log_msg(1,1125 mr_msg(1, 1126 1126 "Unable to mount isodir. Perhaps this is really a CD backup?"); 1127 1127 bkpinfo->backup_media_type = cdr; … … 1132 1132 ("Unable to mount isodir. Failed to mount CD-ROM as well."); 1133 1133 } else { 1134 log_msg(1,1134 mr_msg(1, 1135 1135 "You backed up to disk, then burned some CDs."); 1136 1136 } … … 1147 1147 if (g_restoring_live_from_cd) { 1148 1148 if (bkpinfo->backup_media_type != media_specified_by_user) { 1149 log_msg(2,1149 mr_msg(2, 1150 1150 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1151 1151 interactively_obtain_media_parameters_from_user(bkpinfo, … … 1206 1206 if (does_file_exist(g_filelist_full) 1207 1207 && does_file_exist(g_biggielist_txt)) { 1208 log_msg(1, "%s exists", g_filelist_full);1209 log_msg(1, "%s exists", g_biggielist_txt);1210 log_msg(2,1208 mr_msg(1, "%s exists", g_filelist_full); 1209 mr_msg(1, "%s exists", g_biggielist_txt); 1210 mr_msg(2, 1211 1211 "Filelist and biggielist already recovered from media. Yay!"); 1212 1212 } else { 1213 1213 getcwd(tmp, MAX_STR_LEN); 1214 1214 chdir(bkpinfo->tmpdir); 1215 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);1215 mr_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1216 1216 log_to_screen("Extracting filelist and biggielist from media..."); 1217 1217 unlink("/tmp/filelist.full"); … … 1226 1226 FILELIST_FULL_STUB, 1227 1227 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1228 log_msg(1, "tarcommand = %s", command);1228 mr_msg(1, "tarcommand = %s", command); 1229 1229 run_program_and_log_output(command, 1); 1230 1230 } else { 1231 log_msg(2,1231 mr_msg(2, 1232 1232 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1233 1233 bkpinfo->isodir); 1234 1234 insist_on_this_cd_number(bkpinfo, 1); 1235 log_msg(2, "Back from iotcn");1235 mr_msg(2, "Back from iotcn"); 1236 1236 run_program_and_log_output("mount", 1); 1237 1237 sprintf(command, … … 1243 1243 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1244 1244 1245 log_msg(1, "tarcommand = %s", command);1245 mr_msg(1, "tarcommand = %s", command); 1246 1246 run_program_and_log_output(command, 1); 1247 1247 // popup_and_OK("Press ENTER to continue"); … … 1261 1261 sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir, 1262 1262 BIGGIELIST_TXT_STUB, g_biggielist_txt); 1263 log_msg(1, "command = %s", command);1263 mr_msg(1, "command = %s", command); 1264 1264 paranoid_system(command); 1265 1265 sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir, 1266 1266 FILELIST_FULL_STUB, g_filelist_full); 1267 log_msg(1, "command = %s", command);1267 mr_msg(1, "command = %s", command); 1268 1268 paranoid_system(command); 1269 1269 } … … 1282 1282 1283 1283 if (!does_file_exist(g_biggielist_txt)) { 1284 log_msg(1, "Warning - %s not found", g_biggielist_txt);1284 mr_msg(1, "Warning - %s not found", g_biggielist_txt); 1285 1285 } 1286 1286 if (!does_file_exist(g_filelist_full)) { 1287 log_msg(1, "Warning - %s does not exist", g_filelist_full);1287 mr_msg(1, "Warning - %s does not exist", g_filelist_full); 1288 1288 } 1289 1289 // popup_and_OK("Wonderful."); 1290 1290 1291 log_msg(2, "Forking");1291 mr_msg(2, "Forking"); 1292 1292 pid = fork(); 1293 1293 switch (pid) { … … 1317 1317 close_evalcall_form(); 1318 1318 1319 log_msg(3, "loading filelist");1319 mr_msg(3, "loading filelist"); 1320 1320 filelist = load_filelist(g_filelist_full); 1321 log_msg(3, "deleting original filelist");1321 mr_msg(3, "deleting original filelist"); 1322 1322 unlink(g_filelist_full); 1323 1323 if (g_text_mode) { … … 1334 1334 } 1335 1335 if (res) { 1336 log_msg(2, "User hit 'cancel'. Freeing filelist and aborting.");1336 mr_msg(2, "User hit 'cancel'. Freeing filelist and aborting."); 1337 1337 free_filelist(filelist); 1338 1338 return (NULL); … … 1418 1418 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1419 1419 sprintf(tmp, "run_boot_loader: device='%s', name='%s'", device, name); 1420 log_msg(2, tmp);1420 mr_msg(2, tmp); 1421 1421 system("sync"); 1422 1422 if (!strcmp(name, "LILO")) { … … 1432 1432 // else 1433 1433 // { 1434 // log_msg(1, "Not running run_grub(). Was a bad idea anyway.");1434 // mr_msg(1, "Not running run_grub(). Was a bad idea anyway."); 1435 1435 // res = 1; 1436 1436 // } … … 1448 1448 res = run_program_and_log_output(tmp, 3); 1449 1449 } else { 1450 log_msg(1,1450 mr_msg(1, 1451 1451 "I'm not running any boot loader. You have a DD boot drive. It's already loaded up."); 1452 1452 } … … 1497 1497 } 1498 1498 if (!find_home_of_exe(output)) { 1499 log_msg(2, " (find_my_editor) --- warning - %s not found", output);1499 mr_msg(2, " (find_my_editor) --- warning - %s not found", output); 1500 1500 } 1501 1501 return (output); … … 1535 1535 1536 1536 if (!run_program_and_log_output("which grub-MR", FALSE)) { 1537 log_msg(1, "Yay! grub-MR found...");1537 mr_msg(1, "Yay! grub-MR found..."); 1538 1538 sprintf(command, "grub-MR %s /tmp/mountlist.txt", boot_device); 1539 log_msg(1, "command = %s", command);1539 mr_msg(1, "command = %s", command); 1540 1540 } else { 1541 1541 sprintf(command, "chroot " MNT_RESTORING " grub-install %s", 1542 1542 boot_device); 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 if (offer_to_run_stabgrub … … 1599 1599 log_to_screen 1600 1600 ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info."); 1601 log_msg(1, "Type:-");1602 log_msg(1, " mount-me");1603 log_msg(1, " chroot " MNT_RESTORING);1604 log_msg(1, " mount /boot");1605 log_msg(1, " grub-install '(hd0)'");1606 log_msg(1, " exit");1607 log_msg(1, " unmount-me");1608 log_msg(1,1601 mr_msg(1, "Type:-"); 1602 mr_msg(1, " mount-me"); 1603 mr_msg(1, " chroot " MNT_RESTORING); 1604 mr_msg(1, " mount /boot"); 1605 mr_msg(1, " grub-install '(hd0)'"); 1606 mr_msg(1, " exit"); 1607 mr_msg(1, " unmount-me"); 1608 mr_msg(1, 1609 1609 "If you're really stuck, please e-mail the mailing list."); 1610 1610 } else { … … 1832 1832 strcpy(boot_device, bd); 1833 1833 sprintf(command, "raw-MR %s /tmp/mountlist.txt", boot_device); 1834 log_msg(2, "run_raw_mbr() --- command='%s'", command);1834 mr_msg(2, "run_raw_mbr() --- command='%s'", command); 1835 1835 1836 1836 if (offer_to_hack_scripts … … 2066 2066 void termination_in_progress(int sig) 2067 2067 { 2068 log_msg(1, "Termination in progress");2068 mr_msg(1, "Termination in progress"); 2069 2069 usleep(1000); 2070 2070 pthread_exit(0); … … 2113 2113 i++) { 2114 2114 sleep(1); 2115 log_msg(2, "Waiting for buffer() to finish");2115 mr_msg(2, "Waiting for buffer() to finish"); 2116 2116 } 2117 2117 … … 2120 2120 if (run_program_and_log_output 2121 2121 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) { 2122 log_msg(1,2122 mr_msg(1, 2123 2123 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 2124 2124 } 2125 2125 if (run_program_and_log_output 2126 2126 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 2127 log_msg(1,2127 mr_msg(1, 2128 2128 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 2129 2129 } … … 2145 2145 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 2146 2146 sprintf(command, "umount %s/", MNT_RESTORING); 2147 log_msg(3,2147 mr_msg(3, 2148 2148 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2149 2149 } else { … … 2152 2152 } 2153 2153 } 2154 log_msg(10, "The 'umount' command is '%s'", command);2154 mr_msg(10, "The 'umount' command is '%s'", command); 2155 2155 res = run_program_and_log_output(command, 3); 2156 2156 } else { … … 2164 2164 log_to_screen(tmp); 2165 2165 } else { 2166 log_msg(2, tmp);2166 mr_msg(2, tmp); 2167 2167 } 2168 2168 } … … 2213 2213 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2214 2214 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); 2215 log_msg(2, "command = '%s'", command);2215 mr_msg(2, "command = '%s'", command); 2216 2216 res = run_program_and_log_output(command, -1); 2217 2217 if (res != 0 && does_file_exist(MONDO_CFG_FILE_STUB)) { … … 2258 2258 malloc_string(command); 2259 2259 malloc_string(tmp); 2260 log_msg(2, "gcffa --- starting");2260 mr_msg(2, "gcffa --- starting"); 2261 2261 log_to_screen("I'm thinking..."); 2262 2262 sprintf(mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); … … 2278 2278 // make_hole_for_file( cfg_file ); 2279 2279 // make_hole_for_file( mountlist_file); 2280 log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);2280 mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2281 2281 2282 2282 /* Floppy? */ … … 2290 2290 "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &", 2291 2291 command); 2292 log_msg(1, "tmp = '%s'", tmp);2292 mr_msg(1, "tmp = '%s'", tmp); 2293 2293 system(tmp); 2294 2294 res = run_program_and_log_output(command, FALSE); … … 2301 2301 } else { 2302 2302 try_plan_B = TRUE; 2303 log_msg(2,2303 mr_msg(2, 2304 2304 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does."); 2305 2305 // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK. 2306 log_msg(2, "Processing floppy (plan A?)");2306 mr_msg(2, "Processing floppy (plan A?)"); 2307 2307 sprintf(ramdisk_fname, "%s/mindi.rdz", mountpt); 2308 2308 if (!does_file_exist(ramdisk_fname)) { … … 2310 2310 } 2311 2311 if (!does_file_exist(ramdisk_fname)) { 2312 log_msg(2,2312 mr_msg(2, 2313 2313 "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?"); 2314 2314 } 2315 2315 if (extract_config_file_from_ramdisk 2316 2316 (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) { 2317 log_msg(2,2317 mr_msg(2, 2318 2318 "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled."); 2319 2319 } … … 2323 2323 } 2324 2324 if (!does_file_exist(cfg_file)) { 2325 log_msg(2, "gcffa --- we don't have cfg file yet.");2325 mr_msg(2, "gcffa --- we don't have cfg file yet."); 2326 2326 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2327 2327 try_plan_B = TRUE; 2328 2328 } else { 2329 log_msg(2, "gcffa --- calling mount_cdrom now :)");2329 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2330 2330 if (!mount_cdrom(bkpinfo)) { 2331 log_msg(2,2331 mr_msg(2, 2332 2332 "gcffa --- managed to mount CD; so, no need for Plan B"); 2333 2333 try_plan_B = FALSE; … … 2341 2341 } 2342 2342 if (try_plan_B) { 2343 log_msg(2, "gcffa --- OK, switching to Plan B");2343 mr_msg(2, "gcffa --- OK, switching to Plan B"); 2344 2344 chdir(bkpinfo->tmpdir); 2345 2345 run_program_and_log_output("mkdir -p tmp", FALSE); … … 2347 2347 if (strlen(bkpinfo->media_device) == 0) { 2348 2348 strcpy(bkpinfo->media_device, "/dev/st0"); 2349 log_msg(2, "media_device is blank; assuming %s");2349 mr_msg(2, "media_device is blank; assuming %s"); 2350 2350 } 2351 2351 strcpy(tmp, bkpinfo->media_device); … … 2361 2361 if (extract_cfg_file_and_mountlist_from_tape_dev 2362 2362 (bkpinfo->media_device)) { 2363 log_msg(3,2363 mr_msg(3, 2364 2364 "I tried lots of devices but none worked."); 2365 2365 strcpy(bkpinfo->media_device, tmp); … … 2374 2374 } 2375 2375 } else { 2376 log_msg(2,2376 mr_msg(2, 2377 2377 "gcffa --- looking at mounted CD for mindi-boot.2880.img"); 2378 2378 sprintf(command, … … 2381 2381 sprintf(mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2382 2382 if (!does_file_exist(mounted_cfgf_path)) { 2383 log_msg(2,2383 mr_msg(2, 2384 2384 "gcffa --- Plan C, a.k.a. untarring some file from all.tar.gz"); 2385 2385 sprintf(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 … … 2393 2393 } 2394 2394 if (does_file_exist(MONDO_CFG_FILE_STUB)) { 2395 log_msg(1, "gcffa --- great! We've got the config file");2395 mr_msg(1, "gcffa --- great! We've got the config file"); 2396 2396 sprintf(tmp, "%s/%s", 2397 2397 call_program_and_get_last_line_of_output("pwd"), … … 2401 2401 if (strcmp(tmp, cfg_file) 2402 2402 && run_program_and_log_output(command, 1)) { 2403 log_msg(1,2403 mr_msg(1, 2404 2404 "... but an error occurred when I tried to move it to %s", 2405 2405 cfg_file); 2406 2406 } else { 2407 log_msg(1, "... and I moved it successfully to %s", cfg_file);2407 mr_msg(1, "... and I moved it successfully to %s", cfg_file); 2408 2408 } 2409 2409 sprintf(command, "cp -f %s/%s %s", … … 2413 2413 if (strcmp(tmp, cfg_file) 2414 2414 && run_program_and_log_output(command, 1)) { 2415 log_msg(1, "Failed to get mountlist");2415 mr_msg(1, "Failed to get mountlist"); 2416 2416 } else { 2417 log_msg(1, "Got mountlist too");2417 mr_msg(1, "Got mountlist too"); 2418 2418 sprintf(command, "cp -f %s %s", mountlist_file, 2419 2419 g_mountlist_fname); 2420 2420 if (run_program_and_log_output(command, 1)) { 2421 log_msg(1, "Failed to copy mountlist to /tmp");2421 mr_msg(1, "Failed to copy mountlist to /tmp"); 2422 2422 } else { 2423 log_msg(1, "Copied mountlist to /tmp as well OK");2423 mr_msg(1, "Copied mountlist to /tmp as well OK"); 2424 2424 sprintf(command, "cp -f tmp/i-want-my-lvm /tmp/"); 2425 2425 run_program_and_log_output(command, 1); … … 2427 2427 if (!run_program_and_log_output(command, 5) && !does_file_exist("/tmp/i-want-my-lvm")) 2428 2428 { 2429 log_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME.");2429 mr_msg(1, "Warning. You want LVM but I don't have i-want-my-lvm. FIXME."); 2430 2430 } 2431 2431 else if (run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm")) 2432 2432 { 2433 log_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool.");2433 mr_msg(1, "Warning. You don't want LVM but i-want-my-lvm exists. I'll delete it. Cool."); 2434 2434 do_my_funky_lvm_stuff(TRUE, FALSE); // ...after I stop any LVMs :) 2435 2435 stop_raid_device("/dev/md0"); … … 2440 2440 else if (!run_program_and_log_output(command,5) && does_file_exist("/tmp/i-want-my-lvm")) 2441 2441 { 2442 log_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME.");2442 mr_msg(1, "You had better pray that i-want-my-lvm patches your mountlist. FIXME."); 2443 2443 } 2444 2444 */ … … 2449 2449 if (!does_file_exist(cfg_file)) { 2450 2450 iamhere(cfg_file); 2451 log_msg(1, "%s not found", cfg_file);2451 mr_msg(1, "%s not found", cfg_file); 2452 2452 log_to_screen 2453 2453 ("Oh dear. Unable to recover configuration file from boot disk"); … … 2529 2529 if (parse_mdstat(raidlist, "/dev/")) { 2530 2530 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2531 log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);2531 mr_msg(1,"Sorry, cannot read %s", MDSTAT_FILE); 2532 2532 return; 2533 2533 } … … 2539 2539 continue; 2540 2540 } 2541 log_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);2541 mr_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i); 2542 2542 sprintf(screen_message, "Sync'ing %s", 2543 2543 raidlist->el[i].raid_device); 2544 2544 open_evalcall_form(screen_message); 2545 2545 while (raidlist->el[i].progress < wait_for_percentage) { 2546 log_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);2546 mr_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress); 2547 2547 update_evalcall_form(raidlist->el[i].progress); 2548 2548 sleep(2);
Note:
See TracChangeset
for help on using the changeset viewer.