LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2011, 03:22 PM   #1
JRomeo
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Rep: Reputation: 1
Server Inaccessible Because of Duplicate /etc/sysconfig/network-scripts/ifcfg-eth0


I learned a hard lesson today about Linux.

I'm nearly at the end of creating a shell script that automates changing network settings by prompting the user for desired settings, then applying them.

In the course of my development, I created temporary copies of /etc/sysconfig/network-scripts/ifcfg-eth0 (/etc/sysconfig/network-scripts/ifcfg-eth0_tmp1, for example) so as to not alter the original file. Little did I know that on boot the system would attempt to load each of these kinds of files and associate it with an ethernet connection, in this case eth0.

So..... now there are multiple copies in the /etc/sysconfig/network-scripts diretory that essentially have the same settings. They are..

/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth0_tmp1
/etc/sysconfig/network-scripts/ifcfg-eth0_tmp2

Now when the system boots, it attempts to load them all. The boot doesn't appear to complete, and I can't ping, login, or otherwise access the system through convention routes (putty, etc.).

The easy solution would be to delete the tmp files and reboot. Now, how do I do that without being able to log in to the server. It's a VM by the way, if that makes a difference.

When you're done laughing at my act of newbie-ism, please offer any suggestions you may have that might help. Thanks very much.
 
Old 04-17-2011, 03:24 PM   #2
Franciozzy
LQ Newbie
 
Registered: Apr 2011
Posts: 8

Rep: Reputation: 0
If it's a VPS, you probably have console access through your control panel.

It is usually a Java Applet, but you can also ssh into a particular IP address provided by your ISP and, upon using the correct username, get redirected to your machine as if you were logged in by the console.

Otherwise, submit a ticket to your ISP and ask them to move those _tmp files away.
 
Old 04-17-2011, 03:37 PM   #3
JRomeo
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Original Poster
Rep: Reputation: 1
Thanks very much for your reply. I am, however, the owner of this machine. It's on a VPN that I manage.
 
Old 04-17-2011, 03:47 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Yes, it's possible to lock yourself out of ANY system.

For a physical server, the solution is generally to hard-boot the system with an install CD (or Knoppix, or ERD Commander, or something similar).

For a VM, the solution should be the same: you should be able to hard-boot your VM from an .iso of your install CD, and recover from there.

With a VM, you might also be able to revert to an earlier snapshot.
 
Old 04-17-2011, 03:53 PM   #5
JRomeo
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Original Poster
Rep: Reputation: 1
Ok, crisis averted. The boot up has an option to enter interactive mode and select which processes to load, one by one. I disabled the extra ethernet file loads, and it went right through. I deleted the extra files. Lesson learned. Thanks everyone.
 
1 members found this post helpful.
Old 04-18-2011, 06:14 AM   #6
kitgerrits
LQ Newbie
 
Registered: Dec 2008
Posts: 23

Rep: Reputation: 1
I would suggest putting the temporary files in an alternate directory.
I keep them in ".." myself.
 
Old 04-18-2011, 07:35 AM   #7
Franciozzy
LQ Newbie
 
Registered: Apr 2011
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by JRomeo View Post
Ok, crisis averted. The boot up has an option to enter interactive mode and select which processes to load, one by one. I disabled the extra ethernet file loads, and it went right through. I deleted the extra files. Lesson learned. Thanks everyone.
Yeah I guess there were a number of things you could have done. Depending on the virtualisation scheme you are using, you could also mount the disk of your VM on the host OS and fix the scripts. Well done!
 
Old 04-18-2011, 11:47 AM   #8
vrao0304
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
Edit the temporary ifcfg-eth configuration files and add 'ONBOOT=NO'. After rebooting it doesn't load them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RedHat: overwritten /etc/sysconfig/network-scripts/ifcfg-eth* files frozenQueue Red Hat 2 10-08-2010 07:26 AM
what is "/etc/sysconfig/network-scripts/ifcfg-eth0" its counterpart in slackware b0nd Slackware 2 10-06-2005 01:50 AM
How to change /etc/sysconfig/network-scripts/ifcfg-eth0 ariana Linux - Networking 1 05-01-2005 02:37 PM
can anyone post their /etc/sysconfig/network-scripts/ifcfg-wlan0? Dooberdoink Linux - Wireless Networking 1 03-27-2005 10:49 AM
/etc/sysconfig/network-scripts/ifcfg-ra0 Not working anymore NssOne Linux - Wireless Networking 1 02-13-2004 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration