Changeset 3301 in MondoRescue for branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Jun 17, 2014, 9:10:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c
r3299 r3301 587 587 * up correctly on the first boot. 588 588 */ 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); 589 void protect_against_braindead_sysadmins() { 590 591 run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct", FALSE); 592 run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct", FALSE); 595 593 if (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 } 596 run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/run/console", FALSE); 597 run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", FALSE); 598 run_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); 599 run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid", TRUE); 600 run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*", TRUE); 610 601 } 611 602 … … 1903 1894 1904 1895 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)); 1907 1897 sort_mountlist_by_mountpoint(mountlist, 0); 1908 1898 1909 1899 run_program_and_log_output("df -m -P", 3); 1910 1900 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); 1915 1902 if (chdir("/")) { 1916 1903 // FIXME 1917 1904 } 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++) { 1924 1906 sleep(1); 1925 1907 log_msg(2, "Waiting for buffer() to finish"); … … 1930 1912 mr_asprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE); 1931 1913 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?)"); 1934 1915 } 1935 1916 paranoid_free(tmp); 1936 1917 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); 1939 1919 } 1940 1920
Note:
See TracChangeset
for help on using the changeset viewer.