Changeset 1326 in MondoRescue
- Timestamp:
- Apr 17, 2007, 12:08:14 AM (18 years ago)
- Location:
- branches/stable
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r1312 r1326 426 426 echo "Mindi $MINDI_VERSION is exiting" >> $LOGFILE 427 427 echo "End date : `date`" >> $LOGFILE 428 if [ "`DidMondoCallMe`" ] ; then 429 cat $LOGFILE >> /var/log/mondoarchive.log 430 fi 428 431 429 432 sync … … 448 451 fi 449 452 450 # Creates a tar file containing all required files 451 for i in $MY_FSTAB /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log ; do 452 [ -e "$i" ] && cp -f $i $MINDI_TMP 2>> $LOGFILE 453 done 454 rm -f $TMPDIR/mindi.err.*.tgz 455 tar -cf - $MINDI_TMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz 456 LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list." 453 LogIt "Please e-mail a copy of $LOGFILE to the mailing list." 457 454 LogIt "See http://www.mondorescue.org for more information." 458 455 LogIt "WE CANNOT HELP unless you enclose that file.\n" … … 3028 3025 mount >> $LOGFILE 3029 3026 echo "-------------" >> $LOGFILE 3027 if [ -e /etc/raidtab ]; then 3028 echo "-------------" >> $LOGFILE 3029 echo "/etc/raidtab content:" >> $LOGFILE 3030 echo "-------------" >> $LOGFILE 3031 cat /etc/raidtab >> $LOGFILE 3032 fi 3033 echo "-------------" >> $LOGFILE 3030 3034 echo "lsmod result:" >> $LOGFILE 3031 3035 echo "-------------" >> $LOGFILE … … 3182 3186 LogIt "BusyBox sources are available from http://www.busybox.net" 3183 3187 else 3184 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> /var/log/mondo-archive.log3188 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> $LOGFILE 3185 3189 fi 3186 3190 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then -
branches/stable/mondo/src/common/libmondo-archive.c
r1302 r1326 84 84 extern char *g_getfacl; 85 85 extern char *g_getfattr; 86 extern char *MONDO_LOGFILE; 86 87 87 88 … … 1789 1790 } else { 1790 1791 log_to_screen("%s...OK", message_to_screen); 1791 if (!run_program_and_log_output 1792 ("tail -n10 /var/log/mondo-archive.log | grep -F ':-('", 1793 1)) { 1792 sprintf(tmp, "tail -n10 %s | grep -F ':-('", MONDO_LOGFILE); 1793 if (!run_program_and_log_output(tmp, 1)) { 1794 1794 log_to_screen 1795 1795 ("Despite nonfatal errors, growisofs confirms the write was successful."); -
branches/stable/mondo/src/common/libmondo-filelist.c
r1283 r1326 35 35 #define MAX_SKEL_DEPTH 3 36 36 37 38 extern char *MONDO_LOGFILE; 37 39 38 40 int mondo_makefilelist(char *logfile, char *tmpdir, char *scratchdir, -
branches/stable/mondo/src/common/newt-specific.c
r1293 r1326 31 31 #include "libmondo-fork-EXT.h" 32 32 #include "newt-specific-EXT.h" 33 34 extern char *MONDO_LOGFILE; 33 35 34 36 /*@unused@*/ … … 344 346 printf(_("The list's members can help you, if you attach that file to your e-mail.\n")); 345 347 printf(_("Log file: %s\n"), MONDO_LOGFILE); 346 /*347 system348 ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null");349 if (does_file_exist("/tmp/MA.log.gz")) {350 printf351 ("FYI, I have gzipped the log and saved it to /tmp/MA.log.gz\n");352 }353 */354 348 printf(_("Mondo has aborted.\n")); 355 349 register_pid(0, "mondo"); // finish() does this too, FYI -
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1269 r1326 57 57 bool g_skip_floppies; 58 58 long diffs; 59 char *ps_options = "auxww";60 char *ps_proc_id = "$2";61 59 62 60 /****************** subroutines used only here ******************/ -
branches/stable/mondo/src/mondoarchive/mondoarchive.h
r1256 r1326 12 12 #define MONDO_CONF_DIR "/usr/local/etc/mondo" 13 13 #endif 14 15 /** 16 * Compatibility #define to ease the transition to logfile-in-a-variable. 17 */ 18 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 19 20 /* No restriction on ps options */ 21 char *ps_options = "auxww"; 22 char *ps_proc_id = "$2"; -
branches/stable/mondo/src/mondorestore/mondo-prep.c
r1304 r1326 46 46 extern bool g_text_mode; 47 47 extern void pause_for_N_seconds(int, char *); 48 extern char *MONDO_LOGFILE; 48 49 49 50 FILE *g_fprep = NULL; … … 218 219 } 219 220 mr_asprintf(&command, 220 "for i in `%s | cut -d\"'\" -f2 | sort -r` ; do echo \"Shutting down lv $i\" >> " 221 MONDO_LOGFILE "; %s -f $i; done", lvscan_sz, lvremove_sz); 221 "for i in `%s | cut -d\"'\" -f2 | sort -r` ; do echo \"Shutting down lv $i\" >> %s ; %s -f $i; done", lvscan_sz, MONDO_LOGFILE, lvremove_sz); 222 222 mr_free(lvscan_sz); 223 223 mr_free(lvremove_sz); … … 228 228 sleep(1); 229 229 mr_asprintf(&command, 230 "for i in `%s | grep -i lvm | cut -d'\"' -f2` ; do %s -a n $i ; %s $i; echo \"Shutting down vg $i\" >> " 231 MONDO_LOGFILE "; done", vgscan_sz, vgchange_sz, vgremove_sz); 230 "for i in `%s | grep -i lvm | cut -d'\"' -f2` ; do %s -a n $i ; %s $i; echo \"Shutting down vg $i\" >> %s ; done", vgscan_sz, vgchange_sz, vgremove_sz, MONDO_LOGFILE); 232 231 mr_free(vgchange_sz); 233 232 mr_free(vgremove_sz); … … 311 310 lvmversion = 2; 312 311 if (lvmversion == 2) { 313 mr_asprintf(&tmp, call_program_and_get_last_line_of_output 314 ("tail -n5 " MONDO_LOGFILE " | grep Insufficient | tail -n1")); 312 mr_asprintf(&tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE); 313 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(tmp1)); 314 free(tmp1); 315 315 } else { 316 mr_asprintf(&tmp, call_program_and_get_last_line_of_output 317 ("tail -n5 " MONDO_LOGFILE " | grep lvcreate | tail -n1")); 316 mr_asprintf(&tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE); 317 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(tmp1)); 318 free(tmp1); 318 319 } 319 320 for (p = tmp; *p != '\0' && !isdigit(*p); p++); -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c
r1293 r1326 15 15 #include "mondo-rstr-tools-EXT.h" 16 16 17 extern char *MONDO_LOGFILE; 18 17 19 //static char cvsid[] = "$Id$"; 18 20 … … 90 92 } 91 93 mr_asprintf(&command, 92 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors .txt",94 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors", 93 95 MNT_RESTORING, bigfile_fname); 94 96 mr_msg(2, command); 95 97 if (system(command)) { 96 98 log_OS_error("Warning - command failed"); 97 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 99 mr_asprintf(&tmp, "cat /tmp/errors >> %s 2> /dev/null", MONDO_LOGFILE); 100 paranoid_system(tmp); 101 mr_free(tmp); 98 102 mr_free(command); 99 103 mr_free(bigfile_fname); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1275 r1326 44 44 45 45 extern int g_partition_table_locked_up; 46 extern char *MONDO_LOGFILE; 46 47 47 48 /* Should we use or not extended attributes and acl when restoring */ … … 1476 1477 mvaddstr_and_log_it(g_currentY++, 74, _("Failed.")); 1477 1478 log_to_screen 1478 (_ 1479 ("GRUB ran w/error(s). See /tmp/mondo-restore.log for more info.")); 1479 (_("GRUB ran w/error(s). See %s for more info.", MONDO_LOGFILE)); 1480 1480 mr_msg(1, "Type:-"); 1481 1481 mr_msg(1, " mount-me"); … … 1745 1745 mvaddstr_and_log_it(g_currentY++, 74, _("Failed.")); 1746 1746 log_to_screen 1747 (_ 1748 ("MBR+fstab processed w/error(s). See /tmp/mondo-restore.log for more info.")); 1747 (_("MBR+fstab processed w/error(s). See %s for more info.", MONDO_LOGFILE)); 1749 1748 } else { 1750 1749 mvaddstr_and_log_it(g_currentY++, 74, _("Done.")); … … 1976 1975 sync(); 1977 1976 1978 if (run_program_and_log_output1979 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/tmp/", FALSE)) {1977 sprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE); 1978 if (run_program_and_log_output(tmp, FALSE)) { 1980 1979 mr_msg(1, 1981 "Error. Failed to copy log to PC's /tmp dir. (Mounted read-only?)"); 1982 } 1983 if (run_program_and_log_output 1984 ("cp -f /tmp/mondo-restore.log " MNT_RESTORING "/root/", FALSE)) { 1985 mr_msg(1, 1986 "Error. Failed to copy log to PC's /root dir. (Mounted read-only?)"); 1980 "Error. Failed to copy log to PC's /var/log dir. (Mounted read-only?)"); 1987 1981 } 1988 1982 if (does_file_exist("/tmp/DUMBASS-GENTOO")) { -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1297 r1326 26 26 #include "mr-externs.h" 27 27 #include "mondo-restore.h" 28 #include "mondorestore.h" 28 29 #include "mondo-rstr-compare-EXT.h" 29 30 #include "mondo-rstr-tools-EXT.h" … … 119 120 */ 120 121 char *g_mountlist_fname = NULL; 121 122 /* Busybox ps has no option and PID in first pos */123 char *ps_options = "";124 char *ps_proc_id = "$1";125 122 126 123 extern char *g_getfacl; … … 2874 2871 make_hole_for_dir("/tmp/tmpfs"); /* just in case... */ 2875 2872 run_program_and_log_output("umount " MNT_CDROM, FALSE); 2876 run_program_and_log_output2877 ("ln -sf /var/log/mondo-archive.log /tmp/mondo-restore.log",2878 FALSE);2879 2873 2880 2874 run_program_and_log_output("rm -Rf /tmp/tmpfs/mondo.tmp.*", FALSE); … … 3225 3219 3226 3220 log_to_screen 3227 (_("Restore log copied to /tmp/mondo-restore.log on your hard disk"));3221 (_("Restore log (%s) copied to /var/log on your hard disk"), MONDO_LOGFILE); 3228 3222 log_to_screen(_("Mondo-restore is exiting (retval=%d)"), retval); 3229 3223
Note:
See TracChangeset
for help on using the changeset viewer.