Changeset 1967 in MondoRescue for branches/2.2.6/mondo/src/mondorestore
- Timestamp:
- May 29, 2008, 5:40:05 PM (16 years ago)
- Location:
- branches/2.2.6/mondo/src/mondorestore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.