Ignore:
Timestamp:
Jun 17, 2014, 9:10:18 PM (10 years ago)
Author:
Bruno Cornec
Message:
  • Fix a usage of mountlist.txt still with MINDI_CACHE, incorrect for now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c

    r3299 r3301  
    587587* up correctly on the first boot.
    588588*/
    589 void protect_against_braindead_sysadmins()
    590 {
    591 run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct",
    592                        FALSE);
    593 run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct",
    594                        FALSE);
     589void protect_against_braindead_sysadmins() {
     590
     591run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct", FALSE);
     592run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct", FALSE);
    595593if (run_program_and_log_output("ls " MNT_RESTORING " /tmp", FALSE)) {
    596 run_program_and_log_output("chmod 1777 " MNT_RESTORING "/tmp",
    597                            FALSE);
    598 }
    599 run_program_and_log_output("mkdir -p " MNT_RESTORING
    600                        "/var/run/console", FALSE);
    601 run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null",
    602                        FALSE);
    603 run_program_and_log_output("cd " MNT_RESTORING
    604                        "; for i in `ls home/`; do echo \"Moving $i's spurious files to $i/.disabled\"; mkdir \"$i\"/.disabled ; mv -f \"$i\"/.DCOP* \"$i\"/.MCOP* \"$i\"/.*authority \"$i\"/.kde/tmp* \"$i\"/.kde/socket* \"$i\"/.disabled/ ; done",
    605                        TRUE);
    606 run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid",
    607                        TRUE);
    608 run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*",
    609                        TRUE);
     594    run_program_and_log_output("chmod 1777 " MNT_RESTORING "/tmp", FALSE);
     595}
     596run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/run/console", FALSE);
     597run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", FALSE);
     598run_program_and_log_output("cd " MNT_RESTORING "; for i in `ls home/`; do echo \"Moving $i's spurious files to $i/.disabled\"; mkdir \"$i\"/.disabled ; mv -f \"$i\"/.DCOP* \"$i\"/.MCOP* \"$i\"/.*authority \"$i\"/.kde/tmp* \"$i\"/.kde/socket* \"$i\"/.disabled/ ; done", TRUE);
     599run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid", TRUE);
     600run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*", TRUE);
    610601}
    611602
     
    19031894
    19041895    mountlist = malloc(sizeof(struct mountlist_itself));
    1905     memcpy((void *) mountlist, (void *) p_external_copy_of_mountlist,
    1906            sizeof(struct mountlist_itself));
     1896    memcpy((void *) mountlist, (void *) p_external_copy_of_mountlist, sizeof(struct mountlist_itself));
    19071897    sort_mountlist_by_mountpoint(mountlist, 0);
    19081898
    19091899    run_program_and_log_output("df -m -P", 3);
    19101900    mvaddstr_and_log_it(g_currentY, 0, "Unmounting devices      ");
    1911     open_progress_form("Unmounting devices",
    1912                        "Unmounting all devices that were mounted,",
    1913                        "in preparation for the post-restoration reboot.",
    1914                        "", mountlist->entries);
     1901    open_progress_form("Unmounting devices", "Unmounting all devices that were mounted,", "in preparation for the post-restoration reboot.", "", mountlist->entries);
    19151902    if (chdir("/")) {
    19161903        // FIXME
    19171904    }
    1918     for (i = 0;
    1919          i < 10
    1920          &&
    1921          run_program_and_log_output
    1922          ("ps | grep buffer | grep -v \"grep buffer\"", TRUE) == 0;
    1923          i++) {
     1905    for (i = 0; i < 10 && run_program_and_log_output("ps | grep buffer | grep -v \"grep buffer\"", TRUE) == 0; i++) {
    19241906        sleep(1);
    19251907        log_msg(2, "Waiting for buffer() to finish");
     
    19301912    mr_asprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE);
    19311913    if (run_program_and_log_output(tmp, FALSE)) {
    1932         log_msg(1,
    1933                 "Error. Failed to copy log to PC's /var/log dir. (Mounted read-only?)");
     1914        log_msg(1, "Error. Failed to copy log to PC's /var/log dir. (Mounted read-only?)");
    19341915    }
    19351916    paranoid_free(tmp);
    19361917    if (does_file_exist("/tmp/DUMBASS-GENTOO")) {
    1937         run_program_and_log_output("mkdir -p " MNT_RESTORING
    1938                                    "/mnt/.boot.d", 5);
     1918        run_program_and_log_output("mkdir -p " MNT_RESTORING "/mnt/.boot.d", 5);
    19391919    }
    19401920
Note: See TracChangeset for help on using the changeset viewer.