Changeset 1107 in MondoRescue
- Timestamp:
- Feb 8, 2007, 12:09:34 AM (18 years ago)
- Location:
- branches/stable/mondo/src/common
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-archive.c
r1093 r1107 10 10 * This is the main file (at least the longest one) in libmondo. 11 11 */ 12 #include <sys/sem.h> 13 #include <sys/types.h> 14 #include <sys/ipc.h> 15 #include <stdarg.h> 16 #include <unistd.h> 12 17 13 18 #include "my-stuff.h" 14 19 #include "../common/mondostructures.h" 20 #include "mr_conf.h" 21 #include "mr_mem.h" 22 #include "mr_err.h" 23 #include "mr_str.h" 24 #include "mr_file.h" 25 15 26 #include "libmondo-string-EXT.h" 16 27 #include "libmondo-stream-EXT.h" … … 26 37 #include "lib-common-externs.h" 27 38 28 #include "mr_mem.h"29 #include "mr_str.h"30 #include "mr_file.h"31 32 #include <sys/sem.h>33 #include <sys/types.h>34 #include <sys/ipc.h>35 #include <stdarg.h>36 39 #define DVDRWFORMAT 1 37 40 … … 91 94 */ 92 95 t_bkptype g_backup_media_type = none; 96 char *g_backup_media_string = NULL; 93 97 94 98 /** … … 142 146 143 147 if (semctl(g_sem_id, 0, IPC_RMID, sem_union) == -1) { 144 log_msg(3, "Failed to delete semaphore");148 mr_msg(3, "Failed to delete semaphore"); 145 149 } 146 150 } … … 159 163 sem_b.sem_flg = SEM_UNDO; 160 164 if (semop(g_sem_id, &sem_b, 1) == -1) { 161 log_msg(3, "semaphore_p failed");165 mr_msg(3, "semaphore_p failed"); 162 166 return (0); 163 167 } … … 177 181 sem_b.sem_flg = SEM_UNDO; 178 182 if (semop(g_sem_id, &sem_b, 1) == -1) { 179 log_msg(3, "semaphore_v failed");183 mr_msg(3, "semaphore_v failed"); 180 184 return (0); 181 185 } … … 235 239 } 236 240 sprintf(command + strlen(command), " 2>> %s", MONDO_LOGFILE); 237 log_msg(4, "command = '%s'", command);241 mr_msg(4, "command = '%s'", command); 238 242 239 243 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 240 log_msg(5, "command='%s'", command);244 mr_msg(5, "command='%s'", command); 241 245 res = system(command); 242 246 strcpy(tmp, last_line_of_file(MONDO_LOGFILE)); 243 log_msg(1, "res=%d; tmp='%s'", res, tmp);247 mr_msg(1, "res=%d; tmp='%s'", res, tmp); 244 248 if (bkpinfo->use_star && (res == 254 || res == 65024) 245 249 && strstr(tmp, "star: Processed all possible files") 246 250 && tries > 0) { 247 log_msg(1, "Star returned nonfatal error");251 mr_msg(1, "Star returned nonfatal error"); 248 252 res = 0; 249 253 } … … 253 257 if (p) { 254 258 p[0] = p[1] = p[2] = p[3] = ' '; 255 log_msg(1, "new command = '%s'", command);259 mr_msg(1, "new command = '%s'", command); 256 260 } else { 257 log_msg(3,261 mr_msg(3, 258 262 "Attempt #%d failed. Pausing 3 seconds and retrying...", 259 263 tries + 1); … … 264 268 retval += res; 265 269 if (retval) { 266 log_msg(3, "Failed to write set %d", setno);270 mr_msg(3, "Failed to write set %d", setno); 267 271 } else if (tries > 1) { 268 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,272 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 269 273 tries); 270 274 } … … 344 348 strcat(zipparams, tmp); 345 349 } else { 346 log_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp);350 mr_msg(3, "%s not found. Cannot exclude zipfiles, etc.", tmp); 347 351 } 348 352 } else { … … 373 377 374 378 for (res = 99, tries = 0; tries < 3 && res != 0; tries++) { 375 log_msg(5, "command='%s'", command);379 mr_msg(5, "command='%s'", command); 376 380 res = system(command); 377 381 if (res) { 378 382 log_OS_error(command); 379 log_msg(3,383 mr_msg(3, 380 384 "Attempt #%d failed. Pausing 3 seconds and retrying...", 381 385 tries + 1); … … 385 389 retval += res; 386 390 if (retval) { 387 log_msg(3, "Failed to write set %d", setno);391 mr_msg(3, "Failed to write set %d", setno); 388 392 } else if (tries > 1) { 389 log_msg(3, "Succeeded in writing set %d, on try #%d", setno,393 mr_msg(3, "Succeeded in writing set %d, on try #%d", setno, 390 394 tries); 391 395 } … … 397 401 if (free_ramdisk_space > i) { 398 402 free_ramdisk_space = i; 399 log_msg(2, "min(free_ramdisk_space) is now %d",403 mr_msg(2, "min(free_ramdisk_space) is now %d", 400 404 free_ramdisk_space); 401 405 if (free_ramdisk_space < 10) { … … 495 499 retval += make_those_slices_phase(bkpinfo); // backup BIG files 496 500 retval += do_that_final_phase(bkpinfo); // clean up 497 log_msg(1, "Creation of archives... complete.");501 mr_msg(1, "Creation of archives... complete."); 498 502 if (bkpinfo->verify_data) { 499 503 sleep(2); … … 574 578 bkpinfo->exclude_paths); 575 579 strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp)); 576 log_msg(2, tmp);580 mr_msg(2, tmp); 577 581 mvaddstr_and_log_it(g_currentY, 0, 578 582 "Calling MINDI to create boot+data disks"); … … 622 626 sprintf(tmp, "User specified boot loader. It is '%c'.", 623 627 bkpinfo->boot_loader); 624 log_msg(2, tmp);628 mr_msg(2, tmp); 625 629 } else { 626 630 bkpinfo->boot_loader = ch; … … 629 633 sprintf(tmp, "User specified boot device. It is '%s'.", 630 634 bkpinfo->boot_device); 631 log_msg(2, tmp);635 mr_msg(2, tmp); 632 636 } else { 633 637 strcpy(bkpinfo->boot_device, bootdev); … … 857 861 //use_gzip_sz); // parameter #20 (STRING) 858 862 859 log_msg(2, command);863 mr_msg(2, command); 860 864 861 865 res = run_program_and_log_to_screen(command, "Generating boot+data disks"); … … 866 870 log_to_screen("Boot+data disks were created OK"); 867 871 sprintf(command, "mkdir -p /var/cache/mindi/"); 868 log_msg(2, command);872 mr_msg(2, command); 869 873 run_program_and_log_output(command, FALSE); 870 874 sprintf(command, 871 875 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso", 872 876 bkpinfo->scratchdir); 873 log_msg(2, command);877 mr_msg(2, command); 874 878 run_program_and_log_output(command, FALSE); 875 879 if (bkpinfo->nonbootable_backup) { … … 991 995 } 992 996 if (!semaphore_p()) { 993 log_msg(3, "P sem failed (pid=%d)", (int) getpid());997 mr_msg(3, "P sem failed (pid=%d)", (int) getpid()); 994 998 fatal_error("Cannot get semaphore P"); 995 999 } … … 1008 1012 bkpinfo->tmpdir, archiving_set_no); 1009 1013 if (!does_file_exist(archiving_filelist_fname)) { 1010 log_msg(3,1014 mr_msg(3, 1011 1015 "%s[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.", 1012 1016 FORTY_SPACES, getpid(), this_thread_no, … … 1018 1022 archiving_set_no - ARCH_BUFFER_NUM, bkpinfo->zip_suffix); 1019 1023 if (does_file_exist(tmp)) { 1020 log_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES,1024 mr_msg(4, "%s[%d:%d] - waiting for storer", FORTY_SPACES, 1021 1025 getpid(), this_thread_no); 1022 1026 while (does_file_exist(tmp)) { 1023 1027 sleep(1); 1024 1028 } 1025 log_msg(4, "[%d] - continuing", getpid());1026 } 1027 1028 log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),1029 mr_msg(4, "[%d] - continuing", getpid()); 1030 } 1031 1032 mr_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(), 1029 1033 this_thread_no, archiving_set_no); 1030 1034 if (g_getfattr) { … … 1039 1043 } 1040 1044 1041 log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),1045 mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(), 1042 1046 this_thread_no, archiving_set_no); 1043 1047 res = … … 1066 1070 fatal_error("Cannot get semaphore V"); 1067 1071 } 1068 log_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(),1072 mr_msg(4, "%s[%d:%d] - archived %d OK", FORTY_SPACES, getpid(), 1069 1073 this_thread_no, archiving_set_no); 1070 1074 archiving_set_no++; … … 1077 1081 fatal_error("Cannot get semaphore V"); 1078 1082 } 1079 log_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(),1083 mr_msg(3, "%s[%d:%d] - exiting", FORTY_SPACES, getpid(), 1080 1084 this_thread_no); 1081 1085 mr_free(archiving_filelist_fname); … … 1113 1117 "Writing any remaining data to media "); 1114 1118 1115 log_msg(1, "Closing tape/CD ... ");1119 mr_msg(1, "Closing tape/CD ... "); 1116 1120 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) 1117 1121 /* write tape/cdstream */ … … 1124 1128 retval += res; 1125 1129 if (res) { 1126 log_msg(1, "write_final_iso_if_necessary returned an error");1127 } 1128 } 1129 log_msg(2, "Fork is exiting ... ");1130 mr_msg(1, "write_final_iso_if_necessary returned an error"); 1131 } 1132 } 1133 mr_msg(2, "Fork is exiting ... "); 1130 1134 1131 1135 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 1181 1185 strip_spaces(g_serial_string); 1182 1186 strcat(g_serial_string, "...word."); 1183 log_msg(2, "g_serial_string = '%s'", g_serial_string);1187 mr_msg(2, "g_serial_string = '%s'", g_serial_string); 1184 1188 assert(strlen(g_serial_string) < MAX_STR_LEN); 1185 1189 1186 1190 sprintf(tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir); 1187 1191 if (write_one_liner_data_file(tmpfile, g_serial_string)) { 1188 log_msg(1, "%ld: Failed to write serial string", __LINE__);1192 mr_msg(1, "%ld: Failed to write serial string", __LINE__); 1189 1193 } 1190 1194 … … 1199 1203 fatal_error("Cannot open backup (streaming) device"); 1200 1204 } 1201 log_msg(1, "Backup (stream) opened OK");1205 mr_msg(1, "Backup (stream) opened OK"); 1202 1206 write_data_disks_to_stream(data_disks_file); 1203 1207 } else { 1204 log_msg(1, "Backing up to CD's");1208 mr_msg(1, "Backing up to CD's"); 1205 1209 } 1206 1210 … … 1275 1279 sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile, 1276 1280 tempfile); 1277 log_msg(3, command);1281 mr_msg(3, command); 1278 1282 open_evalcall_form(title); 1279 1283 if (!(pin = popen(command, "r"))) { … … 1289 1293 trackno = get_trackno_from_logfile(tempfile); 1290 1294 if (trackno < 0 || trackno > 80) { 1291 log_msg(1, "Weird track#");1295 mr_msg(1, "Weird track#"); 1292 1296 continue; 1293 1297 } … … 1440 1444 int misc_counter_that_is_not_important = 0; 1441 1445 1442 log_msg(8, "here");1446 mr_msg(8, "here"); 1443 1447 assert(bkpinfo != NULL); 1444 1448 tmp = mr_malloc(MAX_STR_LEN * 2); … … 1466 1470 sprintf(tmp, "%s/archives/filelist.full", bkpinfo->scratchdir); 1467 1471 log_to_screen("Archiving regular files"); 1468 log_msg(5, "Go, Shorty. It's your birthday.");1472 mr_msg(5, "Go, Shorty. It's your birthday."); 1469 1473 open_progress_form("Backing up filesystem", 1470 1474 "I am backing up your live filesystem now.", … … 1473 1477 get_last_filelist_number(bkpinfo) + 1); 1474 1478 1475 log_msg(5, "We're gonna party like it's your birthday.");1479 mr_msg(5, "We're gonna party like it's your birthday."); 1476 1480 1477 1481 srand((unsigned int) getpid()); … … 1486 1490 } // initialize semaphore 1487 1491 for (noof_threads = 0; noof_threads < ARCH_THREADS; noof_threads++) { 1488 log_msg(8, "Creating thread #%d", noof_threads);1492 mr_msg(8, "Creating thread #%d", noof_threads); 1489 1493 (*p_archival_threads_running)++; 1490 1494 if ((res = … … 1496 1500 } 1497 1501 1498 log_msg(8, "About to enter while() loop");1502 mr_msg(8, "About to enter while() loop"); 1499 1503 while (!done_storing) { 1500 1504 if (g_exiting) { … … 1503 1507 if (*p_archival_threads_running == 0 1504 1508 && *p_last_set_archived == storing_set_no - 1) { 1505 log_msg(2,1509 mr_msg(2, 1506 1510 "No archival threads are running. The last stored set was %d and I'm looking for %d. Take off your make-up; the party's over... :-)", 1507 1511 *p_last_set_archived, storing_set_no); … … 1532 1536 } 1533 1537 1534 log_msg(2, "Storing set %d", storing_set_no);1538 mr_msg(2, "Storing set %d", storing_set_no); 1535 1539 while (!does_file_exist(storing_filelist_fname) 1536 1540 || !does_file_exist(storing_afioball_fname)) { 1537 log_msg(2,1541 mr_msg(2, 1538 1542 "Warning - either %s or %s doesn't exist yet. I'll pause 5 secs.", 1539 1543 storing_filelist_fname, storing_afioball_fname); … … 1598 1602 1599 1603 sprintf(tmp, "Your regular files have been archived "); 1600 log_msg(2, "Joining background threads to foreground thread");1604 mr_msg(2, "Joining background threads to foreground thread"); 1601 1605 for (i = 0; i < noof_threads; i++) { 1602 1606 pthread_join(archival_thread[i], pvp); 1603 log_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads);1607 mr_msg(3, "Thread %d of %d: closed OK", i + 1, noof_threads); 1604 1608 } 1605 1609 del_semvalue(); 1606 log_msg(2, "Done.");1610 mr_msg(2, "Done."); 1607 1611 if (retval) { 1608 1612 strcat(tmp, "(with errors)."); … … 1694 1698 if (!does_file_exist(tmp)) 1695 1699 { 1696 log_msg (2, "Silly bug in Mindi.pl; workaround in progress...");1700 mr_msg (2, "Silly bug in Mindi.pl; workaround in progress..."); 1697 1701 strcpy(fnam, call_program_and_get_last_line_of_output("locate isolinux.bin | tail -n1")); 1698 1702 if (strlen(fnam)>0 && does_file_exist(fnam)) … … 1707 1711 if (res) 1708 1712 { 1709 log_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing");1713 mr_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing"); 1710 1714 } 1711 1715 } … … 1717 1721 } 1718 1722 1719 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s",1723 mr_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", 1720 1724 bkpinfo->scratchdir, destfile); 1721 1725 (void) getcwd(old_pwd, MAX_STR_LEN - 1); … … 1741 1745 1742 1746 if (bkpinfo->call_make_iso[0] != '\0') { 1743 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso);1747 mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1744 1748 sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1745 1749 sprintf(message_to_screen, "Making an ISO (%s #%d)", … … 1790 1794 sprintf(sz_blank_disk, "dvd+rw-format -force %s", 1791 1795 bkpinfo->media_device); 1792 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);1796 mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk); 1793 1797 res = 1794 1798 run_external_binary_with_percentage_indicator_NEW … … 1843 1847 media_descriptor_string(bkpinfo->backup_media_type), 1844 1848 g_current_media_number); 1845 log_msg(1, message_to_screen);1849 mr_msg(1, message_to_screen); 1846 1850 sprintf(result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1847 1851 media_descriptor_string(bkpinfo->backup_media_type), 1848 1852 g_current_media_number); 1849 1853 if (bkpinfo->nonbootable_backup) { 1850 log_msg(1, "Making nonbootable backup");1854 mr_msg(1, "Making nonbootable backup"); 1851 1855 res = 1852 1856 eval_call_to_make_ISO(bkpinfo, … … 1855 1859 MONDO_LOGFILE, message_to_screen); 1856 1860 } else { 1857 log_msg(1, "Making bootable backup");1861 mr_msg(1, "Making bootable backup"); 1858 1862 1859 1863 #ifdef __FreeBSD__ … … 1862 1866 1863 1867 1864 log_msg(1, "make_cd_use_lilo is actually %d",1868 mr_msg(1, "make_cd_use_lilo is actually %d", 1865 1869 bkpinfo->make_cd_use_lilo); 1866 1870 if (bkpinfo->make_cd_use_lilo) { 1867 log_msg(1, "make_cd_use_lilo = TRUE");1871 mr_msg(1, "make_cd_use_lilo = TRUE"); 1868 1872 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo 1869 1873 // and add ' .' at end 1870 1874 #ifdef __IA64__ 1871 log_msg(1, "IA64 --> elilo");1875 mr_msg(1, "IA64 --> elilo"); 1872 1876 res = eval_call_to_make_ISO(bkpinfo, 1873 1877 //-b images/mindi-boot.2880.img … … 1882 1886 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo 1883 1887 // and add ' .' at end 1884 log_msg(1, "Non-ia64 --> lilo");1888 mr_msg(1, "Non-ia64 --> lilo"); 1885 1889 res = 1886 1890 eval_call_to_make_ISO(bkpinfo, … … 1891 1895 #endif 1892 1896 } else { 1893 log_msg(1, "make_cd_use_lilo = FALSE");1894 log_msg(1, "Isolinux");1897 mr_msg(1, "make_cd_use_lilo = FALSE"); 1898 mr_msg(1, "Isolinux"); 1895 1899 res = 1896 1900 eval_call_to_make_ISO(bkpinfo, … … 1913 1917 || bkpinfo->backup_media_type == cdrw) { 1914 1918 if (is_this_device_mounted(bkpinfo->media_device)) { 1915 log_msg(2,1919 mr_msg(2, 1916 1920 "Warning - %s mounted. I'm unmounting it before I burn to it.", 1917 1921 bkpinfo->media_device); … … 1922 1926 1923 1927 if (bkpinfo->call_burn_iso[0] != '\0') { 1924 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso);1928 mr_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1925 1929 sprintf(message_to_screen, "Burning %s #%d", 1926 1930 media_descriptor_string(bkpinfo->backup_media_type), … … 1959 1963 chdir(old_pwd); 1960 1964 if (retval) { 1961 log_msg(1, "WARNING - make_iso_fs returned an error");1965 mr_msg(1, "WARNING - make_iso_fs returned an error"); 1962 1966 } 1963 1967 mr_free(old_pwd); … … 1987 1991 "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", 1988 1992 bigfile_fname); 1989 log_msg(1, "command = '%s'", command);1993 mr_msg(1, "command = '%s'", command); 1990 1994 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 1991 log_msg(1, "--> tmp = '%s'", tmp);1995 mr_msg(1, "--> tmp = '%s'", tmp); 1992 1996 if (strstr(tmp, "NTFS")) { 1993 1997 iamhere("TRUE"); … … 2050 2054 size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1; 2051 2055 2052 log_msg(1, "size of all biggiefiles = %ld",2056 mr_msg(1, "size of all biggiefiles = %ld", 2053 2057 size_of_all_biggiefiles_K(bkpinfo)); 2054 log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",2058 mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld", 2055 2059 size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size, 2056 2060 estimated_total_noof_slices); 2057 2061 2058 2062 if (length_of_file(biggielist_fname) < 6) { 2059 log_msg(1, "No biggiefiles; fair enough...");2063 mr_msg(1, "No biggiefiles; fair enough..."); 2060 2064 return (0); 2061 2065 } … … 2088 2092 // Call ntfsclone (formerly partimagehack) if it's a /dev entry 2089 2093 // (i.e. a partition to be imaged) 2090 log_msg(2, "bigfile_fname = %s", bigfile_fname);2094 mr_msg(2, "bigfile_fname = %s", bigfile_fname); 2091 2095 use_ntfsprog = FALSE; 2092 2096 if (!strncmp(bigfile_fname, "/dev/", 5) 2093 2097 && is_dev_an_NTFS_dev(bigfile_fname)) { 2094 2098 use_ntfsprog = TRUE; 2095 log_msg(2,2099 mr_msg(2, 2096 2100 "Calling ntfsclone in background because %s is an NTFS partition", 2097 2101 bigfile_fname); … … 2106 2110 fatal_error("Fork failure"); 2107 2111 case 0: 2108 log_msg(2,2112 mr_msg(2, 2109 2113 "CHILD - fip - calling feed_into_ntfsprog(%s, %s)", 2110 2114 bigfile_fname, sz_devfile); … … 2113 2117 break; 2114 2118 default: 2115 log_msg(2,2119 mr_msg(2, 2116 2120 "feed_into_ntfsprog() called in background --- pid=%ld", 2117 2121 (long int) (pid)); … … 2169 2173 #endif 2170 2174 } 2171 log_msg(1, "Finished backing up bigfiles");2172 log_msg(1, "estimated slices = %ld; actual slices = %ld",2175 mr_msg(1, "Finished backing up bigfiles"); 2176 mr_msg(1, "estimated slices = %ld; actual slices = %ld", 2173 2177 estimated_total_noof_slices, g_current_progress); 2174 2178 close_progress_form(); … … 2233 2237 bkpinfo->tmpdir, curr_set_no, bkpinfo->zip_suffix); 2234 2238 2235 log_msg(1, "EXAT'g set %ld", curr_set_no);2239 mr_msg(1, "EXAT'g set %ld", curr_set_no); 2236 2240 if (g_getfattr) { 2237 2241 sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, … … 2245 2249 } 2246 2250 2247 log_msg(1, "Archiving set %ld", curr_set_no);2251 mr_msg(1, "Archiving set %ld", curr_set_no); 2248 2252 res = 2249 2253 archive_this_fileset(bkpinfo, curr_filelist_fname, … … 2349 2353 BLK_START_AFIOBALLS); 2350 2354 #if __FreeBSD__ == 5 2351 log_msg(1,2355 mr_msg(1, 2352 2356 "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0"); 2353 2357 res = make_afioballs_and_images_OLD(bkpinfo); … … 2364 2368 if (res) { 2365 2369 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2366 log_msg(1, "make_afioballs_and_images returned an error");2370 mr_msg(1, "make_afioballs_and_images returned an error"); 2367 2371 } else { 2368 2372 mvaddstr_and_log_it(g_currentY++, 74, "Done."); … … 2415 2419 paranoid_system(command); 2416 2420 sprintf(blah, "biggielist = %s", biggielist); 2417 log_msg(2, blah);2421 mr_msg(2, blah); 2418 2422 2419 2423 if (!does_file_exist(biggielist)) { 2420 log_msg(1, "BTW, the biggielist does not exist");2424 mr_msg(1, "BTW, the biggielist does not exist"); 2421 2425 } 2422 2426 … … 2445 2449 retval += res; 2446 2450 if (res) { 2447 log_msg(1, "make_slices_and_images returned an error");2451 mr_msg(1, "make_slices_and_images returned an error"); 2448 2452 mvaddstr_and_log_it(g_currentY++, 74, "Errors."); 2449 2453 } else { … … 2515 2519 strcpy(curr_file, cf); 2516 2520 if (!does_file_exist(curr_file)) { 2517 log_msg(1,2521 mr_msg(1, 2518 2522 "Warning - you're trying to add a non-existent file - '%s' to the CD", 2519 2523 curr_file); 2520 2524 } else { 2521 log_msg(8, "Trying to add file %s to CD", curr_file);2525 mr_msg(8, "Trying to add file %s to CD", curr_file); 2522 2526 would_occupy += length_of_file(curr_file) / 1024; 2523 2527 } … … 2532 2536 retval += res; 2533 2537 if (res) { 2534 log_msg(1, "WARNING - write_iso_and_go_on returned an error");2538 mr_msg(1, "WARNING - write_iso_and_go_on returned an error"); 2535 2539 } 2536 2540 } … … 2548 2552 retval += res; 2549 2553 if (res) { 2550 log_msg(1, "(move_files_to_cd) '%s' failed", tmp);2554 mr_msg(1, "(move_files_to_cd) '%s' failed", tmp); 2551 2555 } else { 2552 log_msg(8, "Moved %s to CD OK", tmp);2556 mr_msg(8, "Moved %s to CD OK", tmp); 2553 2557 } 2554 2558 // unlink (curr_file); … … 2557 2561 2558 2562 if (retval) { 2559 log_msg(1,2563 mr_msg(1, 2560 2564 "Warning - errors occurred while I was adding files to CD dir"); 2561 2565 } … … 2627 2631 sprintf(bootdisk_dev, "/dev/fd0H1722"); 2628 2632 } else { 2629 log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");2633 mr_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*"); 2630 2634 strcpy(bootdisk_dev, DEFAULT_1722MB_DISK); 2631 2635 // return (1); … … 2633 2637 strcpy(datadisk_dev, "/dev/fd0"); 2634 2638 if (!does_device_exist(datadisk_dev)) { 2635 log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");2639 mr_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*"); 2636 2640 strcpy(datadisk_dev, "/dev/fd0"); 2637 2641 // return (1); … … 2691 2695 } 2692 2696 sprintf(tmp, "cat %s > %s", rootdisk_file, datadisk_dev); 2693 log_msg(1, "tmp = '%s'", tmp);2697 mr_msg(1, "tmp = '%s'", tmp); 2694 2698 res += 2695 2699 run_external_binary_with_percentage_indicator_NEW … … 2707 2711 for (i = 1; i < 99; i++) { 2708 2712 sprintf(tmp, "%s/mindi-data-%d.img", imagesdir, i); 2709 log_msg(3, tmp);2713 mr_msg(3, tmp); 2710 2714 if (!does_file_exist(tmp)) { 2711 log_msg(3, "...not found");2715 mr_msg(3, "...not found"); 2712 2716 break; 2713 2717 } … … 2837 2841 strcpy(curr_file, cf); 2838 2842 if (!does_file_exist(curr_file)) { 2839 log_msg(1,2843 mr_msg(1, 2840 2844 "Warning - you're trying to add a non-existent file - '%s' to the tape", 2841 2845 curr_file); … … 2864 2868 2865 2869 if (retval) { 2866 log_msg(1,2870 mr_msg(1, 2867 2871 "Warning - errors occurred while I was adding file to tape"); 2868 2872 } … … 2907 2911 } else { 2908 2912 cdrecord[0] = '\0'; 2909 log_msg(2, "Oh well. I guess I'll just pray then.");2913 mr_msg(2, "Oh well. I guess I'll just pray then."); 2910 2914 } 2911 2915 if (cdrecord[0]) { … … 2919 2923 ("Unable to examine CD. Are you sure this is a valid CD-R(W) CD?")) 2920 2924 { 2921 log_msg(1, "Well, he insisted...");2925 mr_msg(1, "Well, he insisted..."); 2922 2926 break; 2923 2927 } … … 2990 2994 if (!find_cdrom_device(cdrom_dev, FALSE)) { 2991 2995 /* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird 2992 log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );2996 mr_msg(2, "paafcd: Retracting CD-ROM drive if possible" ); 2993 2997 retract_CD_tray_and_defeat_autorun(); 2994 2998 */ … … 3003 3007 if ((attempt_to_mount_returned_this = 3004 3008 run_program_and_log_output(tmp, 1))) { 3005 log_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt);3009 mr_msg(4, "Failed to mount %s at %s", cdrom_dev, mtpt); 3006 3010 log_to_screen("If there's a CD/DVD in the drive, it's blank."); 3007 3011 /* … … 3031 3035 } 3032 3036 run_program_and_log_output(szunmount, 1); 3033 log_msg(2, "paafcd: cd_number = %d", cd_number);3034 log_msg(2, "our serial str = %s; g_serial_string = %s",3037 mr_msg(2, "paafcd: cd_number = %d", cd_number); 3038 mr_msg(2, "our serial str = %s; g_serial_string = %s", 3035 3039 our_serial_str, g_serial_string); 3036 3040 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 3037 log_msg(2, "This %s is part of this backup set!",3041 mr_msg(2, "This %s is part of this backup set!", 3038 3042 media_descriptor_string(g_backup_media_type)); 3039 3043 ok_go_ahead_burn_it = FALSE; … … 3051 3055 } 3052 3056 } else { 3053 log_msg(2,3057 mr_msg(2, 3054 3058 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 3055 3059 media_descriptor_string(g_backup_media_type)); … … 3079 3083 goto gotos_make_me_puke; 3080 3084 } else { 3081 log_msg(2, "paafcd: OK, going ahead and burning it.");3082 } 3083 3084 log_msg(2,3085 mr_msg(2, "paafcd: OK, going ahead and burning it."); 3086 } 3087 3088 mr_msg(2, 3085 3089 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 3086 3090 media_descriptor_string(g_backup_media_type)); … … 3241 3245 file_to_openin = ntfsprog_fifo; 3242 3246 strcpy(checksum_line, "IGNORE"); 3243 log_msg(2,3247 mr_msg(2, 3244 3248 "Not calculating checksum for %s: it would take too long", 3245 3249 biggie_filename); … … 3283 3287 paranoid_fclose(fout); 3284 3288 length = totallength / optimal_set_size / 1024; 3285 log_msg(1, "Opening in %s; slicing it and writing to CD/tape",3289 mr_msg(1, "Opening in %s; slicing it and writing to CD/tape", 3286 3290 file_to_openin); 3287 3291 if (!(fin = fopen(file_to_openin, "r"))) { … … 3340 3344 { 3341 3345 if (!does_file_exist(curr_slice_fname_uncompressed)) { 3342 log_msg(2,3346 mr_msg(2, 3343 3347 "Warning - '%s' doesn't exist. How can I compress slice?", 3344 3348 curr_slice_fname_uncompressed); … … 3348 3352 bkpinfo->compression_level, 3349 3353 curr_slice_fname_uncompressed); 3350 log_msg(2, command);3354 mr_msg(2, command); 3351 3355 if ((res = system(command))) { 3352 3356 log_OS_error(command); … … 3362 3366 retval += res; 3363 3367 if (res) { 3364 log_msg(2, "Failed to compress the slice");3368 mr_msg(2, "Failed to compress the slice"); 3365 3369 } 3366 3370 if (bkpinfo->use_lzo … … 3382 3386 newtRefresh(); 3383 3387 } else { 3384 log_msg(2, tmp);3388 mr_msg(2, tmp); 3385 3389 } 3386 3390 #else 3387 log_msg(2, tmp);3391 mr_msg(2, tmp); 3388 3392 #endif 3389 3393 strcpy(file_to_archive, curr_slice_fname_compressed); … … 3424 3428 strcat(tmp, "...OK!"); 3425 3429 } 3426 log_msg(1, tmp);3430 mr_msg(1, tmp); 3427 3431 mr_free(tempblock); 3428 3432 mr_free(tmp); … … 3474 3478 sprintf(tmp, "rm -f %s/zero", dir); 3475 3479 run_program_and_log_output(tmp, FALSE); 3476 log_msg(1, "Wiped %s's archives", dir);3480 mr_msg(1, "Wiped %s's archives", dir); 3477 3481 sprintf(tmp, "ls -l %s", dir); 3478 3482 run_program_and_log_output(tmp, FALSE); … … 3511 3515 3512 3516 sprintf(tmp, "Writing the final ISO"); 3513 log_msg(2, tmp);3517 mr_msg(2, tmp); 3514 3518 center_string(tmp, 80); 3515 3519 #ifndef _XWIN … … 3524 3528 } 3525 3529 #endif 3526 log_msg(2, "Returning from writing final ISO (res=%d)", res);3530 mr_msg(2, "Returning from writing final ISO (res=%d)", res); 3527 3531 mr_free(tmp); 3528 3532 return (res); … … 3582 3586 using_nfs = FALSE; 3583 3587 } 3584 log_msg(1, "OK, time to make %s #%d",3588 mr_msg(1, "OK, time to make %s #%d", 3585 3589 media_descriptor_string(bkpinfo->backup_media_type), 3586 3590 g_current_media_number); … … 3596 3600 bkpinfo->scratchdir); 3597 3601 if (run_program_and_log_output(tmp, FALSE)) { 3598 log_msg(2, "Warning - unable to copy autorun to scratchdir");3602 mr_msg(2, "Warning - unable to copy autorun to scratchdir"); 3599 3603 } 3600 3604 … … 3603 3607 if (last_cd) { 3604 3608 unlink(lastcd_fname); 3605 log_msg(2,3609 mr_msg(2, 3606 3610 "OK, you're telling me this is the last CD. Fair enough."); 3607 3611 } else { … … 3636 3640 if (find_cdrom_device(tmp, FALSE)) // make sure find_cdrom_device() finds, records CD-R's loc 3637 3641 { 3638 log_msg(3, "*Sigh* Mike, I hate your computer.");3642 mr_msg(3, "*Sigh* Mike, I hate your computer."); 3639 3643 bkpinfo->manual_cd_tray = TRUE; 3640 3644 } // if it can't be found then force pausing 3641 3645 else { 3642 log_msg(3, "Great. Found Mike's CD-ROM drive.");3646 mr_msg(3, "Great. Found Mike's CD-ROM drive."); 3643 3647 } 3644 3648 } … … 3666 3670 } 3667 3671 } else { 3668 log_msg(2, "Retrying, at user's request...");3672 mr_msg(2, "Retrying, at user's request..."); 3669 3673 res = 0; 3670 3674 } … … 3687 3691 bkpinfo->scratchdir, bkpinfo->scratchdir); 3688 3692 if (system(tmp)) { 3689 log_msg3693 mr_msg 3690 3694 (2, 3691 3695 "Error occurred when I tried to delete the redundant IMGs and GZs"); … … 3693 3697 3694 3698 if (last_cd) { 3695 log_msg(2, "This was your last CD.");3699 mr_msg(2, "This was your last CD."); 3696 3700 } else { 3697 log_msg(2, "Continuing to backup your data...");3701 mr_msg(2, "Continuing to backup your data..."); 3698 3702 } 3699 3703 … … 3742 3746 //bkpinfo->backup_media_type == cdrw || bkpinfo->backup_media_type == cdr)) 3743 3747 { 3744 log_msg(2,3748 mr_msg(2, 3745 3749 "Not verifying again. Per-CD/ISO verification already carried out."); 3746 3750 paranoid_system … … 3754 3758 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3755 3759 if (cdno != g_current_media_number) { 3756 log_msg(2,3760 mr_msg(2, 3757 3761 "Warning - had to change g_current_media_number from %d to %d", 3758 3762 g_current_media_number, cdno); … … 3857 3861 } 3858 3862 sprintf(tmp, "maxblocks = %d; p=%s", maxblocks, p); 3859 log_msg(2, tmp);3863 mr_msg(2, tmp); 3860 3864 /* copy data from image to floppy */ 3861 3865 if (!(fin = fopen(datafile, "r"))) { … … 3871 3875 if (fread(blk, 1, 1024, fin) != 1024) { 3872 3876 if (feof(fin)) { 3873 log_msg(1,3877 mr_msg(1, 3874 3878 "img read err - img ended prematurely - non-fatal error"); 3875 3879 sleep(3); -
branches/stable/mondo/src/common/libmondo-devices.c
r1080 r1107 108 108 strcpy(tmp, where_is_root_mounted()); 109 109 sprintf(comment, "root is mounted at %s\n", tmp); 110 log_msg(0, comment);111 log_msg(0,110 mr_msg(0, comment); 111 mr_msg(0, 112 112 "No, Schlomo, that doesn't mean %s is the root partition. It's just a debugging message. Relax. It's part of am_I_in_disaster_recovery_mode().", 113 113 tmp); … … 141 141 mr_free(tmp); 142 142 mr_free(comment); 143 log_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk);143 mr_msg(1, "Is this a ramdisk? result = %d", is_this_a_ramdisk); 144 144 return (is_this_a_ramdisk); 145 145 } … … 226 226 #endif 227 227 228 log_msg(3, "Ejecting %s", dev);228 mr_msg(3, "Ejecting %s", dev); 229 229 res2 = run_program_and_log_output(command, 1); 230 230 mr_free(command); … … 483 483 } 484 484 if (res) { 485 log_msg(1, "mount failed");486 } else { 487 log_msg(1, "mount succeeded with %s", dev);485 mr_msg(1, "mount failed"); 486 } else { 487 mr_msg(1, "mount succeeded with %s", dev); 488 488 } 489 489 mr_free(dev); … … 521 521 if (g_cdrw_drive_is_here[0]) { 522 522 strcpy(cdrw_device, g_cdrw_drive_is_here); 523 log_msg(3, "Been there, done that. Returning %s", cdrw_device);523 mr_msg(3, "Been there, done that. Returning %s", cdrw_device); 524 524 mr_free(comment); 525 525 mr_free(tmp); … … 529 529 } 530 530 if (g_backup_media_type == dvd) { 531 log_msg(1,531 mr_msg(1, 532 532 "This is dumb. You're calling find_cdrw_device() but you're backing up to DVD. WTF?"); 533 533 mr_free(comment); … … 621 621 if (g_cdrom_drive_is_here[0] && !isdigit(g_cdrom_drive_is_here[0])) { 622 622 strcpy(output, g_cdrom_drive_is_here); 623 log_msg(3, "Been there, done that. Returning %s", output);623 mr_msg(3, "Been there, done that. Returning %s", output); 624 624 retval = 0; 625 625 goto end_of_find_cdrom_device; … … 627 627 if (the_last_place_i_found_it[0] != '\0' && !try_to_mount) { 628 628 strcpy(output, the_last_place_i_found_it); 629 log_msg(3,629 mr_msg(3, 630 630 "find_cdrom_device() --- returning last found location - '%s'", 631 631 output); … … 645 645 if (!find_home_of_exe(cdr_exe)) { 646 646 strcpy(output, "/dev/cdrom"); 647 log_msg(4, "Can't find cdrecord; assuming %s", output);647 mr_msg(4, "Can't find cdrecord; assuming %s", output); 648 648 if (!does_device_exist(output)) { 649 log_msg(4, "That didn't work. Sorry.");649 mr_msg(4, "That didn't work. Sorry."); 650 650 retval = 1; 651 651 goto end_of_find_cdrom_device; … … 659 659 fin = popen(command, "r"); 660 660 if (!fin) { 661 log_msg(4, "command=%s", command);661 mr_msg(4, "command=%s", command); 662 662 log_OS_error("Cannot popen command"); 663 663 return (1); … … 690 690 #ifndef __FreeBSD__ 691 691 if (strlen(phrase_two) == 0) { 692 log_msg(4, "Not running phase two. String is empty.");692 mr_msg(4, "Not running phase two. String is empty."); 693 693 } else { 694 694 sprintf(command, "dmesg | grep \"%s\" 2> /dev/null", phrase_two); 695 695 fin = popen(command, "r"); 696 696 if (!fin) { 697 log_msg(4, "Cannot run 2nd command - non-fatal, fortunately");697 mr_msg(4, "Cannot run 2nd command - non-fatal, fortunately"); 698 698 } else { 699 699 for (fgets(tmp, MAX_STR_LEN, fin); !feof(fin); 700 700 fgets(tmp, MAX_STR_LEN, fin)) { 701 log_msg(5, "--> '%s'", tmp);701 mr_msg(5, "--> '%s'", tmp); 702 702 if (tmp[0] != ' ' && tmp[1] != ' ') { 703 703 p = strchr(tmp, ':'); … … 706 706 if (strstr(tmp, "DVD")) { 707 707 sprintf(dvd_last_resort, "/dev/%s", tmp); 708 log_msg(4,708 mr_msg(4, 709 709 "Ignoring '%s' because it's a DVD drive", 710 710 tmp); … … 723 723 #ifdef __FreeBSD__ 724 724 if (!found_it) { 725 log_msg(4, "OK, approach 2");725 mr_msg(4, "OK, approach 2"); 726 726 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) { 727 727 if (! … … 759 759 #else 760 760 if (!found_it && strlen(dvd_last_resort) > 0) { 761 log_msg(4, "Well, I'll use the DVD - %s - as a last resort",761 mr_msg(4, "Well, I'll use the DVD - %s - as a last resort", 762 762 dvd_last_resort); 763 763 strcpy(output, dvd_last_resort); … … 768 768 strrchr(output, '/') + 1); 769 769 if (system(tmp) == 0) { 770 log_msg(4,770 mr_msg(4, 771 771 "%s is not right. It's being SCSI-emulated. Continuing.", 772 772 output); … … 777 777 778 778 if (found_it) { 779 log_msg(4, "(find_cdrom_device) --> '%s'", output);779 mr_msg(4, "(find_cdrom_device) --> '%s'", output); 780 780 if (!does_device_exist(output)) { 781 781 found_it = FALSE; 782 log_msg(4, "OK, I was wrong, I haven't found it... yet.");782 mr_msg(4, "OK, I was wrong, I haven't found it... yet."); 783 783 } 784 784 } 785 785 786 786 if (!found_it) { 787 log_msg(4, "OK, approach 2");787 mr_msg(4, "OK, approach 2"); 788 788 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/scd0"))) { 789 789 if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/sr0"))) { … … 828 828 if (found_it && try_to_mount) { 829 829 if (mount_CDROM_here(output, mountpoint)) { 830 log_msg(4, "[Cardigans] I've changed my mind");830 mr_msg(4, "[Cardigans] I've changed my mind"); 831 831 found_it = FALSE; 832 832 } else { 833 833 sprintf(tmp, "%s/archives", mountpoint); 834 834 if (!does_file_exist(tmp)) { 835 log_msg(4, "[Cardigans] I'll take it back");835 mr_msg(4, "[Cardigans] I'll take it back"); 836 836 found_it = FALSE; 837 837 } else { 838 838 sprintf(command, "umount %s", output); 839 839 paranoid_system(command); 840 log_msg(4, "I'm confident the Mondo CD is in %s", output);840 mr_msg(4, "I'm confident the Mondo CD is in %s", output); 841 841 } 842 842 } … … 846 846 if (found_it) { 847 847 if (!does_file_exist(output)) { 848 log_msg(3, "I still haven't found it.");848 mr_msg(3, "I still haven't found it."); 849 849 return (1); 850 850 } 851 log_msg(3, "(find_cdrom_device) --> '%s'", output);851 mr_msg(3, "(find_cdrom_device) --> '%s'", output); 852 852 strcpy(the_last_place_i_found_it, output); 853 853 strcpy(g_cdrom_drive_is_here, output); … … 859 859 "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", 860 860 cdr_exe, g_cdrw_drive_is_here); 861 log_msg(1, "command=%s", command);861 mr_msg(1, "command=%s", command); 862 862 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 863 863 if (tmp[0]) { 864 864 strcpy(output, tmp); 865 log_msg(4, "Finally found it at %s", output);865 mr_msg(4, "Finally found it at %s", output); 866 866 retval = 0; 867 867 goto end_of_find_cdrom_device; 868 868 } else { 869 log_msg(4, "Still couldn't find it.");869 mr_msg(4, "Still couldn't find it."); 870 870 retval = 1; 871 871 goto end_of_find_cdrom_device; … … 897 897 if (g_dvd_drive_is_here[0]) { 898 898 strcpy(output, g_dvd_drive_is_here); 899 log_msg(3, "Been there, done that. Returning %s", output);899 mr_msg(3, "Been there, done that. Returning %s", output); 900 900 return (0); 901 901 } … … 904 904 ("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1") 905 905 ); 906 log_msg(5, "tmp = '%s'", tmp);906 mr_msg(5, "tmp = '%s'", tmp); 907 907 if (!tmp[0]) 908 908 sprintf(tmp, call_program_and_get_last_line_of_output … … 916 916 sprintf(output, "/dev/scd%d", devno); 917 917 strcpy(g_dvd_drive_is_here, output); 918 log_msg(2, "I think DVD is at %s", output);919 } else { 920 log_msg(2, "I cannot find DVD");918 mr_msg(2, "I think DVD is at %s", output); 919 } else { 920 mr_msg(2, "I cannot find DVD"); 921 921 retval = 1; 922 922 } 923 923 924 924 if (try_to_mount) { 925 log_msg(1, "Ignoring the fact that try_to_mount==TRUE");925 mr_msg(1, "Ignoring the fact that try_to_mount==TRUE"); 926 926 } 927 927 return (retval); … … 988 988 989 989 if (outvalB <= 0) { 990 log_msg(1, "Error getting size of %s: %s", drive, strerror(errno));990 mr_msg(1, "Error getting size of %s: %s", drive, strerror(errno)); 991 991 #if linux 992 992 fileid = open(drive, O_RDONLY); … … 997 997 cylindersize = hdgeo.heads * hdgeo.sectors / 2; 998 998 outvalA = cylindersize * cylinders / 1024; 999 log_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d",999 mr_msg(2, "Got Harddisk geometry, C:%d, H:%d, S:%d", 1000 1000 hdgeo.cylinders, hdgeo.heads, hdgeo.sectors); 1001 1001 gotgeo = 1; 1002 1002 } else { 1003 log_msg(1, "Harddisk geometry wrong");1003 mr_msg(1, "Harddisk geometry wrong"); 1004 1004 } 1005 1005 } else { 1006 log_msg(1,1006 mr_msg(1, 1007 1007 "Error in ioctl() getting new hard disk geometry (%s), resizing in unsafe mode", 1008 1008 strerror(errno)); … … 1010 1010 close(fileid); 1011 1011 } else { 1012 log_msg(1, "Failed to open %s for reading: %s", drive,1012 mr_msg(1, "Failed to open %s for reading: %s", drive, 1013 1013 strerror(errno)); 1014 1014 } 1015 1015 if (!gotgeo) { 1016 log_msg(1, "Failed to get harddisk geometry, using old mode");1016 mr_msg(1, "Failed to get harddisk geometry, using old mode"); 1017 1017 } 1018 1018 /* … … 1020 1020 if (ioctl (fd, HDIO_GETGEO, &hdgeo) != -1) { 1021 1021 close (fd); 1022 log_msg (2, "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB", drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors, (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024));1022 mr_msg (2, "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB", drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors, (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024)); 1023 1023 if ( hdgeo.cylinders && hdgeo.heads && hdgeo.sectors ) { 1024 1024 outvalB = ((long) (hdgeo.cylinders * hdgeo.heads * hdgeo.sectors / 2 / 1024)); … … 1034 1034 outvalC = (outvalA > outvalB) ? outvalA : outvalB; 1035 1035 1036 // log_msg (5, "drive = %s, error = %s", drive, strerror (errno));1036 // mr_msg (5, "drive = %s, error = %s", drive, strerror (errno)); 1037 1037 // fatal_error ("GPSOD: Unable to get size of drive"); 1038 log_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB,1038 mr_msg(1, "%s --> %ld or %ld --> %ld", drive, outvalA, outvalB, 1039 1039 outvalC); 1040 1040 … … 1077 1077 close(fd); 1078 1078 } 1079 log_msg(4, "drive = %s, error = %s", drive, strerror(errno));1079 mr_msg(4, "drive = %s, error = %s", drive, strerror(errno)); 1080 1080 fatal_error("GPSOD: Unable to get size of drive"); 1081 1081 #else … … 1087 1087 if (ioctl(fd, HDIO_GETGEO, &hdgeo) != -1) { 1088 1088 close(fd); 1089 log_msg(2,1089 mr_msg(2, 1090 1090 "Geometry of drive %s is C:%d, H:%d, S%d, its size is %d MB", 1091 1091 drive, hdgeo.cylinders, hdgeo.heads, hdgeo.sectors, … … 1161 1161 } 1162 1162 if (!(p = strstr(tmp, "GB")) && !(p = strstr(tmp, "MB"))) { 1163 log_msg(3, "Cannot find %s's size: dmesg isn't helping either.",1163 mr_msg(3, "Cannot find %s's size: dmesg isn't helping either.", 1164 1164 drive); 1165 1165 mr_free(tmp); … … 1280 1280 // assert_string_is_neither_NULL_nor_zerolength(device_raw); 1281 1281 if (device_raw[0] != '/' && !strstr(device_raw, ":/")) { 1282 log_msg(1, "%s needs to have a '/' prefixed - I'll do it",1282 mr_msg(1, "%s needs to have a '/' prefixed - I'll do it", 1283 1283 device_raw); 1284 1284 sprintf(tmp, "/%s", device_raw); … … 1286 1286 strcpy(tmp, device_raw); 1287 1287 } 1288 log_msg(1, "Is %s mounted?", tmp);1288 mr_msg(1, "Is %s mounted?", tmp); 1289 1289 if (!strcmp(tmp, "/proc") || !strcmp(tmp, "proc")) { 1290 log_msg(1,1290 mr_msg(1, 1291 1291 "I don't know how the heck /proc made it into the mountlist. I'll ignore it."); 1292 1292 return (0); … … 1312 1312 sprintf(tmp, "%s | grep -E \"^%s\" > /dev/null 2> /dev/null", 1313 1313 SWAPLIST_COMMAND, device_with_space); 1314 log_msg(4, "tmp (command) = '%s'", tmp);1314 mr_msg(4, "tmp (command) = '%s'", tmp); 1315 1315 if (!system(tmp)) { 1316 1316 retval = 1; … … 1434 1434 1435 1435 } 1436 log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,1436 mr_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device, 1437 1437 mountpoint); 1438 1438 /*@ end vars *************************************************** */ … … 1447 1447 #endif 1448 1448 1449 log_msg(4, command);1449 mr_msg(4, command); 1450 1450 if (strncmp(device, "/dev/", 5) == 0) { 1451 1451 retract_CD_tray_and_defeat_autorun(); 1452 1452 } 1453 1453 retval = system(command); 1454 log_msg(1, "system(%s) returned %d", command, retval);1454 mr_msg(1, "system(%s) returned %d", command, retval); 1455 1455 1456 1456 mr_free(command); … … 1491 1491 assert(cd_number_i_want > 0); 1492 1492 1493 // log_msg(3, "Insisting on CD number %d", cd_number_i_want);1493 // mr_msg(3, "Insisting on CD number %d", cd_number_i_want); 1494 1494 1495 1495 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1496 log_msg(3,1496 mr_msg(3, 1497 1497 "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO"); 1498 1498 return; … … 1504 1504 if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso 1505 1505 || bkpinfo->backup_media_type == nfs) { 1506 log_msg(3, "Remounting CD");1506 mr_msg(3, "Remounting CD"); 1507 1507 g_ISO_restore_mode = TRUE; 1508 1508 // FIXME --- I'm tempted to do something about this... … … 1520 1520 cd_number_i_want); 1521 1521 if (does_file_exist(tmp)) { 1522 log_msg(1,1522 mr_msg(1, 1523 1523 "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir", 1524 1524 bkpinfo->isodir); … … 1526 1526 } 1527 1527 } 1528 log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);1528 mr_msg(3, "Mounting %s at %s", tmp, MNT_CDROM); 1529 1529 if (mount_CDROM_here(tmp, MNT_CDROM)) { 1530 1530 fatal_error("Mommy!"); … … 1534 1534 } 1535 1535 if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) { 1536 log_msg(3, "Currently, we hold %d but we want %d", res,1536 mr_msg(3, "Currently, we hold %d but we want %d", res, 1537 1537 cd_number_i_want); 1538 1538 sprintf(tmp, "Insisting on %s #%d", … … 1542 1542 media_descriptor_string(bkpinfo->backup_media_type), 1543 1543 cd_number_i_want); 1544 log_msg(3, tmp);1544 mr_msg(3, tmp); 1545 1545 while (what_number_cd_is_this(bkpinfo) != cd_number_i_want) { 1546 1546 paranoid_system("sync"); … … 1568 1568 paranoid_system("sync"); 1569 1569 } 1570 log_msg(1, "Thankyou. Proceeding...");1570 mr_msg(1, "Thankyou. Proceeding..."); 1571 1571 g_current_media_number = cd_number_i_want; 1572 1572 } … … 1627 1627 popup_and_OK("Please remove CD/floppy from drive(s)"); 1628 1628 } 1629 log_msg(3, "media type = %s",1629 mr_msg(3, "media type = %s", 1630 1630 bkptype_to_string(bkpinfo->backup_media_type)); 1631 1631 if (archiving_to_media) { … … 1664 1664 strcpy(tmp, "1"); 1665 1665 sprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 1666 log_msg(1, "Setting to DVD defaults");1666 mr_msg(1, "Setting to DVD defaults"); 1667 1667 } else if (bkpinfo->backup_media_type == usb) { 1668 1668 strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE); … … 1672 1672 strcpy(tmp, "4"); 1673 1673 strcpy(sz_size, "650"); 1674 log_msg(1, "Setting to CD defaults");1674 mr_msg(1, "Setting to CD defaults"); 1675 1675 } 1676 1676 if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) { … … 1699 1699 if (bkpinfo->disaster_recovery) { 1700 1700 strcpy(bkpinfo->media_device, "/dev/cdrom"); 1701 log_msg(2, "CD-ROM device assumed to be at %s",1701 mr_msg(2, "CD-ROM device assumed to be at %s", 1702 1702 bkpinfo->media_device); 1703 1703 } else if (bkpinfo->restore_data … … 1706 1706 strcpy(bkpinfo->media_device, "/dev/cdrom"); 1707 1707 } // just for the heck of it :) 1708 log_msg(1, "bkpinfo->media_device = %s",1708 mr_msg(1, "bkpinfo->media_device = %s", 1709 1709 bkpinfo->media_device); 1710 1710 if (bkpinfo->backup_media_type == dvd 1711 1711 || find_cdrom_device(bkpinfo->media_device, FALSE)) { 1712 log_msg(1, "bkpinfo->media_device = %s",1712 mr_msg(1, "bkpinfo->media_device = %s", 1713 1713 bkpinfo->media_device); 1714 1714 sprintf(comment, … … 1723 1723 } 1724 1724 } 1725 log_msg(2, "%s device found at %s",1725 mr_msg(2, "%s device found at %s", 1726 1726 media_descriptor_string(bkpinfo->backup_media_type), 1727 1727 bkpinfo->media_device); … … 1773 1773 1774 1774 if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) { 1775 log_msg(3, "Ok, using vanilla scsi tape.");1775 mr_msg(3, "Ok, using vanilla scsi tape."); 1776 1776 strcpy(bkpinfo->media_device, VANILLA_SCSI_TAPE); 1777 1777 if ((fin = fopen(bkpinfo->media_device, "r"))) { … … 1816 1816 finish(1); 1817 1817 } 1818 log_msg(4, "sz_size = %s", sz_size);1818 mr_msg(4, "sz_size = %s", sz_size); 1819 1819 sz_size[0] = '\0'; 1820 1820 /* … … 1831 1831 friendly_sizestr_to_sizelong(sz_size) / 2 - 50; 1832 1832 } 1833 log_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);1833 mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]); 1834 1834 if (bkpinfo->media_size[0] <= 0) { 1835 1835 bkpinfo->media_size[0] = 0; … … 1959 1959 finish(1); 1960 1960 } 1961 log_msg(3, "prefix set to %s", bkpinfo->prefix);1961 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 1962 1962 1963 1963 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { 1964 1964 bkpinfo->media_size[i] = 650; 1965 1965 } 1966 log_msg(3, "Just set nfs_remote_dir to %s",1966 mr_msg(3, "Just set nfs_remote_dir to %s", 1967 1967 bkpinfo->nfs_remote_dir); 1968 log_msg(3, "isodir is still %s", bkpinfo->isodir);1968 mr_msg(3, "isodir is still %s", bkpinfo->isodir); 1969 1969 break; 1970 1970 … … 2007 2007 finish(1); 2008 2008 } 2009 log_msg(3, "prefix set to %s", bkpinfo->prefix);2009 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 2010 2010 break; 2011 2011 default: … … 2146 2146 bkpinfo->nfs_mount); 2147 2147 // strcpy(bkpinfo->isodir, call_program_and_get_last_line_of_output(tmp)); 2148 log_msg(3, "I think the NFS mount is mounted at %s",2148 mr_msg(3, "I think the NFS mount is mounted at %s", 2149 2149 bkpinfo->isodir); 2150 2150 } … … 2169 2169 fatal_error("Media size is less than zero."); 2170 2170 } else { 2171 log_msg(2, "Warning - media size is less than zero.");2171 mr_msg(2, "Warning - media size is less than zero."); 2172 2172 bkpinfo->media_size[0] = 0; 2173 2173 } … … 2354 2354 } 2355 2355 // assert_string_is_neither_NULL_nor_zerolength(dev); 2356 log_msg(10, "Injecting %s", dev);2356 mr_msg(10, "Injecting %s", dev); 2357 2357 inject_device(dev); 2358 2358 if (!does_file_exist(dev)) { 2359 log_msg(10, "%s doesn't exist. Returning FALSE.", dev);2359 mr_msg(10, "%s doesn't exist. Returning FALSE.", dev); 2360 2360 return (FALSE); 2361 2361 } … … 2365 2365 && !run_program_and_log_output(command, FALSE)) { 2366 2366 strcpy(output, dev); 2367 log_msg(4, "Found it - %s", dev);2367 mr_msg(4, "Found it - %s", dev); 2368 2368 return (TRUE); 2369 2369 } else { 2370 2370 output[0] = '\0'; 2371 log_msg(4, "It's not %s", dev);2371 mr_msg(4, "It's not %s", dev); 2372 2372 return (FALSE); 2373 2373 } … … 2646 2646 lstat(curr_fname, &statbuf); 2647 2647 while (S_ISLNK(statbuf.st_mode)) { 2648 log_msg(1, "curr_fname = %s", curr_fname);2648 mr_msg(1, "curr_fname = %s", curr_fname); 2649 2649 sprintf(command, "file %s", curr_fname); 2650 2650 strcpy(tmp, call_program_and_get_last_line_of_output(command)); … … 2655 2655 for (p = scratch; *p != '\0' && *p != '\''; p++); 2656 2656 *p = '\0'; 2657 log_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp,2657 mr_msg(0, "curr_fname %s --> '%s' --> %s", curr_fname, tmp, 2658 2658 scratch); 2659 2659 if (scratch[0] == '/') { … … 2698 2698 malloc_string(command); 2699 2699 malloc_string(fdisk); 2700 log_msg(0, "Looking for partition table format type");2700 mr_msg(0, "Looking for partition table format type"); 2701 2701 sprintf(fdisk, "/sbin/parted2fdisk"); 2702 log_msg(1, "Using %s", fdisk);2702 mr_msg(1, "Using %s", fdisk); 2703 2703 sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive); 2704 2704 strcpy(tmp, call_program_and_get_last_line_of_output(command)); … … 2708 2708 strcpy(output, "GPT"); 2709 2709 } 2710 log_msg(0, "Found %s partition table format type", output);2710 mr_msg(0, "Found %s partition table format type", output); 2711 2711 mr_free(command); 2712 2712 mr_free(tmp); -
branches/stable/mondo/src/common/libmondo-fifo.c
r1080 r1107 122 122 internal_tape_block_size, keych, device); 123 123 } 124 log_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);124 mr_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer); 125 125 fres = popen(g_sz_call_to_buffer, sz_dir); 126 126 if (fres) { 127 log_msg(2, "Successfully opened ('%c') tape device %s", direction,127 mr_msg(2, "Successfully opened ('%c') tape device %s", direction, 128 128 device); 129 129 } else { 130 log_msg(2, "Failed to open ('%c') tape device %s", direction,130 mr_msg(2, "Failed to open ('%c') tape device %s", direction, 131 131 device); 132 132 } … … 134 134 sprintf(tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer); 135 135 if (run_program_and_log_output(tmp, 2)) { 136 log_msg(2, "Warning - I think I failed to open tape, actually.");136 mr_msg(2, "Warning - I think I failed to open tape, actually."); 137 137 } 138 138 g_tape_buffer_size_MB = bufsize; … … 172 172 sprintf(command, 173 173 "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer); 174 log_msg(2, "kill_buffer() --- command = %s", command);174 mr_msg(2, "kill_buffer() --- command = %s", command); 175 175 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 176 176 sprintf(command, "kill %s", tmp); 177 log_msg(2, "kill_buffer() --- command = %s", command);177 mr_msg(2, "kill_buffer() --- command = %s", command); 178 178 if (strlen(tmp) > 0) { 179 179 run_program_and_log_output(command, TRUE); -
branches/stable/mondo/src/common/libmondo-filelist.c
r1103 r1107 165 165 int retval = 0; 166 166 167 log_msg(1, "Sorting file %s", orig_fname);167 mr_msg(1, "Sorting file %s", orig_fname); 168 168 malloc_string(tmp_fname); 169 169 malloc_string(command); … … 179 179 retval = system(command); 180 180 if (retval) { 181 log_msg(2, "Failed to sort %s - oh dear", orig_fname);181 mr_msg(2, "Failed to sort %s - oh dear", orig_fname); 182 182 } else { 183 log_msg(2, "Sorted %s --> %s OK. Copying it back to %s now",183 mr_msg(2, "Sorted %s --> %s OK. Copying it back to %s now", 184 184 orig_fname, tmp_fname, orig_fname); 185 185 sprintf(command, "mv -f %s %s", tmp_fname, orig_fname); 186 186 retval += run_program_and_log_output(command, 2); 187 187 if (retval) { 188 log_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname,188 mr_msg(2, "Failed to copy %s back to %s - oh dear", tmp_fname, 189 189 orig_fname); 190 190 } else { 191 log_msg(2, "%s was sorted OK.", orig_fname);191 mr_msg(2, "%s was sorted OK.", orig_fname); 192 192 } 193 193 } 194 194 mr_free(tmp_fname); 195 195 mr_free(command); 196 log_msg(1, "Finished sorting file %s", orig_fname);196 mr_msg(1, "Finished sorting file %s", orig_fname); 197 197 return (retval); 198 198 } … … 289 289 if (i > MAX_STR_LEN - 1) { 290 290 incoming[MAX_STR_LEN - 30] = '\0'; 291 log_msg(1, "Warning - truncating file %s's name", incoming);291 mr_msg(1, "Warning - truncating file %s's name", incoming); 292 292 err++; 293 293 } … … 350 350 sprintf(tmp, "Filelist divided into %ld sets", curr_set_no + 1); 351 351 } 352 log_msg(1, tmp);352 mr_msg(1, tmp); 353 353 close_evalcall_form(); 354 354 /* This is to work around an obscure bug in Newt; open a form, close it, … … 435 435 pattr = popen(sys_call, "r"); 436 436 if (!pattr) { 437 log_msg(1, "Failed to open fattr() %s", sys_call);437 mr_msg(1, "Failed to open fattr() %s", sys_call); 438 438 return (1); 439 439 } 440 440 if (feof(pattr)) { 441 log_msg(1, "Failed to call fattr() %s", sys_call);441 mr_msg(1, "Failed to call fattr() %s", sys_call); 442 442 paranoid_pclose(pattr); 443 443 return (2); … … 467 467 468 468 if (!(fin = fopen(filelist, "r"))) { 469 log_msg(1, "Cannot openin filelist %s", filelist);469 mr_msg(1, "Cannot openin filelist %s", filelist); 470 470 return (1); 471 471 } … … 473 473 sprintf(pout_command, "gzip -c1 > %s", auxlist_fname); 474 474 if (!(pout = popen(pout_command, "w"))) { 475 log_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname);475 mr_msg(1, "Cannot openout auxlist_fname %s", auxlist_fname); 476 476 fclose(fin); 477 477 mr_free(pout_command); … … 485 485 file_to_analyze[i - 1] = '\0'; 486 486 } 487 log_msg(8, "Analyzing %s", file_to_analyze);487 mr_msg(8, "Analyzing %s", file_to_analyze); 488 488 asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\')); 489 489 asprintf(&sys_call, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE); … … 552 552 553 553 malloc_string(command); 554 log_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist,554 mr_msg(1, "set_EXAT_list(%s, %s, %s)", orig_msklist, 555 555 original_exat_fname, executable); 556 556 if (!orig_msklist || !orig_msklist[0] 557 557 || !does_file_exist(orig_msklist)) { 558 log_msg(1,558 mr_msg(1, 559 559 "No masklist provided. I shall therefore set ALL attributes."); 560 560 sprintf(command, "gzip -dc %s | %s --restore - 2>> %s", 561 561 original_exat_fname, executable, MONDO_LOGFILE); 562 log_msg(1, "command = %s", command);562 mr_msg(1, "command = %s", command); 563 563 retval = system(command); 564 564 mr_free(command); 565 log_msg(1, "Returning w/ retval=%d", retval);565 mr_msg(1, "Returning w/ retval=%d", retval); 566 566 return (retval); 567 567 } 568 568 if (length_of_file(original_exat_fname) <= 0) { 569 log_msg(1,569 mr_msg(1, 570 570 "original_exat_fname %s is empty or missing, so no need to set EXAT list", 571 571 original_exat_fname); … … 589 589 MONDO_LOGFILE); 590 590 591 log_msg(1, "syscall_pin = %s", syscall_pin);592 log_msg(1, "syscall_pout = %s", syscall_pout);591 mr_msg(1, "syscall_pin = %s", syscall_pin); 592 mr_msg(1, "syscall_pout = %s", syscall_pout); 593 593 pout = popen(syscall_pout, "w"); 594 594 if (!pout) { … … 638 638 639 639 i = strcmp(p, q); 640 log_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i);640 mr_msg(my_depth, "'%s' v '%s' --> %d\n", p, q, i); 641 641 642 642 // printf("%s v %s --> %d\n", p, q, i); 643 643 644 644 if (i < 0) { // read another subset file in. 645 log_msg(my_depth, "Reading next subset line in\n\n");645 mr_msg(my_depth, "Reading next subset line in\n\n"); 646 646 fgets(current_subset_file, MAX_STR_LEN, faclin); 647 647 continue; … … 653 653 fgets(incoming, MAX_STR_LEN, pin); 654 654 if (!i) { 655 log_msg(my_depth, "Copying master %s", q);655 mr_msg(my_depth, "Copying master %s", q); 656 656 } 657 657 // if (!i) { printf("Match --- %s\n", q); } … … 696 696 return (set_EXAT_list(masklist, fattr_fname, "setfattr")); 697 697 } else { 698 log_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");698 mr_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist"); 699 699 return(0); 700 700 } … … 708 708 return (set_EXAT_list(masklist, acl_fname, "setfacl")); 709 709 } else { 710 log_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");710 mr_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist"); 711 711 return(0); 712 712 } … … 786 786 char_to_add = string_to_add[0]; 787 787 if (node->right != NULL && node->ch < char_to_add) { 788 log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,788 mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth, 789 789 char_to_add, node->ch, (node->right)->ch); 790 790 return (add_string_at_node(node->right, string_to_add)); … … 793 793 /* walk down tree if appropriate */ 794 794 if (node->down != NULL && node->ch == char_to_add) { 795 log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add);795 mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_add); 796 796 depth++; 797 797 res = add_string_at_node(node->down, string_to_add + 1); … … 801 801 802 802 if (char_to_add == '\0' && node->ch == '\0') { 803 log_msg(6, "%s already in tree", original_string);803 mr_msg(6, "%s already in tree", original_string); 804 804 return (1); 805 805 } … … 809 809 if (char_to_add < node->ch) // add to the left of node 810 810 { 811 log_msg(7, "depth=%d char=%c --- adding (left)", depth,811 mr_msg(7, "depth=%d char=%c --- adding (left)", depth, 812 812 char_to_add); 813 813 memcpy((void *) newnode, (void *) node, sizeof(struct s_node)); … … 815 815 } else if (char_to_add > node->ch) // add to the right of node 816 816 { 817 log_msg(7, "depth=%d char=%c --- adding (right)", depth,817 mr_msg(7, "depth=%d char=%c --- adding (right)", depth, 818 818 char_to_add); 819 819 newnode->right = node->right; // newnode is to the RIGHT of node … … 826 826 node->expanded = node->selected = FALSE; 827 827 if (char_to_add == '\0') { 828 log_msg(6, "Added %s OK", original_string);828 mr_msg(6, "Added %s OK", original_string); 829 829 return (0); 830 830 } 831 831 // add the rest 832 log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);832 mr_msg(6, "Adding remaining chars ('%s')", string_to_add + 1); 833 833 for (i = 1; i < noof_chars; i++) { 834 834 node->down = (struct s_node *) mr_malloc(sizeof(struct s_node)); 835 835 node = node->down; 836 836 char_to_add = string_to_add[i]; 837 log_msg(6, "Adding '%c'", char_to_add);837 mr_msg(6, "Adding '%c'", char_to_add); 838 838 node->ch = char_to_add; 839 839 node->right = node->down = NULL; … … 843 843 } 844 844 } 845 log_msg(6, "Finally - added %s OK", original_string);845 mr_msg(6, "Finally - added %s OK", original_string); 846 846 return (0); 847 847 } … … 886 886 sprintf(command_to_open_fname, "gzip -dc %s", filelist_fname); 887 887 sprintf(tmp, "zcat %s | wc -l", filelist_fname); 888 log_msg(6, "tmp = %s", tmp);888 mr_msg(6, "tmp = %s", tmp); 889 889 lines_in_filelist = 890 890 atol(call_program_and_get_last_line_of_output(tmp)); … … 949 949 950 950 if (depth == 0) { 951 log_msg(0, "----------------show filelist--------------");951 mr_msg(0, "----------------show filelist--------------"); 952 952 } 953 953 current_string[depth] = node->ch; 954 954 955 log_msg(3, "depth=%d", depth);955 mr_msg(3, "depth=%d", depth); 956 956 if (node->down) { 957 log_msg(3, "moving down");957 mr_msg(3, "moving down"); 958 958 depth++; 959 959 show_filelist(node->down); … … 962 962 963 963 if (!node->ch) { 964 log_msg(0, "%s\n", current_string);964 mr_msg(0, "%s\n", current_string); 965 965 } 966 966 967 967 if (node->right) { 968 log_msg(3, "moving right");968 mr_msg(3, "moving right"); 969 969 show_filelist(node->right); 970 970 } 971 971 if (depth == 0) { 972 log_msg(0, "----------------show filelist--------------");972 mr_msg(0, "----------------show filelist--------------"); 973 973 } 974 974 return; … … 1031 1031 for (node = filelist; node != NULL; node = node->right) { 1032 1032 str[depth] = node->ch; 1033 log_msg(5, "depth=%d ch=%c", depth, node->ch);1033 mr_msg(5, "depth=%d ch=%c", depth, node->ch); 1034 1034 if (!node->ch) { 1035 1035 // if (node->selected) … … 1403 1403 #endif 1404 1404 mr_free(find_excludes); 1405 log_msg(5, "find command = %s", strtmp);1405 mr_msg(5, "find command = %s", strtmp); 1406 1406 system(strtmp); 1407 1407 mr_free(strtmp); … … 1413 1413 find_skeleton_marker[0] = '\0'; 1414 1414 skeleton_lino = 1; 1415 log_msg(5, "entries = %ld", g_skeleton_entries);1415 mr_msg(5, "entries = %ld", g_skeleton_entries); 1416 1416 percentage = 0; 1417 1417 } else if (depth <= MAX_SKEL_DEPTH) // update evalcall form if appropriate … … 1420 1420 "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir, 1421 1421 g_skeleton_filelist, g_skeleton_filelist); 1422 // log_msg(0, "fsm = %s", find_skeleton_marker);1422 // mr_msg(0, "fsm = %s", find_skeleton_marker); 1423 1423 if (!system(find_skeleton_marker)) { 1424 1424 percentage = (int) (skeleton_lino * 100 / g_skeleton_entries); 1425 1425 skeleton_lino++; 1426 // log_msg(5, "Found %s", dir);1427 // log_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage);1426 // mr_msg(5, "Found %s", dir); 1427 // mr_msg(2, "Incrementing skeleton_lino; now %ld/%ld (%d%%)", skeleton_lino, g_skeleton_entries, percentage); 1428 1428 sprintf(find_skeleton_marker, "mv -f %s.new %s", 1429 1429 g_skeleton_filelist, g_skeleton_filelist); 1430 // log_msg(6, "fsm = %s", find_skeleton_marker);1430 // mr_msg(6, "fsm = %s", find_skeleton_marker); 1431 1431 run_program_and_log_output(find_skeleton_marker, 8); 1432 1432 time(&this_time); … … 1446 1446 depth++; 1447 1447 1448 // log_msg(0, "Cataloguing %s", dir);1448 // mr_msg(0, "Cataloguing %s", dir); 1449 1449 if (sth[0] == ' ') { 1450 1450 skip_these = sth; … … 1513 1513 mr_free(find_skeleton_marker); 1514 1514 unlink(g_skeleton_filelist); 1515 log_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries);1515 mr_msg(5, "g_skeleton_entries = %ld", g_skeleton_entries); 1516 1516 } 1517 1517 mr_free(tmp); … … 1584 1584 malloc_string(g_skeleton_filelist); 1585 1585 exclude_paths = mr_malloc(1000); 1586 log_msg(3, "Trying to write test string to exclude_paths");1586 mr_msg(3, "Trying to write test string to exclude_paths"); 1587 1587 strcpy(exclude_paths, "/blah /froo"); 1588 log_msg(3, "...Success!");1588 mr_msg(3, "...Success!"); 1589 1589 sprintf(sz_datefile, sz_datefile_wildcard, 0); 1590 1590 if (!include_paths && !userdef_filelist) { … … 1613 1613 ("date +%s")); 1614 1614 } else if (lstat(sz_datefile, &statbuf)) { 1615 log_msg(2,1615 mr_msg(2, 1616 1616 "Warning - unable to find date of previous backup. Full backup instead."); 1617 1617 differential = 0; … … 1619 1619 } else { 1620 1620 time_of_last_full_backup = statbuf.st_mtime; 1621 log_msg(2, "Differential backup. Yay.");1621 mr_msg(2, "Differential backup. Yay."); 1622 1622 } 1623 1623 1624 1624 // use user-specified filelist (if specified) 1625 1625 if (userdef_filelist) { 1626 log_msg(1,1626 mr_msg(1, 1627 1627 "Using the user-specified filelist - %s - instead of calculating one", 1628 1628 userdef_filelist); … … 1632 1632 } 1633 1633 } else { 1634 log_msg(2, "include_paths = '%s'", include_paths);1635 log_msg(1, "Calculating filelist");1634 mr_msg(2, "include_paths = '%s'", include_paths); 1635 mr_msg(1, "Calculating filelist"); 1636 1636 sprintf(exclude_paths, " %s %s %s %s %s %s . .. \ 1637 1637 " MNT_CDROM " " MNT_FLOPPY " /media \ 1638 1638 /proc /sys /tmp /root/images/mondo /var/cache/mindi ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1639 1639 1640 log_msg(2, "Excluding paths = '%s'", exclude_paths);1641 log_msg(2,1640 mr_msg(2, "Excluding paths = '%s'", exclude_paths); 1641 mr_msg(2, 1642 1642 "Generating skeleton filelist so that we can track our progress"); 1643 1643 sprintf(g_skeleton_filelist, "%s/tmpfs/skeleton.txt", tmpdir); 1644 1644 make_hole_for_file(g_skeleton_filelist); 1645 log_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries);1646 log_msg(2, "Opening out filelist to %s", sz_filelist);1645 mr_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries); 1646 mr_msg(2, "Opening out filelist to %s", sz_filelist); 1647 1647 if (!(fout = fopen(sz_filelist, "w"))) { 1648 1648 fatal_error("Cannot openout to sz_filelist"); … … 1650 1650 i = 0; 1651 1651 if (strlen(include_paths) == 0) { 1652 log_msg(1, "Including only '/' in %s", sz_filelist);1652 mr_msg(1, "Including only '/' in %s", sz_filelist); 1653 1653 open_and_list_dir("/", exclude_paths, fout, 1654 1654 time_of_last_full_backup); … … 1657 1657 while (*p) { 1658 1658 q = next_entry(p); 1659 log_msg(1, "Including %s in filelist %s", q, sz_filelist);1659 mr_msg(1, "Including %s in filelist %s", q, sz_filelist); 1660 1660 open_and_list_dir(q, exclude_paths, fout, 1661 1661 time_of_last_full_backup); … … 1668 1668 paranoid_fclose(fout); 1669 1669 } 1670 log_msg(2, "Copying new filelist to scratchdir");1670 mr_msg(2, "Copying new filelist to scratchdir"); 1671 1671 sprintf(command, "mkdir -p %s/archives", scratchdir); 1672 1672 paranoid_system(command); … … 1675 1675 sprintf(command, "mv -f %s %s", sz_filelist, tmpdir); 1676 1676 paranoid_system(command); 1677 log_msg(2, "Freeing variables");1677 mr_msg(2, "Freeing variables"); 1678 1678 mr_free(sz_filelist); 1679 1679 mr_free(command); … … 1681 1681 mr_free(tmp); 1682 1682 mr_free(g_skeleton_filelist); 1683 log_msg(2, "Exiting");1683 mr_msg(2, "Exiting"); 1684 1684 return (0); 1685 1685 } … … 1720 1720 noof_chars = strlen(string_to_find) + 1; /* we include the '\0' */ 1721 1721 1722 log_msg(7, "starting --- str=%s", string_to_find);1722 mr_msg(7, "starting --- str=%s", string_to_find); 1723 1723 1724 1724 /* walk across tree if necessary */ … … 1726 1726 char_to_find = string_to_find[0]; 1727 1727 if (node->right != NULL && node->ch < char_to_find) { 1728 log_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth,1728 mr_msg(7, "depth=%d --- going RIGHT ... %c-->%c", depth, 1729 1729 char_to_find, node->ch, (node->right)->ch); 1730 1730 return (find_string_at_node(node->right, string_to_find)); … … 1733 1733 /* walk down tree if appropriate */ 1734 1734 if (node->down != NULL && node->ch == char_to_find) { 1735 log_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find);1735 mr_msg(7, "depth=%d char=%c --- going DOWN", depth, char_to_find); 1736 1736 depth++; 1737 1737 node = find_string_at_node(node->down, string_to_find + 1); … … 1741 1741 1742 1742 if (char_to_find == '\0' && node->ch == '\0') { 1743 log_msg(7, "%s is in tree", original_string);1743 mr_msg(7, "%s is in tree", original_string); 1744 1744 return (node); 1745 1745 } else { 1746 log_msg(7, "%s is NOT in tree", original_string);1746 mr_msg(7, "%s is NOT in tree", original_string); 1747 1747 return (NULL); 1748 1748 } … … 1772 1772 size_t len = 0; // Scrub's patch doesn't work without that 1773 1773 1774 // log_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE");1774 // mr_msg(1, "use_star = %s", (use_star)?"TRUE":"FALSE"); 1775 1775 malloc_string(fname); 1776 1776 malloc_string(tmp); 1777 log_msg(5, "starting");1778 log_msg(5, "needles_list_fname = %s", needles_list_fname);1779 log_msg(5, "matches_list_fname = %s", matches_list_fname);1777 mr_msg(5, "starting"); 1778 mr_msg(5, "needles_list_fname = %s", needles_list_fname); 1779 mr_msg(5, "matches_list_fname = %s", matches_list_fname); 1780 1780 if (!(fin = fopen(needles_list_fname, "r"))) { 1781 1781 fatal_error("Cannot openin needles_list_fname"); … … 1808 1808 */ 1809 1809 1810 log_msg(5, "Looking for '%s'", fname);1810 mr_msg(5, "Looking for '%s'", fname); 1811 1811 found_node = find_string_at_node(filelist, fname); 1812 1812 if (found_node) { … … 1817 1817 strcpy(fname, tmp); 1818 1818 } 1819 log_msg(5, "Found '%s'", fname);1819 mr_msg(5, "Found '%s'", fname); 1820 1820 turn_wildcard_chars_into_literal_chars(tmp, fname); 1821 1821 fprintf(fout, "%s\n", tmp); … … 1852 1852 1853 1853 malloc_string(tmp); 1854 log_msg(3, "Adding %s to filelist", list_of_files_fname);1854 mr_msg(3, "Adding %s to filelist", list_of_files_fname); 1855 1855 if (!(fin = fopen(list_of_files_fname, "r"))) { 1856 1856 iamhere(list_of_files_fname); … … 1866 1866 tmp[strlen(tmp) - 1] = '\0'; 1867 1867 } 1868 log_msg(2, "tmp = '%s'", tmp);1868 mr_msg(2, "tmp = '%s'", tmp); 1869 1869 if (!tmp[0]) { 1870 1870 continue; 1871 1871 } 1872 1872 if ((nod = find_string_at_node(filelist, tmp))) { 1873 log_msg(5, "Found '%s' in filelist already. Cool.", tmp);1873 mr_msg(5, "Found '%s' in filelist already. Cool.", tmp); 1874 1874 } else { 1875 1875 add_string_at_node(filelist, tmp); … … 1879 1879 if (nod && flag_em) { 1880 1880 toggle_path_selection(filelist, tmp, TRUE); 1881 log_msg(5, "Flagged '%s'", tmp);1881 mr_msg(5, "Flagged '%s'", tmp); 1882 1882 } 1883 1883 } -
branches/stable/mondo/src/common/libmondo-files.c
r1100 r1107 183 183 // assert_string_is_neither_NULL_nor_zerolength(filename); 184 184 if (lstat(filename, &buf)) { 185 log_msg(20, "%s does not exist", filename);185 mr_msg(20, "%s does not exist", filename); 186 186 return (FALSE); 187 187 } else { 188 log_msg(20, "%s exists", filename);188 mr_msg(20, "%s exists", filename); 189 189 return (TRUE); 190 190 } … … 355 355 strcpy(output, incoming); 356 356 if (output[0] != '\0' && does_file_exist(output)) { 357 log_msg(4, "find_home_of_exe () --- Found %s at %s", fname,357 mr_msg(4, "find_home_of_exe () --- Found %s at %s", fname, 358 358 incoming); 359 359 } else { 360 360 output[0] = '\0'; 361 log_msg(4, "find_home_of_exe() --- Could not find %s", fname);361 mr_msg(4, "find_home_of_exe() --- Could not find %s", fname); 362 362 } 363 363 mr_free(incoming); … … 462 462 *p = '\0'; 463 463 } 464 // log_msg(2, "lastline='%s', ", p, lastline);464 // mr_msg(2, "lastline='%s', ", p, lastline); 465 465 if (!p) { 466 466 return (0); … … 789 789 strcpy(sz_res, call_program_and_get_last_line_of_output(command)); 790 790 file_len_K = atol(sz_res); 791 log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);791 mr_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K); 792 792 return (file_len_K); 793 793 } … … 828 828 ("Cannot open biggielist. OK, so estimate is based on filesets only."); 829 829 } else { 830 log_msg(4, "Reading it...");830 mr_msg(4, "Reading it..."); 831 831 for (fgets(fname, MAX_STR_LEN, fin); !feof(fin); 832 832 fgets(fname, MAX_STR_LEN, fin)) { … … 853 853 if (file_len_K > 0) { 854 854 scratchL += file_len_K; 855 log_msg(4, "%s --> %ld K", fname, file_len_K);855 mr_msg(4, "%s --> %ld K", fname, file_len_K); 856 856 } 857 857 sprintf(comment, 858 858 "After adding %s, scratchL+%ld now equals %ld", fname, 859 859 file_len_K, scratchL); 860 log_msg(4, comment);860 mr_msg(4, comment); 861 861 if (feof(fin)) { 862 862 break; … … 1074 1074 "Copying Mondo's core files to the scratch directory"); 1075 1075 1076 log_msg(4, "g_mondo_home='%s'", g_mondo_home);1076 mr_msg(4, "g_mondo_home='%s'", g_mondo_home); 1077 1077 if (strlen(g_mondo_home) < 2) { 1078 1078 find_and_store_mondoarchives_home(g_mondo_home); … … 1081 1081 bkpinfo->scratchdir); 1082 1082 1083 log_msg(4, "command = %s", command);1083 mr_msg(4, "command = %s", command); 1084 1084 if (run_program_and_log_output(command, 1)) { 1085 1085 fatal_error("Failed to copy Mondo's stuff to scratchdir"); … … 1393 1393 "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n"); 1394 1394 paranoid_fclose(fout); 1395 log_msg(2, "Created %s", outfile);1395 mr_msg(2, "Created %s", outfile); 1396 1396 sprintf(tmp, "chmod +x %s", outfile); 1397 1397 paranoid_system(tmp); -
branches/stable/mondo/src/common/libmondo-fork.c
r1080 r1107 102 102 /*@*********** End Variables ***************************************/ 103 103 104 log_msg(3, "Starting");104 mr_msg(3, "Starting"); 105 105 assert(bkpinfo != NULL); 106 106 assert_string_is_neither_NULL_nor_zerolength(basic_call); … … 122 122 resolve_naff_tokens(tmp, midway_call, cd_number_str, "_CD#_"); 123 123 resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_"); 124 log_msg(4, "basic call = '%s'", basic_call);125 log_msg(4, "midway_call = '%s'", midway_call);126 log_msg(4, "tmp = '%s'", tmp);127 log_msg(4, "ultimate call = '%s'", ultimate_call);124 mr_msg(4, "basic call = '%s'", basic_call); 125 mr_msg(4, "midway_call = '%s'", midway_call); 126 mr_msg(4, "tmp = '%s'", tmp); 127 mr_msg(4, "ultimate call = '%s'", ultimate_call); 128 128 sprintf(command, "%s >> %s", ultimate_call, MONDO_LOGFILE); 129 129 130 130 log_to_screen 131 131 ("Please be patient. Do not be alarmed by on-screen inactivity."); 132 log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",132 mr_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'", 133 133 what_i_am_doing); 134 134 strcpy(tmp, command); … … 150 150 } 151 151 #endif 152 log_msg(1, "command = '%s'", command);152 mr_msg(1, "command = '%s'", command); 153 153 retval += system(command); 154 154 if (!g_text_mode) { … … 156 156 } 157 157 if (retval) { 158 log_msg(2, "Basic call '%s' returned an error.", basic_call);158 mr_msg(2, "Basic call '%s' returned an error.", basic_call); 159 159 popup_and_OK("Press ENTER to continue."); 160 160 popup_and_OK … … 164 164 /* if text mode then do the above & RETURN; if not text mode, do this... */ 165 165 else { 166 log_msg(3, "command = '%s'", command);166 mr_msg(3, "command = '%s'", command); 167 167 // yes_this_is_a_goto: 168 168 retval = … … 181 181 if (bkpinfo->backup_media_type == dvd && !bkpinfo->please_dont_eject_when_restoring) 182 182 { 183 log_msg(3, "Ejecting DVD device");183 mr_msg(3, "Ejecting DVD device"); 184 184 eject_device(bkpinfo->media_device); 185 185 } … … 220 220 assert(program != NULL); 221 221 if (!program[0]) { 222 log_msg(2, "Warning - asked to run zerolength program");222 mr_msg(2, "Warning - asked to run zerolength program"); 223 223 return (1); 224 224 } … … 256 256 res = system(callstr); 257 257 if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) { 258 log_msg(0, "running: %s", callstr);259 log_msg(0,258 mr_msg(0, "running: %s", callstr); 259 mr_msg(0, 260 260 "--------------------------------start of output-----------------------------"); 261 261 } … … 284 284 if ((res == 0 && log_if_success) 285 285 || (res != 0 && log_if_failure)) { 286 log_msg(0, incoming);286 mr_msg(0, incoming); 287 287 } 288 288 } … … 291 291 unlink("/tmp/mondo-run-prog-thing.tmp"); 292 292 if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) { 293 log_msg(0,293 mr_msg(0, 294 294 "--------------------------------end of output------------------------------"); 295 295 if (res) { 296 log_msg(0, "...ran with res=%d", res);296 mr_msg(0, "...ran with res=%d", res); 297 297 } else { 298 log_msg(0, "...ran just fine. :-)");298 mr_msg(0, "...ran just fine. :-)"); 299 299 } 300 300 } 301 301 // else 302 // { log_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }302 // { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); } 303 303 return (res); 304 304 } … … 340 340 open_evalcall_form(what_i_am_doing); 341 341 sprintf(tmp, "Executing %s", basic_call); 342 log_msg(2, tmp);342 mr_msg(2, tmp); 343 343 if (!(fin = popen(command, "r"))) { 344 344 log_OS_error("Unable to popen-in command"); … … 350 350 log_to_screen("Waiting for external binary to start"); 351 351 for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) { 352 log_msg(3, "Waiting for lockfile %s to exist", lockfile);352 mr_msg(3, "Waiting for lockfile %s to exist", lockfile); 353 353 } 354 354 } … … 375 375 res = pclose(fin); 376 376 /* Log actual pclose errors. */ 377 if (errno) log_msg(5, "pclose err: %d", errno);377 if (errno) mr_msg(5, "pclose err: %d", errno); 378 378 /* Check if we have a valid status. If we do, extract the called program's exit code. */ 379 379 /* If we don't, highlight this fact by returning -1. */ … … 413 413 FILE *ftmp; 414 414 415 log_msg(5, "Opening.");415 mr_msg(5, "Opening."); 416 416 malloc_string(tmp); 417 417 tmp[0] = '\0'; … … 435 435 fatal_error("Cannot write introductory block"); 436 436 } 437 log_msg(7,437 mr_msg(7, 438 438 "subslice #%ld --- I have read %ld of %ld bytes in from f_orig", 439 439 subsliceno, bytes_read_in, bytes_to_be_read); … … 443 443 fatal_error("Cannot write post-thingy block"); 444 444 } 445 log_msg(7, "Subslice #%d written OK", subsliceno);445 mr_msg(7, "Subslice #%d written OK", subsliceno); 446 446 subsliceno++; 447 447 } … … 456 456 fatal_error("Cannot read the introductory block"); 457 457 } 458 log_msg(5, "tmp is %s", tmp);458 mr_msg(5, "tmp is %s", tmp); 459 459 if (!strstr(tmp, PIMP_START_SZ)) { 460 460 fatal_error("Can't find intro blk"); … … 465 465 bytes_to_be_read = atol(tmp); 466 466 while (bytes_to_be_read > 0) { 467 log_msg(7, "subslice#%ld, bytes=%ld", subsliceno,467 mr_msg(7, "subslice#%ld, bytes=%ld", subsliceno, 468 468 bytes_to_be_read); 469 469 bytes_read_in = fread(buf, 1, bytes_to_be_read, fin); … … 477 477 } 478 478 if (atol(tmp) != subsliceno) { 479 log_msg(1, "Wanted subslice %ld but got %ld ('%s')",479 mr_msg(1, "Wanted subslice %ld but got %ld ('%s')", 480 480 subsliceno, atol(tmp), tmp); 481 481 } 482 log_msg(7, "Subslice #%ld read OK", subsliceno);482 mr_msg(7, "Subslice #%ld read OK", subsliceno); 483 483 subsliceno++; 484 484 if (fread(tmp, 1, 64, fin) != 64) { … … 489 489 } 490 490 491 // log_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);491 // mr_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in); 492 492 493 493 if (direction == 'w') { … … 497 497 } 498 498 } else { 499 log_msg(1, "tmpA is %s", tmp);499 mr_msg(1, "tmpA is %s", tmp); 500 500 if (!strstr(tmp, PIMP_END_SZ)) { 501 501 if (fread(tmp, 1, 64, fin) != 64) { 502 502 fatal_error("Can't read the final block"); 503 503 } 504 log_msg(5, "tmpB is %s", tmp);504 mr_msg(5, "tmpB is %s", tmp); 505 505 if (!strstr(tmp, PIMP_END_SZ)) { 506 506 ftmp = fopen("/tmp/out.leftover", "w"); 507 507 bytes_read_in = fread(tmp, 1, 64, fin); 508 log_msg(1, "bytes_read_in = %ld", bytes_read_in);508 mr_msg(1, "bytes_read_in = %ld", bytes_read_in); 509 509 // if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); } 510 510 fwrite(tmp, 1, bytes_read_in, ftmp); 511 511 sprintf(tmp, "I am here - %lld", (long long)ftello(fin)); 512 // log_msg(0, tmp);512 // mr_msg(0, tmp); 513 513 fread(tmp, 1, 512, fin); 514 log_msg(0, "tmp = '%s'", tmp);514 mr_msg(0, "tmp = '%s'", tmp); 515 515 fwrite(tmp, 1, 512, ftmp); 516 516 fclose(ftmp); … … 522 522 mr_free(buf); 523 523 mr_free(tmp); 524 log_msg(3, "Successfully copied %ld bytes", bytes_written_out);524 mr_msg(3, "Successfully copied %ld bytes", bytes_written_out); 525 525 return (retval); 526 526 } … … 588 588 sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile, 589 589 tempfile); 590 log_msg(3, command);590 mr_msg(3, command); 591 591 open_evalcall_form(title); 592 592 if (!(pin = popen(command, "r"))) { … … 599 599 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE); 600 600 if (pcno < 0 || pcno > 100) { 601 log_msg(5, "Weird pc#");601 mr_msg(5, "Weird pc#"); 602 602 continue; 603 603 } … … 634 634 res = 999; 635 635 sz_command = (char *) info; 636 log_msg(4, "sz_command = '%s'", sz_command);636 mr_msg(4, "sz_command = '%s'", sz_command); 637 637 res = system(sz_command); 638 638 if (res > 256 && res != 4444) { 639 639 res = res / 256; 640 640 } 641 log_msg(4, "child res = %d", res);641 mr_msg(4, "child res = %d", res); 642 642 sz_command[0] = '\0'; 643 643 pthread_exit((void *) (&res)); … … 675 675 strcpy(title, tt); 676 676 sprintf(command, "%s 2>> %s", cmd, MONDO_LOGFILE); 677 log_msg(3, "command = '%s'", command);677 mr_msg(3, "command = '%s'", command); 678 678 if ((res = 679 679 pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit, … … 682 682 } 683 683 684 log_msg(8, "Parent running");684 mr_msg(8, "Parent running"); 685 685 open_evalcall_form(title); 686 686 for (sleep(1); command[0] != '\0'; sleep(1)) { 687 687 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE); 688 688 if (pcno <= 0 || pcno > 100) { 689 log_msg(8, "Weird pc#");689 mr_msg(8, "Weird pc#"); 690 690 continue; 691 691 } … … 711 711 res = 666; 712 712 } 713 log_msg(3, "Parent res = %d", res);713 mr_msg(3, "Parent res = %d", res); 714 714 mr_free(command); 715 715 mr_free(title); -
branches/stable/mondo/src/common/libmondo-mountlist.c
r1080 r1107 382 382 strcat(flaws_str, tmp); 383 383 res++; 384 log_msg(1, tmp);384 mr_msg(1, tmp); 385 385 goto endoffunc; 386 386 } else { … … 744 744 "Not putting %s in list of drives: it's a virtual drive", 745 745 drive); 746 log_msg(8, tmp);746 mr_msg(8, tmp); 747 747 continue; 748 748 } … … 753 753 "Not putting %s in list of drives: it has zero size (maybe an LVM volume)", 754 754 drive); 755 log_msg(8, tmp);755 mr_msg(8, tmp); 756 756 continue; 757 757 } … … 771 771 "Putting %s with size %lli in list of drives", 772 772 drive, size); 773 log_msg(8, tmp);773 mr_msg(8, tmp); 774 774 775 775 (void) truncate_to_drive_name(drive); … … 783 783 } 784 784 drivelist->entries = noof_drives; 785 log_msg(8, "Made list of drives");785 mr_msg(8, "Made list of drives"); 786 786 mr_free(drive); 787 787 mr_free(tmp); … … 944 944 !strcmp(mountlist->el[items].device, "devpts") 945 945 ) { 946 log_msg(1,946 mr_msg(1, 947 947 "Ignoring %s in mountlist - not loading that line :) ", 948 948 mountlist->el[items].device); -
branches/stable/mondo/src/common/libmondo-raid.c
r1103 r1107 633 633 get_next_raidtab_line(fin, label, value); 634 634 while (!feof(fin)) { 635 log_msg(1, "Looking for raid record #%d", items);635 mr_msg(1, "Looking for raid record #%d", items); 636 636 initialize_raidrec(&raidlist->el[items]); 637 637 v = 0; … … 646 646 raidlist->el[items].additional_vars.entries = v; 647 647 if (feof(fin)) { 648 log_msg(1, "No more records.");648 mr_msg(1, "No more records."); 649 649 continue; 650 650 } 651 log_msg(2, "Record #%d (%s) found", items, value);651 mr_msg(2, "Record #%d (%s) found", items, value); 652 652 strcpy(raidlist->el[items].raid_device, value); 653 653 for (get_next_raidtab_line(fin, label, value); … … 660 660 paranoid_fclose(fin); 661 661 raidlist->entries = items; 662 log_msg(1, "Raidtab loaded successfully.");663 log_msg(1, "%d RAID devices in raidtab", items);662 mr_msg(1, "Raidtab loaded successfully."); 663 mr_msg(1, "%d RAID devices in raidtab", items); 664 664 mr_free(tmp); 665 665 mr_free(label); … … 732 732 raidrec->parity = 3; 733 733 } else { 734 log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);734 mr_msg(1, "Unknown RAID parity algorithm '%s'\n.", value); 735 735 } 736 736 } else if (!strcmp(label, "device")) { … … 991 991 // open file 992 992 if (!(fin = fopen(MDSTAT_FILE, "r"))) { 993 log_msg(1, "Could not open %s.\n", MDSTAT_FILE);993 mr_msg(1, "Could not open %s.\n", MDSTAT_FILE); 994 994 return 1; 995 995 } … … 1037 1037 token = mr_strtok (string, delims, &lastpos); 1038 1038 if (!strcmp(token, "inactive")) { 1039 log_msg(1, "RAID device '%s' inactive.\n",1039 mr_msg(1, "RAID device '%s' inactive.\n", 1040 1040 raidlist->el[raidlist->entries].raid_device); 1041 1041 mr_free(string); … … 1064 1064 raidlist->el[raidlist->entries].raid_level = 10; 1065 1065 } else { 1066 log_msg(1, "Unknown RAID level '%s'.\n", token);1066 mr_msg(1, "Unknown RAID level '%s'.\n", token); 1067 1067 mr_free(string); 1068 1068 mr_free(token); … … 1108 1108 break; 1109 1109 default: // error 1110 log_msg(1, "Unknown device type '%c'\n", type);1110 mr_msg(1, "Unknown device type '%c'\n", type); 1111 1111 mr_free(string); 1112 1112 mr_free(token); … … 1200 1200 break; 1201 1201 default: // error 1202 log_msg(1, "Row %d should not occur in record!\n", row);1202 mr_msg(1, "Row %d should not occur in record!\n", row); 1203 1203 break; 1204 1204 } -
branches/stable/mondo/src/common/libmondo-stream.c
r1080 r1107 376 376 wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr); 377 377 } 378 log_msg(1, "Got xattr");378 mr_msg(1, "Got xattr"); 379 379 } 380 380 // acl … … 396 396 wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr); 397 397 } 398 log_msg(1, "Got acl");398 mr_msg(1, "Got acl"); 399 399 } 400 400 // tarball itself 401 401 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 402 log_msg(1, "now looking for afioball");402 mr_msg(1, "now looking for afioball"); 403 403 return (retval); 404 404 } … … 590 590 591 591 if (strncmp(tapedev, "/dev/", 5)) { 592 log_msg(1,592 mr_msg(1, 593 593 "Not using 'mt setblk'. This isn't an actual /dev entry."); 594 594 return (0); … … 933 933 // crctt=crc16=0; 934 934 where_I_was_before_tape_change = size; 935 log_msg(4, "where_I_was_... = %lld",935 mr_msg(4, "where_I_was_... = %lld", 936 936 where_I_was_before_tape_change); 937 937 start_to_read_from_next_tape(bkpinfo); 938 log_msg(4, "Started reading from next tape.");938 mr_msg(4, "Started reading from next tape."); 939 939 skip_incoming_files_until_we_find_this_one(temp_fname); 940 log_msg(4, "Skipped irrelevant files OK.");940 mr_msg(4, "Skipped irrelevant files OK."); 941 941 for (size = orig_size; size > where_I_was_before_tape_change; 942 942 size -= bytes_to_write) { … … 944 944 fread(datablock, 1, bytes_to_read, g_tape_stream); 945 945 } 946 log_msg(4, "'size' is now %lld (should be %lld)", size,946 mr_msg(4, "'size' is now %lld (should be %lld)", size, 947 947 where_I_was_before_tape_change); 948 948 log_to_screen("Successfully re-sync'd tape"); … … 961 961 #endif 962 962 } 963 log_msg(6, "Total read from tape for this file = %lld",963 mr_msg(6, "Total read from tape for this file = %lld", 964 964 total_read_from_tape_for_this_file); 965 log_msg(6, ".......................... Should be %lld", orig_size);965 mr_msg(6, ".......................... Should be %lld", orig_size); 966 966 g_tape_posK += total_read_from_tape_for_this_file / 1024; 967 967 sprintf(actual_cksum, "%04x%04x", crc16, crctt); … … 1054 1054 } 1055 1055 tempblock[i] = '\0'; 1056 log_msg(6, "%s (fname=%s, size=%ld K)",1056 mr_msg(6, "%s (fname=%s, size=%ld K)", 1057 1057 marker_to_string(*pcontrol_char), tempblock + 1000, 1058 1058 (long) (*plen) >> 10); … … 1172 1172 pB = the_file_I_was_reading; 1173 1173 } 1174 log_msg(1, "skip_incoming_..(%s)", pB);1175 log_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE");1174 mr_msg(1, "skip_incoming_..(%s)", pB); 1175 mr_msg(2, "Looking for initial START_AN_AFIO_OR_SLICE"); 1176 1176 ctrl_chr = -1; 1177 1177 while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) { … … 1182 1182 break; 1183 1183 } 1184 log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);1184 mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr); 1185 1185 wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr); 1186 log_msg(3, "Still trying to re-sync w/ tape");1186 mr_msg(3, "Still trying to re-sync w/ tape"); 1187 1187 } 1188 1188 while (ctrl_chr != BLK_START_FILE) { … … 1193 1193 break; 1194 1194 } 1195 log_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr);1195 mr_msg(1, "%lld %s %c", temp_size, temp_fname, ctrl_chr); 1196 1196 wrong_marker(BLK_START_FILE, ctrl_chr); 1197 log_msg(3, "Still trying to re-sync w/ tape");1197 mr_msg(3, "Still trying to re-sync w/ tape"); 1198 1198 } 1199 1199 pA = strrchr(temp_fname, '/'); … … 1210 1210 } 1211 1211 while (strcmp(pA, pB)) { 1212 log_msg(6, "Skipping %s (it's not %s)", temp_fname,1212 mr_msg(6, "Skipping %s (it's not %s)", temp_fname, 1213 1213 the_file_I_was_reading); 1214 1214 for (size = temp_size; size > 0; size -= bytes_to_write) { … … 1255 1255 } 1256 1256 } 1257 log_msg(2, "Reading %s (it matches %s)", temp_fname,1257 mr_msg(2, "Reading %s (it matches %s)", temp_fname, 1258 1258 the_file_I_was_reading); 1259 1259 mr_free(temp_fname); … … 1303 1303 wrong_marker(BLK_START_OF_BACKUP, ctrlchr); 1304 1304 } else { 1305 log_msg(3, "Next tape opened OK. Whoopee!");1305 mr_msg(3, "Next tape opened OK. Whoopee!"); 1306 1306 } 1307 1307 mr_free(sz_msg); … … 1381 1381 char *fname; 1382 1382 1383 log_msg(2, "I am now writing back catalog to tape");1383 mr_msg(2, "I am now writing back catalog to tape"); 1384 1384 malloc_string(fname); 1385 1385 last = g_tapecatalog->entries - 1; … … 1388 1388 g_tapecatalog->el[i].fname); 1389 1389 if (!does_file_exist(fname)) { 1390 log_msg(6, "Can't write %s - it doesn't exist.", fname);1390 mr_msg(6, "Can't write %s - it doesn't exist.", fname); 1391 1391 } else { 1392 1392 write_header_block_to_stream(length_of_file(fname), 1393 1393 "start-backcatalog-afio-or-slice", 1394 1394 BLK_START_AN_AFIO_OR_SLICE); 1395 log_msg(2, "Writing %s", fname);1395 mr_msg(2, "Writing %s", fname); 1396 1396 if (write_file_to_stream_from_file(bkpinfo, fname)) { 1397 1397 res++; 1398 log_msg(2, "%s failed", fname);1398 mr_msg(2, "%s failed", fname); 1399 1399 } 1400 1400 if (i != last) { … … 1406 1406 } 1407 1407 mr_free(fname); 1408 log_msg(2, "Finished writing back catalog to tape");1408 mr_msg(2, "Finished writing back catalog to tape"); 1409 1409 return (res); 1410 1410 } … … 1646 1646 marker_to_string(control_char), p, 1647 1647 (long) length_of_incoming_file >> 10); 1648 log_msg(6, tmp);1648 mr_msg(6, tmp); 1649 1649 /* log_tape_pos(); */ 1650 1650 return (0); -
branches/stable/mondo/src/common/libmondo-tools.c
r1095 r1107 229 229 } 230 230 } 231 // log_msg(1, "tmp = '%s'", tmp);231 // mr_msg(1, "tmp = '%s'", tmp); 232 232 d = atof(tmp); 233 233 #endif 234 log_msg(1, "g_kernel_version = %f", d);234 mr_msg(1, "g_kernel_version = %f", d); 235 235 return (d); 236 236 } … … 430 430 1024; 431 431 432 log_msg(1, "Foo");432 mr_msg(1, "Foo"); 433 433 if (bkpinfo->backup_media_type == tape) { 434 log_msg(1, "Bar");434 mr_msg(1, "Bar"); 435 435 sprintf(tmp, "mt -f %s status", bkpinfo->media_device); 436 log_msg(1, "tmp = '%s'", tmp);436 mr_msg(1, "tmp = '%s'", tmp); 437 437 if (run_program_and_log_output(tmp, 3)) { 438 438 fatal_error … … 548 548 } 549 549 } 550 log_msg(2, "call_make_iso (DVD res) is ... %s",550 mr_msg(2, "call_make_iso (DVD res) is ... %s", 551 551 bkpinfo->call_make_iso); 552 552 } // end of DVD code … … 791 791 int i; 792 792 793 log_msg(1, "Hi");793 mr_msg(1, "Hi"); 794 794 assert(bkpinfo != NULL); 795 795 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo)); … … 1102 1102 } else if (strstr(value, "/dev/") && strstr(value, "t0") 1103 1103 && !strcmp(label, "media-dev")) { 1104 log_msg(2, "FYI, I shan't read new value for %s - already got %s",1104 mr_msg(2, "FYI, I shan't read new value for %s - already got %s", 1105 1105 label, value); 1106 1106 return (0); … … 1184 1184 1185 1185 if (!g_autofs_exe[0]) { 1186 log_msg(3, "No autofs detected.");1186 mr_msg(3, "No autofs detected."); 1187 1187 } else { 1188 log_msg(3, "%s --- autofs detected", g_autofs_exe);1188 mr_msg(3, "%s --- autofs detected", g_autofs_exe); 1189 1189 // FIXME -- only disable it if it's running --- sprintf(tmp, "%s status", autofs_exe); 1190 1190 sprintf(tmp, "%s stop", g_autofs_exe); … … 1206 1206 1207 1207 if (!g_autofs_stopped || !g_autofs_exe[0]) { 1208 log_msg(3, "No autofs detected.");1208 mr_msg(3, "No autofs detected."); 1209 1209 return; 1210 1210 } … … 1227 1227 char command[MAX_STR_LEN]; 1228 1228 1229 log_msg(1, "Started sub");1230 log_msg(4, "About to set g_boot_mountpt[0] to '\\0'");1229 mr_msg(1, "Started sub"); 1230 mr_msg(4, "About to set g_boot_mountpt[0] to '\\0'"); 1231 1231 g_boot_mountpt[0] = '\0'; 1232 log_msg(4, "Done. Great. Seeting command to something");1232 mr_msg(4, "Done. Great. Seeting command to something"); 1233 1233 strcpy(command, 1234 1234 "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1235 log_msg(4, "Cool. Command = '%s'", command);1235 mr_msg(4, "Cool. Command = '%s'", command); 1236 1236 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 1237 log_msg(4, "tmp = '%s'", tmp);1237 mr_msg(4, "tmp = '%s'", tmp); 1238 1238 if (tmp[0]) { 1239 1239 log_it("/boot is at %s according to /etc/fstab", tmp); … … 1241 1241 if (!run_program_and_log_output("mount /boot", 5)) { 1242 1242 strcpy(g_boot_mountpt, "/boot"); 1243 log_msg(1, "Mounted /boot");1243 mr_msg(1, "Mounted /boot"); 1244 1244 } else { 1245 1245 log_it("...ignored cos it's a label :-)"); … … 1247 1247 } else { 1248 1248 sprintf(command, "mount | grep -E '^%s'", tmp); 1249 log_msg(3, "command = %s", command);1249 mr_msg(3, "command = %s", command); 1250 1250 if (run_program_and_log_output(command, 5)) { 1251 1251 strcpy(g_boot_mountpt, tmp); … … 1257 1257 if (run_program_and_log_output(tmp, 5)) { 1258 1258 g_boot_mountpt[0] = '\0'; 1259 log_msg(1, "Plan B");1259 mr_msg(1, "Plan B"); 1260 1260 if (!run_program_and_log_output("mount /boot", 5)) { 1261 1261 strcpy(g_boot_mountpt, "/boot"); 1262 log_msg(1, "Plan B worked");1262 mr_msg(1, "Plan B worked"); 1263 1263 } else { 1264 log_msg(1,1264 mr_msg(1, 1265 1265 "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition."); 1266 1266 } … … 1269 1269 } 1270 1270 } 1271 log_msg(1, "Ended sub");1271 mr_msg(1, "Ended sub"); 1272 1272 } 1273 1273 … … 1280 1280 char tmp[MAX_STR_LEN]; 1281 1281 1282 log_msg(3, "starting");1282 mr_msg(3, "starting"); 1283 1283 if (g_boot_mountpt[0]) { 1284 1284 sprintf(tmp, "umount %s", g_boot_mountpt); … … 1287 1287 } 1288 1288 } 1289 log_msg(3, "leaving");1289 mr_msg(3, "leaving"); 1290 1290 } 1291 1291 … … 1336 1336 1337 1337 /** 1338 * The standard log_debug_msg() ( log_msg() also due to a macro). Writes some describing1338 * The standard log_debug_msg() (mr_msg() also due to a macro). Writes some describing 1339 1339 * information to the logfile. 1340 1340 */ … … 1444 1444 for(i=0;list_of_arrays[i];i++) 1445 1445 { 1446 log_msg(5, "Allocating %d", i);1446 mr_msg(5, "Allocating %d", i); 1447 1447 ppcurr = list_of_arrays[i]; 1448 1448 if (mal) … … 1456 1456 } 1457 1457 } 1458 log_msg(5, "Returning");1458 mr_msg(5, "Returning"); 1459 1459 */ 1460 1460 } … … 1490 1490 ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99")); 1491 1491 if (g_magicdev_command[0]) { 1492 log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);1492 mr_msg(1, "g_magicdev_command = '%s'", g_magicdev_command); 1493 1493 paranoid_system("killall magicdev"); 1494 1494 } -
branches/stable/mondo/src/common/libmondo-verify.c
r1080 r1107 74 74 */ 75 75 76 log_msg(1, "Now scanning log file for 'afio: ' stuff");76 mr_msg(1, "Now scanning log file for 'afio: ' stuff"); 77 77 sprintf(command, 78 78 "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s", 79 79 stderr_fname, afio_found_changes); 80 log_msg(2, command);80 mr_msg(2, command); 81 81 res = system(command); 82 82 if (res) { 83 log_msg(2, "Warning - failed to think");84 } 85 86 log_msg(1, "Now scanning log file for 'star: ' stuff");83 mr_msg(2, "Warning - failed to think"); 84 } 85 86 mr_msg(1, "Now scanning log file for 'star: ' stuff"); 87 87 sprintf(command, 88 88 "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", 89 89 stderr_fname, afio_found_changes); 90 log_msg(2, command);90 mr_msg(2, command); 91 91 res = system(command); 92 92 if (res) { 93 log_msg(2, "Warning - failed to think");93 mr_msg(2, "Warning - failed to think"); 94 94 } 95 95 // exclude_nonexistent_files (afio_found_changes); … … 99 99 ignorefiles_fname, afio_found_changes, afio_found_changes, 100 100 changedfiles_fname); 101 log_msg(2, command);101 mr_msg(2, command); 102 102 paranoid_system(command); 103 103 mr_free(command); … … 146 146 if (g_last_afioball_number != set_number - 1) { 147 147 if (set_number == 0) { 148 log_msg(1,148 mr_msg(1, 149 149 "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more"); 150 150 } else { … … 163 163 does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets)); 164 164 total_sets++) { 165 log_msg(1, "total_sets = %d", total_sets);165 mr_msg(1, "total_sets = %d", total_sets); 166 166 } 167 167 for (; … … 172 172 g_last_afioball_number); 173 173 update_evalcall_form(percentage); 174 log_msg(1, "set = %d", set_number);174 mr_msg(1, "set = %d", set_number); 175 175 retval += 176 176 verify_an_afioball_from_CD(bkpinfo, … … 276 276 // handle slices until end of CD 277 277 if (slice_num == 0) { 278 log_msg(2, "ISO=%d bigfile=%ld --START--",278 mr_msg(2, "ISO=%d bigfile=%ld --START--", 279 279 g_current_media_number, bigfile_num); 280 280 if (! … … 282 282 fopen(slice_fname(bigfile_num, slice_num, mountpoint, ""), 283 283 "r"))) { 284 log_msg(2, "Cannot open bigfile's info file");284 mr_msg(2, "Cannot open bigfile's info file"); 285 285 } else { 286 286 if (fread 287 287 ((void *) &biggiestruct, 1, sizeof(biggiestruct), 288 288 fin) < sizeof(biggiestruct)) { 289 log_msg(2, "Unable to get biggiestruct");289 mr_msg(2, "Unable to get biggiestruct"); 290 290 } 291 291 paranoid_fclose(fin); … … 293 293 sprintf(tmp, "%s/%s", bkpinfo->restore_path, 294 294 biggiestruct.filename); 295 log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp);295 mr_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp); 296 296 if (!(forig = fopen(tmp, "r"))) { 297 log_msg(2, "Failed to open bigfile. Darn.");297 mr_msg(2, "Failed to open bigfile. Darn."); 298 298 retval++; 299 299 } … … 301 301 } else if (does_file_exist 302 302 (slice_fname(bigfile_num, slice_num, mountpoint, ""))) { 303 log_msg(2, "ISO=%d bigfile=%ld ---END---",303 mr_msg(2, "ISO=%d bigfile=%ld ---END---", 304 304 g_current_media_number, bigfile_num); 305 305 bigfile_num++; … … 307 307 slice_num = 0; 308 308 } else { 309 log_msg(2, "ISO=%d bigfile=%ld slice=%ld \r",309 mr_msg(2, "ISO=%d bigfile=%ld slice=%ld \r", 310 310 g_current_media_number, bigfile_num, slice_num); 311 311 if (bkpinfo->compression_level > 0) { … … 341 341 paranoid_pclose(pin); 342 342 if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) { 343 log_msg(3,343 mr_msg(3, 344 344 "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.", 345 345 biggiestruct.filename); 346 log_msg(3,346 mr_msg(3, 347 347 "If you really want verification for %s, please contact the devteam and offer an incentive.", 348 348 biggiestruct.filename); … … 350 350 } 351 351 if (res) { 352 log_msg(0,352 mr_msg(0, 353 353 "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c", 354 354 biggiestruct.filename); … … 422 422 if (strstr(tarball_fname, ".lzo") 423 423 && strcmp(bkpinfo->zip_suffix, "lzo")) { 424 log_msg(2, "OK, I'm going to start using lzop.");424 mr_msg(2, "OK, I'm going to start using lzop."); 425 425 strcpy(bkpinfo->zip_exe, "lzop"); 426 426 strcpy(bkpinfo->zip_suffix, "lzo"); … … 430 430 if (strstr(tarball_fname, ".gz") 431 431 && strcmp(bkpinfo->zip_suffix, "gz")) { 432 log_msg(2, "OK, I'm going to start using gzip.");432 mr_msg(2, "OK, I'm going to start using gzip."); 433 433 strcpy(bkpinfo->zip_exe, "gzip"); 434 434 strcpy(bkpinfo->zip_suffix, "gz"); … … 438 438 if (strstr(tarball_fname, ".bz2") 439 439 && strcmp(bkpinfo->zip_suffix, "bz2")) { 440 log_msg(2, "OK, I'm going to start using bzip2.");440 mr_msg(2, "OK, I'm going to start using bzip2."); 441 441 strcpy(bkpinfo->zip_exe, "bzip2"); 442 442 strcpy(bkpinfo->zip_suffix, "bz2"); … … 458 458 bkpinfo->zip_exe, tarball_fname, outlog, outlog); 459 459 } 460 log_msg(6, "command=%s", command);460 mr_msg(6, "command=%s", command); 461 461 paranoid_system(command); 462 462 if (length_of_file(outlog) < 10) { … … 477 477 if (strchr(tmp, '/')) { 478 478 if (!diffs) { 479 log_msg(0, "'%s' - differences found",479 mr_msg(0, "'%s' - differences found", 480 480 tarball_fname); 481 481 } 482 log_msg(0, "star: /%s",482 mr_msg(0, "star: /%s", 483 483 strip_afio_output_line(tmp)); 484 484 diffs++; … … 487 487 } else { 488 488 if (!diffs) { 489 log_msg(0, "'%s' - differences found",489 mr_msg(0, "'%s' - differences found", 490 490 tarball_fname); 491 491 } 492 log_msg(0, "afio: /%s", strip_afio_output_line(tmp));492 mr_msg(0, "afio: /%s", strip_afio_output_line(tmp)); 493 493 diffs++; 494 494 } … … 533 533 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); 534 534 535 log_msg(1, "Verifying %s", tarball_fname);535 mr_msg(1, "Verifying %s", tarball_fname); 536 536 if (!does_file_exist(tarball_fname)) { 537 537 fatal_error("Cannot verify nonexistent afioball"); … … 589 589 sprintf(tmp, 590 590 "Afioball '%s' no longer matches your live filesystem", p); 591 log_msg(0, tmp);591 mr_msg(0, tmp); 592 592 retval++; 593 593 } … … 664 664 &ctrl_chr); 665 665 if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) { 666 log_msg(2, "test_file = %s", test_file);666 mr_msg(2, "test_file = %s", test_file); 667 667 wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr); 668 668 } … … 676 676 sprintf(tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum, 677 677 orig_cksum); 678 log_msg(2, tmp);678 mr_msg(2, tmp); 679 679 sprintf(tmp, "%s has changed on live filesystem", 680 680 biggie_fname); … … 793 793 } 794 794 } 795 log_msg(1, "All done with afioballs");795 mr_msg(1, "All done with afioballs"); 796 796 close_progress_form(); 797 797 mr_free(tmp); … … 868 868 } 869 869 noof_biggiefiles = (long) size; 870 log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);870 mr_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles); 871 871 open_progress_form("Verifying big files", comment, 872 872 "Please wait. This may take some time.", "", … … 960 960 "%s not found; assuming you backed up to CD; verifying CD...", 961 961 fname); 962 log_msg(2, tmp);962 mr_msg(2, tmp); 963 963 if (bkpinfo->manual_cd_tray) { 964 964 popup_and_OK("Please push CD tray closed."); … … 992 992 } 993 993 } 994 log_msg(2, "OK, I've mounted the ISO/CD\n");994 mr_msg(2, "OK, I've mounted the ISO/CD\n"); 995 995 sprintf(tmp, "%s/archives/NOT-THE-LAST", mountpoint); 996 996 if (!does_file_exist(tmp)) { 997 log_msg997 mr_msg 998 998 (2, 999 999 "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE."); … … 1024 1024 retval++; 1025 1025 } else { 1026 log_msg(2, "OK, I've unmounted the ISO file\n");1026 mr_msg(2, "OK, I've unmounted the ISO file\n"); 1027 1027 } 1028 1028 if (!does_file_exist(fname)) { … … 1031 1031 if (!bkpinfo->please_dont_eject 1032 1032 && eject_device(bkpinfo->media_device)) { 1033 log_msg(2, "Failed to eject CD-ROM drive");1033 mr_msg(2, "Failed to eject CD-ROM drive"); 1034 1034 } 1035 1035 } … … 1063 1063 assert(bkpinfo != NULL); 1064 1064 1065 log_msg(3, "verify_tape_backups --- starting");1065 mr_msg(3, "verify_tape_backups --- starting"); 1066 1066 log_to_screen("Verifying backups"); 1067 1067 openin_tape(bkpinfo); … … 1083 1083 (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE, 1084 1084 changed_files_fname); 1085 log_msg(2, "Running command to derive list of changed files");1086 log_msg(2, tmp);1085 mr_msg(2, "Running command to derive list of changed files"); 1086 mr_msg(2, tmp); 1087 1087 if (system(tmp)) { 1088 1088 if (does_file_exist(changed_files_fname) … … 1106 1106 "%ld files differed from live filesystem; type less %s or less %s to see", 1107 1107 diffs, changed_files_fname, "/tmp/changed.files"); 1108 log_msg(0, tmp);1108 mr_msg(0, tmp); 1109 1109 log_to_screen 1110 1110 ("See /tmp/changed.files for a list of nonmatching files."); -
branches/stable/mondo/src/common/newt-specific.c
r1103 r1107 213 213 usleep(500000); 214 214 if (g_text_mode) { 215 log_msg(2, "Closing evalcall form");215 mr_msg(2, "Closing evalcall form"); 216 216 return; 217 217 } … … 233 233 } 234 234 if (g_current_progress == -999) { 235 log_msg(2,235 mr_msg(2, 236 236 "Trying to close the progress form when it ain't open!"); 237 237 return; … … 241 241 sleep(1); 242 242 if (g_text_mode) { 243 log_msg(2, "Closing progress form");243 mr_msg(2, "Closing progress form"); 244 244 return; 245 245 } … … 285 285 set_signals(FALSE); // link to external func 286 286 g_exiting = TRUE; 287 log_msg(1, "Fatal error received - '%s'", error_string);287 mr_msg(1, "Fatal error received - '%s'", error_string); 288 288 printf("Fatal error... %s\n", error_string); 289 289 if (getpid() == g_mastermind_pid) { 290 log_msg(2, "mastermind %d is exiting", (int) getpid());290 mr_msg(2, "mastermind %d is exiting", (int) getpid()); 291 291 kill(g_main_pid, SIGTERM); 292 292 mr_free(tmp); … … 296 296 if (getpid() != g_main_pid) { 297 297 if (g_mastermind_pid != 0 && getpid() != g_mastermind_pid) { 298 log_msg(2, "non-m/m %d is exiting", (int) getpid());298 mr_msg(2, "non-m/m %d is exiting", (int) getpid()); 299 299 kill(g_main_pid, SIGTERM); 300 300 mr_free(tmp); … … 303 303 } 304 304 305 log_msg(3, "OK, I think I'm the main PID.");305 mr_msg(3, "OK, I think I'm the main PID."); 306 306 if (already_exiting) { 307 log_msg(3, "...I'm already exiting. Give me time, Julian!");307 mr_msg(3, "...I'm already exiting. Give me time, Julian!"); 308 308 mr_free(tmp); 309 309 finish(1); … … 311 311 312 312 already_exiting = TRUE; 313 log_msg(2, "I'm going to do some cleaning up now.");313 mr_msg(2, "I'm going to do some cleaning up now."); 314 314 paranoid_system("killall mindi 2> /dev/null"); 315 315 kill_anything_like_this("/mondo/do-not"); … … 320 320 chdir("/"); 321 321 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 322 log_msg(2, "Waiting for child processes to terminate");322 mr_msg(2, "Waiting for child processes to terminate"); 323 323 sleep(1); 324 324 run_program_and_log_output(tmp, 5); … … 337 337 338 338 if (!g_text_mode) { 339 log_msg(0, fatalstr);340 log_msg(0, error_string);339 mr_msg(0, fatalstr); 340 mr_msg(0, error_string); 341 341 // popup_and_OK (error_string); 342 342 newtFinished(); … … 359 359 register_pid(0, "mondo"); // finish() does this too, FYI 360 360 if (!g_main_pid) { 361 log_msg(3, "FYI - g_main_pid is blank");361 mr_msg(3, "FYI - g_main_pid is blank"); 362 362 } 363 363 mr_free(tmp); … … 402 402 if (!g_text_mode) { 403 403 if (does_file_exist("/THIS-IS-A-RAMDISK")) { 404 log_msg(1, "Calling newtFinished()");404 mr_msg(1, "Calling newtFinished()"); 405 405 newtFinished(); 406 406 } else { 407 log_msg(1, "Calling newtSuspend()");407 mr_msg(1, "Calling newtSuspend()"); 408 408 newtSuspend(); 409 409 } … … 504 504 va_start(args, fmt); 505 505 vsprintf(output, fmt, args); 506 log_msg(0, output);506 mr_msg(0, output); 507 507 output[80] = '\0'; 508 508 va_end(args); … … 549 549 mvaddstr_and_log_it(int y, int x, char *output) { 550 550 assert_string_is_neither_NULL_nor_zerolength(output); 551 log_msg(0, output);551 mr_msg(0, output); 552 552 if (g_text_mode) { 553 553 printf("%s\n", output); … … 583 583 // center_string (title, 80); 584 584 if (g_text_mode) { 585 log_msg(0, title);585 mr_msg(0, title); 586 586 } else { 587 587 strcpy(tmp, title); … … 592 592 g_isoform_starttime = get_time(); 593 593 if (g_text_mode) { 594 log_msg(0, g_isoform_header_str);594 mr_msg(0, g_isoform_header_str); 595 595 } else { 596 596 g_isoform_header = newtLabel(1, 1, g_isoform_header_str); … … 661 661 strcpy(g_blurb_str_3, blurb2); 662 662 if (g_text_mode) { 663 log_msg(0, blurb1);664 log_msg(0, blurb2);665 log_msg(0, blurb3);663 mr_msg(0, blurb1); 664 mr_msg(0, blurb2); 665 mr_msg(0, blurb3); 666 666 } else { 667 667 g_blurb1 = newtLabel(2, 1, blurb1); … … 697 697 assert_string_is_neither_NULL_nor_zerolength(prompt); 698 698 699 log_msg(0, prompt);699 mr_msg(0, prompt); 700 700 if (g_text_mode) { 701 701 printf … … 1104 1104 char *tmp; 1105 1105 1106 // log_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3);1106 // mr_msg(1, "'%s' '%s' '%s'", blurb1, blurb2, blurb3); 1107 1107 percentline_str = mr_malloc(MAX_NEWT_COMMENT_LEN); 1108 1108 timeline_str = mr_malloc(MAX_NEWT_COMMENT_LEN); … … 1128 1128 blurb1, blurb2, blurb3, g_current_progress, 1129 1129 g_maximum_progress); 1130 log_msg(0, tmp);1130 mr_msg(0, tmp); 1131 1131 g_current_progress = g_maximum_progress; 1132 1132 } … … 1169 1169 } 1170 1170 if (percentage > 100) { 1171 log_msg(2, "percentage = %d", percentage);1171 mr_msg(2, "percentage = %d", percentage); 1172 1172 } 1173 1173 sprintf(taskprogress + strlen(taskprogress), … … 1402 1402 if (!(fin = fopen(source_file, "r"))) { 1403 1403 log_OS_error(source_file); 1404 log_msg(2, "Can't open %s; therefore, cannot popup list",1404 mr_msg(2, "Can't open %s; therefore, cannot popup list", 1405 1405 source_file); 1406 1406 mr_free(tmp); 1407 1407 return (1); 1408 1408 } 1409 log_msg(2, "Loading %s", source_file);1409 mr_msg(2, "Loading %s", source_file); 1410 1410 for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM; 1411 1411 filelist->entries++) { … … 1459 1459 (void *) &dummy_fle, 1460 1460 sizeof(struct s_filelist_entry)); 1461 log_msg(2, "Swapping %s and %s",1461 mr_msg(2, "Swapping %s and %s", 1462 1462 filelist->el[i].filename, 1463 1463 filelist->el[i + 1].filename); … … 1544 1544 assert_string_is_neither_NULL_nor_zerolength(source_file); 1545 1545 if (g_text_mode) { 1546 log_msg(2, "Text mode. Therefore, no popup list.");1546 mr_msg(2, "Text mode. Therefore, no popup list."); 1547 1547 goto free_to_go; 1548 1548 } 1549 log_msg(2, "Examining file %s", source_file);1549 mr_msg(2, "Examining file %s", source_file); 1550 1550 1551 1551 lng = count_lines_in_file(source_file); 1552 1552 if (lng < 1) { 1553 log_msg(2, "No lines in file. Therefore, no popup list.");1553 mr_msg(2, "No lines in file. Therefore, no popup list."); 1554 1554 mr_free(reason); 1555 1555 goto free_to_go; 1556 1556 } else if (lng >= ARBITRARY_MAXIMUM) { 1557 log_msg(2, "Too many files differ for me to list.");1557 mr_msg(2, "Too many files differ for me to list."); 1558 1558 goto free_to_go; 1559 1559 } … … 1565 1565 1566 1566 if (load_filelist_into_array(filelist, source_file)) { 1567 log_msg(2, "Can't open %s; therefore, cannot popup list",1567 mr_msg(2, "Can't open %s; therefore, cannot popup list", 1568 1568 source_file); 1569 1569 mr_free(reason); 1570 1570 return; 1571 1571 } 1572 log_msg(2, "%d files loaded into filelist array",1572 mr_msg(2, "%d files loaded into filelist array", 1573 1573 filelist->entries); 1574 1574 for (i = 0; i < filelist->entries; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.