Changeset 1579


Ignore:
Timestamp:
Jul 27, 2007, 1:19:42 AM (12 years ago)
Author:
bruno
Message:

Remove the useless modify_rclocal_one_time

Location:
branches/2.2.5/mondo/src/mondorestore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondorestore/mondo-restore.c

    r1547 r1579  
    614614    clean_blkid(bkpinfo);
    615615    protect_against_braindead_sysadmins();
    616     //  modify_rclocal_one_time( MNT_RESTORING "/etc" );
    617616    retval += unmount_all_devices(mountlist);
    618617    /*  if (restore_some || restore_all || */
     
    853852    clean_blkid(bkpinfo);
    854853    protect_against_braindead_sysadmins();
    855     //  modify_rclocal_one_time( MNT_RESTORING "/etc" );
    856854    retval += unmount_all_devices(mountlist);
    857855    mvaddstr_and_log_it(g_currentY,
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r912 r1579  
    88extern int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please);
    99extern void kill_petris(void);
    10 extern int modify_rclocal_one_time(char *path);
    1110extern int mount_cdrom(struct s_bkpinfo *bkpinfo);
    1211extern int mount_all_devices(struct mountlist_itself *, bool);
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c

    r1547 r1579  
    526526*END_KILL_PETRIS                                                         *
    527527**************************************************************************/
    528 
    529 
    530 /**
    531 * (Disabled) Modify rc.local to fix some things on first boot.
    532 * This function currently doesn't do anything except make sure /tmp has the
    533 * right permissions.
    534 * @param path The path to /etc on the user's filesystem.
    535 * @return 0 for success, nonzero for failure.
    536 */
    537 int modify_rclocal_one_time(char *path)
    538 {
    539 /** malloc **/
    540 char *rclocal_fname;
    541 char *newfile_fname;
    542 char *tmp;
    543 
    544 malloc_string(rclocal_fname);
    545 malloc_string(newfile_fname);
    546 malloc_string(tmp);
    547 assert_string_is_neither_NULL_nor_zerolength(path);
    548 
    549 sprintf(rclocal_fname, "%s/rc.local", path);
    550 
    551 //  sprintf(tmp, "chmod 1777 %s/tmp", MNT_RESTORING);
    552 //  run_program_and_log_output( tmp, FALSE );
    553 return (0);                 /* remove this line to open the floodgates... */
    554 
    555 if (!does_file_exist(rclocal_fname)) {
    556 sprintf(rclocal_fname, "%s/rc.d/rc.local", path);
    557 }
    558 if (!does_file_exist(rclocal_fname)) {
    559 paranoid_free(rclocal_fname);
    560 paranoid_free(newfile_fname);
    561 paranoid_free(tmp);
    562 return (1);
    563 }
    564 sprintf(newfile_fname, "%s/rc.local.mondorescue", path);
    565 sprintf(tmp, "grep mondorescue %s > /dev/null 2> /dev/null",
    566     rclocal_fname);
    567 if (system(tmp)) {
    568 sprintf(tmp, "echo \"[ -e %s ] && %s\n\" >> %s",
    569         newfile_fname, newfile_fname, rclocal_fname);
    570 
    571 paranoid_system(tmp);
    572 }
    573 sprintf(tmp, "echo -en \"#!/bin/sh\
    574 \\n\
    575 \\n\
    576 grep -v mondorescue %s > %s\\n\
    577 rm -f /var/lock/subsys/*xfs*\\n\
    578 rm -f /var/run/xfs.*\\n\
    579 killall xfs\\n\
    580 service xfs start\\n\
    581 yes | rm -f %s\\n\
    582 \" > %s", rclocal_fname, rclocal_fname, newfile_fname, newfile_fname);
    583 sprintf(tmp, "chmod +x \"%s\"", newfile_fname);
    584 run_program_and_log_output(tmp, FALSE);
    585 paranoid_free(rclocal_fname);
    586 paranoid_free(newfile_fname);
    587 paranoid_free(tmp);
    588 return (0);
    589 }
    590 
    591 /**************************************************************************
    592 *END_ MODIFY_RCLOCAL_ONE_TIME                                            *
    593 **************************************************************************/
    594 
    595 
    596 
    597528
    598529
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.h

    r1052 r1579  
    88int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please);
    99void kill_petris(void);
    10 int modify_rclocal_one_time(char *path);
    1110int mount_cdrom(struct s_bkpinfo *bkpinfo);
    1211int mount_device(char *, char *, char *, bool);
Note: See TracChangeset for help on using the changeset viewer.