Ignore:
Timestamp:
Apr 17, 2007, 12:08:14 AM (12 years ago)
Author:
bruno
Message:
  • MONDO_LOGFILE is rather a char* exported by each main program (consolidation of those mecanisms in .h files with ps_*)
  • One include has been created for each binary containing only the specific declarations
  • Log files are now consistent: mondoarchive.log for mondoarchive (containing also mindi.log) and mondorestore.log for mondorestore (copied from /tmp (ram) to /var/log (disk) at the end of the restore)
  • Doc updated accordingly
  • LOGFILE in restore process is now passed in the environment and not duplicated a nymore
  • LogIt? is not redifined either
  • LOGFILE should be put in environment by mondoarchive for mindi's usage but that's a step left for later.
  • label-partitions-as-necessary should now work correctly for LABEL and UUID (grep -w removed)
  • Remove useless script compare-me

(All coming from 2.2.2) (remains changes in my-stuff.h coming later on)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-prep.c

    r1304 r1326  
    4646extern bool g_text_mode;
    4747extern void pause_for_N_seconds(int, char *);
     48extern char *MONDO_LOGFILE;
    4849
    4950FILE *g_fprep = NULL;
     
    218219    }
    219220    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);
    222222    mr_free(lvscan_sz);
    223223    mr_free(lvremove_sz);
     
    228228    sleep(1);
    229229    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);
    232231    mr_free(vgchange_sz);
    233232    mr_free(vgremove_sz);
     
    311310                lvmversion = 2;
    312311            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);
    315315            } 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);
    318319            }
    319320            for (p = tmp; *p != '\0' && !isdigit(*p); p++);
Note: See TracChangeset for help on using the changeset viewer.