Professional Web Applications Themes

can't reboot after messing up my rc.conf file - FreeBSD

Hi All: I was editing my rc.conf file and left off a quote mark, and now when I try to reboot I get an error and am prompted to drop into shell to fix it. The default prompt is /bin/sh, and if I hit return I get a prompt. How can I edit the file while I'm in that prompt? VI doesn't work...is there another text editor I can use to fix the file? TIA...

  1. #1

    Default can't reboot after messing up my rc.conf file

    Hi All:

    I was editing my rc.conf file and left off a quote mark, and now when I try
    to reboot I get an error and am prompted to drop into shell to fix it.

    The default prompt is /bin/sh, and if I hit return I get a prompt.

    How can I edit the file while I'm in that prompt? VI doesn't work...is there
    another text editor I can use to fix the file?

    TIA

    aklist_061666 Guest

  2. #2

    Default Re: can't reboot after messing up my rc.conf file

    mount -a
    vi /etc/rc.conf

    Running fsck is your prerogative.



    -Kyle Mott



    aklist_061666 wrote:
    > Hi All:
    >
    > I was editing my rc.conf file and left off a quote mark, and now when
    > I try to reboot I get an error and am prompted to drop into shell to
    > fix it.
    >
    > The default prompt is /bin/sh, and if I hit return I get a prompt.
    >
    > How can I edit the file while I'm in that prompt? VI doesn't work...is
    > there another text editor I can use to fix the file?
    >
    > TIA
    > _______________________________________________
    > [email]freebsd-questionsfreebsd.org[/email] mailing list
    > [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    > To unsubscribe, send any mail to
    > "freebsd-questions-unsubscribefreebsd.org"
    Kyle Mott Guest

  3. #3

    Default Re: can't reboot after messing up my rc.conf file

    On Wed, 2005-02-16 at 13:42, aklist_061666 wrote:
    > Hi All:
    >
    > I was editing my rc.conf file and left off a quote mark, and now when I try
    > to reboot I get an error and am prompted to drop into shell to fix it.
    >
    > The default prompt is /bin/sh, and if I hit return I get a prompt.
    >
    > How can I edit the file while I'm in that prompt? VI doesn't work...is there
    > another text editor I can use to fix the file?
    >
    > TIA
    >
    > _______________________________________________
    > [email]freebsd-questionsfreebsd.org[/email] mailing list
    > [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    > To unsubscribe, send any mail to "freebsd-questions-unsubscribefreebsd.org"
    /bin/ed

    Be prepared with a printed manual and a wet towel for your head!

    Mike Jeays Guest

  4. #4

    Default Re: can't reboot after messing up my rc.conf file

    Mike Jeays wrote:
    > On Wed, 2005-02-16 at 13:42, aklist_061666 wrote:
    >
    >>Hi All:
    >>
    >>I was editing my rc.conf file and left off a quote mark, and now when I try
    >>to reboot I get an error and am prompted to drop into shell to fix it.
    >>
    >>The default prompt is /bin/sh, and if I hit return I get a prompt.
    >>
    >>How can I edit the file while I'm in that prompt? VI doesn't work...is there
    >>another text editor I can use to fix the file?
    >>
    >>TIA
    >>
    >>______________________________________________ _
    >>freebsd-questionsfreebsd.org mailing list
    >>[url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    >>To unsubscribe, send any mail to "freebsd-questions-unsubscribefreebsd.org"
    >
    >
    > /bin/ed
    >
    > Be prepared with a printed manual and a wet towel for your head!
    >
    > _______________________________________________
    > [email]freebsd-questionsfreebsd.org[/email] mailing list
    > [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    > To unsubscribe, send any mail to "freebsd-questions-unsubscribefreebsd.org"
    >
    Or you could just simply:
    # /bin/mv /etc/rc.conf /etc/rc.conf.bad
    # /bin/echo "<variable>=<value>" >> /etc/rc.conf

    This will give you a nice new rc.conf that you can edit once you are up
    and running again.

    HTH
    Chris
    Chris Hodgins Guest

  5. #5

    Default Re: can't reboot after messing up my rc.conf file

    I may have missed something from the thread before I joined the list,
    but is there any reason you can't just mount the filesystems and use vi
    as you're used to? If you're getting far enough in the boot process to
    get an opportunity to interact with a shell, you should just be able to
    mount -a and vi whatever. (Or, if you want to play it safe (or if the
    system wasn't cleanly shutdown before), fsck and then mount -a)

    Otherwise, Chris Hodgins' suggestion of mv'ing the old file out of the
    way and echoing variables into a new one is probably what I'd do. I hate
    ed.

    On Wed, 2005-02-16 at 13:42, aklist_061666 wrote:
    > Hi All:
    >
    > I was editing my rc.conf file and left off a quote mark, and now when
    > I try to reboot I get an error and am prompted to drop into shell to
    > fix it.
    >
    > The default prompt is /bin/sh, and if I hit return I get a prompt.
    >
    > How can I edit the file while I'm in that prompt? VI doesn't work...is
    > there another text editor I can use to fix the file?
    Jamie Novak Guest

  6. #6

    Default Re: can't reboot after messing up my rc.conf file

    >>>>> On Wed, 16 Feb 2005 20:02:02 -0600,
    >>>>> Jamie Novak <novakqwest.net> said:
    > I may have missed something from the thread before I joined the list,
    > but is there any reason you can't just mount the filesystems and use vi
    > as you're used to? If you're getting far enough in the boot process to
    > get an opportunity to interact with a shell, you should just be able to
    > mount -a and vi whatever. (Or, if you want to play it safe (or if the
    > system wasn't cleanly shutdown before), fsck and then mount -a)
    This should work fine. Although, depending on where he is in the boot
    process, / may be mounted read-only. Do `mount -uw /' to make it
    read-write.

    The lesson here is that when editing any file that is even remotely
    connected to the boot process, _make_a_backup_copy_. You can then
    simply mv the backup copy back into place should you mess up.

    Sandy
    Sandy Rutherford Guest

  7. #7

    Default Re: can't reboot after messing up my rc.conf file

    On Thu, Feb 17, 2005 at 12:44:55AM -0800, Sandy Rutherford wrote:
    > >>>>> On Wed, 16 Feb 2005 20:02:02 -0600,
    > >>>>> Jamie Novak <novakqwest.net> said:
    >
    > > I may have missed something from the thread before I joined the list,
    > > but is there any reason you can't just mount the filesystems and use vi
    > > as you're used to? If you're getting far enough in the boot process to
    > > get an opportunity to interact with a shell, you should just be able to
    > > mount -a and vi whatever. (Or, if you want to play it safe (or if the
    > > system wasn't cleanly shutdown before), fsck and then mount -a)
    >
    > This should work fine. Although, depending on where he is in the boot
    > process, / may be mounted read-only. Do `mount -uw /' to make it
    > read-write.
    >
    > The lesson here is that when editing any file that is even remotely
    > connected to the boot process, _make_a_backup_copy_. You can then
    > simply mv the backup copy back into place should you mess up.
    Actually, Absolute BSD has a handy suggestion about using rcs for all
    important files in /etc/. Maybe you should try looking into that.
    >
    > Sandy
    > _______________________________________________
    > [email]freebsd-questionsfreebsd.org[/email] mailing list
    > [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
    > To unsubscribe, send any mail to "freebsd-questions-unsubscribefreebsd.org"
    --
    I sense much NT in you.
    NT leads to Bluescreen.
    Bluescreen leads to downtime.
    Downtime leads to suffering.
    NT is the path to the darkside.
    Powerful Unix is.

    Public Key: [url]ftp://ftp.tallye.com/pub/lorenl_pubkey.asc[/url]
    Fingerprint: B3B9 D669 69C9 09EC 1BCD 835A FAF3 7A46 E4A3 280C

    Loren M. Lang Guest

  8. #8

    Default Re: can't reboot after messing up my rc.conf file

    >>>>> On Sun, 20 Feb 2005 06:48:33 -0800,
    >>>>> "Loren M. Lang" <lorenlalzatex.com> said:
    > On Thu, Feb 17, 2005 at 12:44:55AM -0800, Sandy Rutherford wrote:
    >> >>>>> On Wed, 16 Feb 2005 20:02:02 -0600,
    >> >>>>> Jamie Novak <novakqwest.net> said:
    >>
    >> > I may have missed something from the thread before I joined the list,
    >> > but is there any reason you can't just mount the filesystems and use vi
    >> > as you're used to? If you're getting far enough in the boot process to
    >> > get an opportunity to interact with a shell, you should just be able to
    >> > mount -a and vi whatever. (Or, if you want to play it safe (or if the
    >> > system wasn't cleanly shutdown before), fsck and then mount -a)
    >>
    >> This should work fine. Although, depending on where he is in the boot
    >> process, / may be mounted read-only. Do `mount -uw /' to make it
    >> read-write.
    >>
    >> The lesson here is that when editing any file that is even remotely
    >> connected to the boot process, _make_a_backup_copy_. You can then
    >> simply mv the backup copy back into place should you mess up.
    > Actually, Absolute BSD has a handy suggestion about using rcs for all
    > important files in /etc/. Maybe you should try looking into that.
    I actually do both. RCS is very usefull for unwinding changes to get
    the system back to a previous state, should you realise that some of
    your "improvements" weren't such a good idea afterall. However, if
    you are concerned that your changes might adversely affect the boot
    process, then keeping your recovery plan as simple as possible is
    highly recommended. It doesn't get much simpler than `cp'.

    Sandy
    Sandy Rutherford Guest

Similar Threads

  1. Tables Messing Up
    By blindchild in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: November 12th, 09:50 PM
  2. reading a httpd.conf file
    By Chad Kellerman in forum PERL Beginners
    Replies: 1
    Last Post: January 23rd, 03:42 PM
  3. Characters messing up - what to do with &
    By abeconnally webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: January 12th, 06:36 PM
  4. Button messing up!!!
    By in forum Macromedia Fireworks
    Replies: 0
    Last Post: August 2nd, 02:57 AM
  5. Messing with UID's and GID's
    By Dave Ardrey in forum PERL Miscellaneous
    Replies: 1
    Last Post: June 30th, 02:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139