Changeset 1967 in MondoRescue for branches/2.2.6/mondo
- Timestamp:
- May 29, 2008, 5:40:05 PM (16 years ago)
- Location:
- branches/2.2.6/mondo/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.6/mondo/src/common/libmondo-archive.c
r1956 r1967 60 60 extern FILE *g_tape_stream; 61 61 extern long long g_tape_posK; 62 extern bool g_cd_recovery; 62 63 extern char *g_mondo_home; 63 64 extern char *g_tmpfs_mountpt; 64 extern bool g_cd_recovery;65 65 extern char *g_serial_string; 66 67 66 extern char *g_getfacl; 68 67 extern char *g_getfattr; … … 101 100 static int g_sem_id; 102 101 static int g_sem_key; 103 104 105 106 102 107 103 /** -
branches/2.2.6/mondo/src/common/libmondo-cli.c
r1966 r1967 199 199 /* Reference to global bkpinfo */ 200 200 extern struct s_bkpinfo *bkpinfo; 201 202 extern void free_MR_global_filenames(void); 201 203 202 204 /** … … 349 351 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 350 352 351 /* compulsory */353 /* compulsory */ 352 354 i = flag_set['c'] + flag_set['i'] + flag_set['n'] + 353 355 flag_set['t'] + flag_set['u'] + flag_set['r'] + 354 356 flag_set['w'] + flag_set['C'] + flag_set['U']; 355 if ( i == 0) {357 if ((i == 0) && (! bkpinfo->restore_data)) { 356 358 retval++; 357 359 log_to_screen("You must specify the media type\n"); … … 361 363 log_to_screen("Please specify only one media type\n"); 362 364 } 365 363 366 if (flag_set['K']) { 364 367 g_loglevel = atoi(flag_val['K']); … … 368 371 } 369 372 } 370 if (flag_set['L'] && flag_set['0']) { 373 374 if ((flag_set['L'] && flag_set['0']) && (! bkpinfo->restore_data)) { 371 375 retval++; 372 376 log_to_screen("You cannot have 'no compression' _and_ LZOP.\n"); 373 377 } 374 bkpinfo->backup_data = flag_set['O']; 378 if (! bkpinfo->restore_data) { 379 bkpinfo->backup_data = flag_set['O']; 380 } 375 381 bkpinfo->verify_data = flag_set['V']; 382 376 383 if (flag_set['I'] && !bkpinfo->backup_data) { 377 384 log_to_screen("-I switch is ignored if just verifying"); … … 401 408 } 402 409 } 403 if (flag_set['W']) { 410 411 if ((flag_set['W']) && (! bkpinfo->restore_data)) { 404 412 bkpinfo->nonbootable_backup = TRUE; 405 413 log_to_screen("Warning - you have opted for non-bootable backup"); … … 409 417 } 410 418 } 411 if (flag_set['t'] && flag_set['H']) { 419 420 if ((flag_set['t'] && flag_set['H']) && (! bkpinfo->restore_data)) { 412 421 fatal_error 413 422 ("Sorry, you may not nuke w/o warning from tape. Drop -H, please."); 414 423 } 424 415 425 if (flag_set['I']) { 416 426 if (!strcmp(bkpinfo->include_paths, "/")) { … … 430 440 if (q != NULL) { 431 441 *q = '\0'; 432 if ( stat(p, &buf) != 0) {442 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 433 443 log_msg(1, "ERROR ! %s doesn't exist", p); 434 444 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); … … 436 446 p = q+1 ; 437 447 } else { 438 if ( stat(p, &buf) != 0) {448 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 439 449 log_msg(1, "ERROR ! %s doesn't exist", p); 440 450 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); … … 456 466 457 467 if (g_kernel_version >= 2.6 && !flag_set['d'] 458 && (flag_set['c'] || flag_set['w']) ) {468 && (flag_set['c'] || flag_set['w']) && (! bkpinfo->restore_data)) { 459 469 fatal_error 460 470 ("If you are using the 2.6.x kernel, please specify the CD-R(W) device."); … … 471 481 strcpy(bkpinfo->include_paths, flag_val['J']); 472 482 } 473 if (flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) { 483 484 if ((flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) && (! bkpinfo->restore_data)) { 474 485 if (!flag_set['r'] && g_kernel_version <= 2.5 475 486 && strstr(flag_val['d'], "/dev/")) { … … 522 533 } 523 534 } 535 524 536 if (flag_set['t'] && !flag_set['d']) { 525 537 log_it("Hmm! No tape drive specified. Let's see what we can do."); … … 540 552 if (! flag_set['d']) { 541 553 fatal_error 542 ("You need to specify a device file with -d for bootable USB device creation");543 } 544 if ( !flag_set['s']) {554 ("You need to specify a device file with -d for bootable USB device usage"); 555 } 556 if ((!flag_set['s']) && (! bkpinfo->restore_data)) { 545 557 fatal_error("You did not specify a size (-s) for your USB device. Aborting"); 546 558 } … … 559 571 } 560 572 } 561 if (!find_home_of_exe("growisofs")) {562 fatal_error563 ("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it.");564 }565 if (!find_home_of_exe("dvd+rw-format")) {566 fatal_error567 ("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it.");568 }569 573 if (strchr(flag_val['d'], ',')) { 570 574 fatal_error 571 575 ("Please don't give a SCSI node. Give a _device_, preferably a /dev entry, for the parameter of the -d flag."); 572 576 } 573 if (!flag_set['s']) { 574 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 575 strcat(flag_val['s'], "m"); 576 log_to_screen 577 ("You did not specify a size (-s) for DVD. I'm guessing %s.", 578 flag_val['s']); 579 flag_set['s'] = 1; 577 if (! bkpinfo->restore_data) { 578 if (!find_home_of_exe("growisofs")) { 579 fatal_error 580 ("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it."); 581 } 582 if (!find_home_of_exe("dvd+rw-format")) { 583 fatal_error 584 ("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it."); 585 } 586 if (!flag_set['s']) { 587 sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 588 strcat(flag_val['s'], "m"); 589 log_to_screen 590 ("You did not specify a size (-s) for DVD. I'm guessing %s.", 591 flag_val['s']); 592 flag_set['s'] = 1; 593 } 580 594 } 581 595 /* … … 591 605 ("Please don't give a SCSI node. Give a _device_, preferably a /dev entry, for the parameter of the -d flag."); 592 606 } 593 if ( flag_set['O']) {607 if ((flag_set['O']) && (! bkpinfo->restore_data)) { 594 608 if (flag_set['s']) { 595 609 if (flag_set['t']) { … … 609 623 } 610 624 } 611 } else {/* CD|USB size */625 } else if (! bkpinfo->restore_data) { /* CD|USB size */ 612 626 if (flag_set['s']) { 613 627 if (process_the_s_switch(flag_val['s'])) { … … 619 633 } /* CD-RW */ 620 634 } 635 621 636 if (flag_set['n']) { 622 637 strncpy(bkpinfo->nfs_mount, flag_val['n'], MAX_STR_LEN); … … 636 651 log_msg(3, "isodir= %s", bkpinfo->isodir); 637 652 } 653 638 654 if (flag_set['c']) { 639 655 bkpinfo->backup_media_type = cdr; … … 702 718 q++; 703 719 /* End of bug fix */ 704 if ( stat(p, &buf) != 0) {720 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 705 721 log_msg(1, "WARNING ! %s doesn't exist", p); 706 722 } 707 723 p = q+1 ; 708 724 } else { 709 if ( stat(p, &buf) != 0) {725 if ((stat(p, &buf) != 0) && (! bkpinfo->restore_data)) { 710 726 log_msg(1, "WARNING ! %s doesn't exist", p); 711 727 } … … 719 735 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths)); 720 736 } 737 721 738 if (flag_set['e']) { 722 739 bkpinfo->please_dont_eject = TRUE; 723 740 } 724 if (flag_set['N']) // exclude NFS mounts & devices 741 742 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude NFS mounts & devices 725 743 { 726 744 // strncpy(psz, list_of_NFS_devices_and_mounts(), MAX_STR_LEN); … … 733 751 bkpinfo->exclude_paths); 734 752 } 753 735 754 if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) { 736 755 fatal_error 737 756 ("Your '-E' parameter is too long. Increase MAX_STR_LEN"); 738 757 } 758 739 759 if (flag_set['b']) { 740 760 strcpy(psz, flag_val['b']); … … 754 774 bkpinfo->internal_tape_block_size = itbs; 755 775 } 756 if (flag_set['D']) { 776 777 if ((flag_set['D']) && (! bkpinfo->restore_data)) { 757 778 bkpinfo->differential = 1; 758 779 // bkpinfo->differential = atoi (flag_val['D']); … … 762 783 } 763 784 } 785 764 786 if (flag_set['x']) { 765 787 strncpy(bkpinfo->image_devs, flag_val['x'], MAX_STR_LEN / 4); 766 if ( run_program_and_log_output("which ntfsclone", 2)) {788 if ((run_program_and_log_output("which ntfsclone", 2)) && (! bkpinfo->restore_data)) { 767 789 fatal_error("Please install ntfsprogs package/tarball."); 768 790 } 769 791 } 792 770 793 if (flag_set['m']) { 771 794 bkpinfo->manual_cd_tray = TRUE; 772 795 } 773 if (flag_set['k']) { 796 797 if ((flag_set['k']) && (! bkpinfo->restore_data)) { 774 798 strncpy(bkpinfo->kernel_path, flag_val['k'], MAX_STR_LEN); 775 799 if (!strcmp(bkpinfo->kernel_path, "failsafe")) { … … 785 809 } 786 810 } 811 787 812 if (flag_set['p']) { 788 813 strncpy(bkpinfo->prefix, flag_val['p'], MAX_STR_LEN / 4); 789 814 log_msg(1,"Prefix forced to %s",bkpinfo->prefix); 790 815 } 791 792 816 793 817 if (flag_set['d']) { /* backup directory (if ISO/NFS) */ … … 802 826 strncpy(bkpinfo->nfs_remote_dir, flag_val['d'], MAX_STR_LEN); 803 827 } else { /* backup device (if tape/CD-R/CD-RW) */ 804 805 828 strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4); 806 829 } 807 830 } 808 831 809 if ( flag_set['n']) {832 if ((flag_set['n']) && (! bkpinfo->restore_data)) { 810 833 asprintf(&tmp1,"%s/%s/.dummy.txt", bkpinfo->isodir,bkpinfo->nfs_remote_dir); 811 834 sprintf(tmp, "echo hi > %s", tmp1); … … 840 863 } 841 864 842 if ( !flag_set['d'] && !flag_set['n'] && !flag_set['C']) {865 if ((!flag_set['d'] && !flag_set['n'] && !flag_set['C']) && (! bkpinfo->restore_data)) { 843 866 retval++; 844 867 log_to_screen("Please specify the backup device/directory.\n"); … … 846 869 ("You didn't use -d to specify the backup device/directory."); 847 870 } 848 /* optional, obscure */ 871 849 872 for (i = '0'; i <= '9'; i++) { 850 873 if (flag_set[i]) { … … 852 875 } /* not '\0' but '0' */ 853 876 } 877 854 878 if (flag_set['S']) { 855 879 sprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%ld", flag_val['S'], 856 880 random() % 32768); 857 881 } 882 858 883 if (flag_set['T']) { 859 884 setup_tmpdir(flag_val['T']); … … 873 898 } 874 899 } 875 if (flag_set['A']) { 900 901 if ((flag_set['A']) && (! bkpinfo->restore_data)) { 876 902 strncpy(bkpinfo->call_after_iso, flag_val['A'], MAX_STR_LEN); 877 903 } 878 if (flag_set['B']) { 904 905 if ((flag_set['B']) && (! bkpinfo->restore_data)) { 879 906 strncpy(bkpinfo->call_before_iso, flag_val['B'], MAX_STR_LEN); 880 907 } 881 if (flag_set['H']) { 908 909 if ((flag_set['H']) && (! bkpinfo->restore_data)) { 882 910 g_cd_recovery = TRUE; 883 911 } 884 if (flag_set['l']) { 912 913 if ((flag_set['l']) && (! bkpinfo->restore_data)) { 885 914 #ifdef __FreeBSD__ 886 915 # define BOOT_LOADER_CHARS "GLBMR" … … 902 931 #undef BOOT_LOADER_CHARS 903 932 } 933 904 934 if (flag_set['f']) { 905 935 strncpy(bkpinfo->boot_device, … … 908 938 MAX_STR_LEN / 4); 909 939 } 910 if (flag_set['P']) { 940 941 if ((flag_set['P']) && (! bkpinfo->restore_data)) { 911 942 strncpy(bkpinfo->postnuke_tarball, flag_val['P'], MAX_STR_LEN); 912 943 } 944 913 945 if (flag_set['Q']) { 914 946 i = which_boot_loader(tmp); … … 917 949 finish(0); 918 950 } 919 if (flag_set['L']) { 951 952 if ((flag_set['L']) && (! bkpinfo->restore_data)) { 920 953 bkpinfo->use_lzo = TRUE; 921 954 if (run_program_and_log_output("which lzop", 2)) { … … 926 959 } 927 960 928 if ( flag_set['G']) {961 if ((flag_set['G']) && (! bkpinfo->restore_data)) { 929 962 bkpinfo->use_gzip = TRUE; 930 963 if (run_program_and_log_output("which gzip", 2)) { … … 937 970 bkpinfo->use_obdr = FALSE; 938 971 if (flag_set['o']) { 939 if ( !flag_set['t']) {972 if ((!flag_set['t']) && (! bkpinfo->restore_data)) { 940 973 log_to_screen("OBDR support is only available for tapes. Use the -t option"); 941 974 fatal_error("Aborting"); … … 943 976 bkpinfo->use_obdr = TRUE; 944 977 } 978 945 979 #ifndef __FreeBSD__ 946 if ( !is_this_a_valid_disk_format("vfat")) {980 if ((!is_this_a_valid_disk_format("vfat")) && (! bkpinfo->restore_data)) { 947 981 bkpinfo->make_cd_use_lilo = TRUE; 948 982 log_to_screen … … 951 985 ("using LILO instead of SYSLINUX as the media boot loader."); 952 986 } 953 if ( run_program_and_log_output("which mkfs.vfat", 2)) {987 if ((run_program_and_log_output("which mkfs.vfat", 2)) && (! bkpinfo->restore_data)) { 954 988 bkpinfo->make_cd_use_lilo = TRUE; 955 989 #ifdef __IA32__ … … 976 1010 } 977 1011 978 if ( ! bkpinfo->restore_data) {1012 if (! bkpinfo->restore_data) { 979 1013 i = flag_set['O'] + flag_set['V']; 980 1014 if (i == 0) { 981 1015 retval++; 982 1016 log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n"); 1017 } 1018 } 1019 1020 if ((! bkpinfo->restore_data) && (flag_set['Z'])) { 1021 fatal_error 1022 ("The -Z switch is only valid in restore mode"); 1023 } 1024 1025 if (flag_set['Z']) { 1026 if (! strcmp(flag_val['Z'], "nuke")) { 1027 bkpinfo->restore_mode = nuke; 1028 } else if (! strcmp(flag_val['Z'], "interactive")) { 1029 bkpinfo->restore_mode = interactive; 1030 } else if (! strcmp(flag_val['Z'], "compare")) { 1031 bkpinfo->restore_mode = compare; 1032 } else if (! strcmp(flag_val['Z'], "mbr")) { 1033 bkpinfo->restore_mode = mbr; 1034 } else if (! strcmp(flag_val['Z'], "iso")) { 1035 bkpinfo->restore_mode = isoonly; 1036 } else if (! strcmp(flag_val['Z'], "isonuke")) { 1037 bkpinfo->restore_mode = isonuke; 1038 } else { 1039 bkpinfo->restore_mode = interactive; 983 1040 } 984 1041 } … … 1078 1135 void help_screen() 1079 1136 { 1080 log_msg(1, "Type 'man mondo -archive' for more information\n");1137 log_msg(1, "Type 'man mondoarchive' for more information\n"); 1081 1138 exit(1); 1082 1139 } … … 1137 1194 } 1138 1195 kill_buffer(); 1196 1197 free_MR_global_filenames(); 1198 1139 1199 fatal_error 1140 ("Mondo archive is terminating in response to a signal from the OS");1200 ("MondoRescue is terminating in response to a signal from the OS"); 1141 1201 finish(254); // just in case 1142 1202 } -
branches/2.2.6/mondo/src/common/libmondo-filelist.c
r1920 r1967 1767 1767 snprintf(exclude_paths, (size_t)8*MAX_STR_LEN," %s %s %s %s %s . .. \ 1768 1768 " MNT_CDROM " " MNT_FLOPPY " /media /tmp \ 1769 /proc /sys / root/images/mondo " MINDI_CACHE, MONDO_CACHE, excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);1769 /proc /sys /var/cache/mondo " MINDI_CACHE, MONDO_CACHE, excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1770 1770 paranoid_free(tmp2); 1771 1771 -
branches/2.2.6/mondo/src/common/libmondo-tools.c
r1966 r1967 806 806 807 807 void setup_tmpdir(char *path) { 808 808 809 809 char *tmp = NULL; 810 810 char *p = NULL; … … 816 816 paranoid_free(tmp); 817 817 } 818 818 819 819 if (path != NULL) { 820 820 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", path); … … 871 871 strcpy(bkpinfo->isodir, "/"); 872 872 } else { 873 strcpy(bkpinfo->isodir, "/ root/images/mondo");873 strcpy(bkpinfo->isodir, "/var/cache/mondo"); 874 874 } 875 875 strcpy(bkpinfo->prefix, STD_PREFIX); … … 898 898 bkpinfo->make_cd_use_lilo = FALSE; 899 899 bkpinfo->use_obdr = FALSE; 900 bkpinfo->restore_mode = interactive; 900 901 } 901 902 -
branches/2.2.6/mondo/src/common/mondostructures.h
r1948 r1967 151 151 */ 152 152 int index; 153 153 154 154 /** 155 155 * Type of disk. 156 156 */ 157 157 char type; // ' ' = data (default), S = spare, F = faulty 158 158 159 159 }; 160 160 … … 197 197 } t_archtype; 198 198 199 /** 200 * A type of file in the catalog of recent archives. 201 */ 202 typedef enum { 203 nuke = 0, /// Nuke mode 204 interactive, /// Interactive mode 205 compare, /// Compare mode 206 mbr, /// MBR mode 207 isoonly, /// ISO mode 208 isonuke, /// ISO+Nuke mode 209 } t_restore_mode; 210 199 211 200 212 #ifdef __FreeBSD__ … … 249 261 */ 250 262 int chunk_size; 251 263 252 264 /** 253 265 * The parity algorithm of this RAID device. (RAID5 only) … … 571 583 bool wipe_media_first; 572 584 573 // patch by Herman Kuster 585 // patch by Herman Kuster 574 586 /** 575 587 * The differential level of this backup. Currently only 0 (full backup) and 1 … … 577 589 */ 578 590 int differential; 579 // end patch 591 // end patch 580 592 581 593 /** … … 611 623 */ 612 624 bool use_obdr; 625 626 /** 627 * Nature of the restore 628 */ 629 t_restore_mode restore_mode; 613 630 }; 614 631 -
branches/2.2.6/mondo/src/mondoarchive/mondoarchive.c
r1930 r1967 72 72 struct s_bkpinfo *bkpinfo; 73 73 74 /* To be coded */ 75 void free_MR_global_filenames(void) { 76 } 77 74 78 /****************** subroutines used only by main.c ******************/ 75 79 -
branches/2.2.6/mondo/src/mondoarchive/mondoarchive.h
r1917 r1967 9 9 */ 10 10 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 11 char *MONDO_OPTIONS = "0123456789A:B:C:DE: FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";11 char *MONDO_OPTIONS = "0123456789A:B:C:DE:GHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"; 12 12 13 13 /* No restriction on ps options */ -
branches/2.2.6/mondo/src/mondorestore/mondo-rstr-newt.c
r1741 r1967 2330 2330 * @param isodir_device Where to put the device (e.g. /dev/hda4) the user enters. 2331 2331 * @param isodir_format Where to put the format (e.g. ext2) the user enters. 2332 * @param isodir_path Where to put the path (e.g. / root/images/mondo) the user enters.2332 * @param isodir_path Where to put the path (e.g. /var/cache/mondo) the user enters. 2333 2333 * @param nuke_me_please Whether we're planning on nuking or not. 2334 2334 * @return TRUE if OK was pressed, FALSE otherwise. -
branches/2.2.6/mondo/src/mondorestore/mondo-rstr-tools.c
r1948 r1967 177 177 * Free the malloc()s for the filename variables. 178 178 */ 179 void free_MR_global_filenames( )179 void free_MR_global_filenames(void) 180 180 { 181 181 paranoid_free(g_biggielist_txt); 182 182 paranoid_free(g_filelist_full); 183 183 paranoid_free(g_filelist_imagedevs); 184 // paranoid_free (g_imagedevs_pot );185 184 paranoid_free(g_imagedevs_restthese); 186 185 paranoid_free(g_mondo_cfg_file); … … 1973 1972 1974 1973 1975 1976 1977 /**1978 * Turn signal trapping on or off.1979 * @param on If TRUE, then do full cleanup when we receive a signal; if FALSE, then1980 * print a message and exit immediately.1981 */1982 void set_signals(int on)1983 {1984 int signals[] =1985 { SIGKILL, SIGPIPE, SIGTERM, SIGHUP, SIGTRAP, SIGABRT, SIGINT,1986 SIGSTOP, 0 };1987 int i;1988 for (i = 0; signals[i]; i++) {1989 if (on) {1990 signal(signals[i], terminate_daemon);1991 } else {1992 signal(signals[i], termination_in_progress);1993 }1994 }1995 }1996 1997 /**************************************************************************1998 *END_SET_SIGNALS *1999 **************************************************************************/2000 2001 2002 1974 /** 2003 1975 * malloc() and set sensible defaults for the mondorestore filename variables. … … 2092 2064 2093 2065 /** 2094 * Exit due to a signal (normal cleanup).2095 * @param sig The signal we're exiting due to.2096 */2097 void terminate_daemon(int sig)2098 {2099 log_to_screen2100 ("Mondorestore is terminating in response to a signal from the OS");2101 paranoid_MR_finish(254);2102 }2103 2104 /**************************************************************************2105 *END_TERMINATE_DAEMON *2106 **************************************************************************/2107 2108 2109 /**2110 2066 * Give the user twenty seconds to press Ctrl-Alt-Del before we nuke their drives. 2111 2067 */ … … 2137 2093 *END_TWENTY_SECONDS_TIL_YIKES * 2138 2094 **************************************************************************/ 2139 2140 2141 2142 2143 2144 /**2145 * Exit due to a signal (no cleanup).2146 * @param sig The signal we're exiting due to.2147 */2148 void termination_in_progress(int sig)2149 {2150 log_msg(1, "Termination in progress");2151 usleep(1000);2152 pthread_exit(0);2153 }2154 2155 /**************************************************************************2156 *END_TERMINATION_IN_PROGRESS *2157 **************************************************************************/2158 2159 2095 2160 2096 -
branches/2.2.6/mondo/src/mondorestore/mondorestore.c
r1966 r1967 3160 3160 finish(res); 3161 3161 } 3162 3162 3163 3163 if ((argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) && (!bkpinfo->disaster_recovery)) { 3164 3164 g_restoring_live_from_cd = TRUE; … … 3205 3205 3206 3206 // BCO:To be reviewed 3207 if (argc > 1 3208 && (strcmp(argv[1], "--compare") == 0 3209 || strcmp(argv[1], "--nuke") == 0)) { 3207 if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) { 3210 3208 if (bkpinfo->backup_media_type == nfs 3211 3209 && !is_this_device_mounted(bkpinfo->nfs_mount)) { … … 3227 3225 3228 3226 3229 if ( argc == 2 && strcmp(argv[1], "--nuke") == 0) {3227 if (bkpinfo->restore_mode == nuke) { 3230 3228 iamhere("nuking"); 3231 3229 retval += nuke_mode(mountlist, raidlist); 3232 } else if ( argc == 2 && strcmp(argv[1], "--interactive") == 0) {3230 } else if (bkpinfo->restore_mode == interactive) { 3233 3231 iamhere("catchall"); 3234 3232 retval += catchall_mode(mountlist, raidlist); 3235 } else if ( argc == 2 && strcmp(argv[1], "--compare") == 0) {3233 } else if (bkpinfo->restore_mode == compare) { 3236 3234 iamhere("compare"); 3237 3235 retval += compare_mode(mountlist, raidlist); 3238 } else if ( argc == 2 && strcmp(argv[1], "--iso") == 0) {3236 } else if (bkpinfo->restore_mode == isoonly) { 3239 3237 iamhere("iso"); 3240 3238 retval = iso_mode(mountlist, raidlist, FALSE); 3241 } else if ( argc == 2 && strcmp(argv[1], "--mbr") == 0) {3239 } else if (bkpinfo->restore_mode == mbr) { 3242 3240 iamhere("mbr"); 3243 3241 retval = mount_all_devices(mountlist, TRUE); … … 3249 3247 log_to_screen("Failed to write Master Boot Record"); 3250 3248 } 3251 } else if ( argc == 2 && strcmp(argv[1], "--isonuke") == 0) {3249 } else if (bkpinfo->restore_mode == isonuke) { 3252 3250 iamhere("isonuke"); 3253 3251 retval = iso_mode(mountlist, raidlist, TRUE); 3254 } else if (argc != 1) {3255 log_to_screen("Invalid paremeters");3256 paranoid_MR_finish(1);3257 3252 } else { 3258 3253 iamhere("catchall (no mode specified in command-line call"); -
branches/2.2.6/mondo/src/mondorestore/mondorestore.h
r1644 r1967 9 9 */ 10 10 char *MONDO_LOGFILE = "/var/log/mondorestore.log"; 11 char *MONDO_OPTIONS = "E:GI:J:K:QRT:UVZ:b:d:ef:gimn:op:tux:z"; 11 12 12 13 /* Busybox ps has no option and PID in first pos */
Note:
See TracChangeset
for help on using the changeset viewer.