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. |
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. |
Thanks very much for your reply. I am, however, the owner of this machine. It's on a VPN that I manage.
|
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. |
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.
|
I would suggest putting the temporary files in an alternate directory.
I keep them in ".." myself. |
Quote:
|
Edit the temporary ifcfg-eth configuration files and add 'ONBOOT=NO'. After rebooting it doesn't load them.
|
All times are GMT -5. The time now is 06:25 AM. |