Host won't boot if /etc/hosts is read-only!

monster

Member
Oct 23, 2010
30
0
6
I'm using Proxmox 1.6 on a Debian Squeeze Host. I have the following issue. The IP of eth0 and vmbr0 is different, and the hostname is mapped in /etc/hosts to the vmbr0 IP (which is a "private" IP, just for the VE) instead of the eth0 IP, which is a public Internet IP. I want the mapping to be fixed, so I can put my servers into a cluster. I decided against "fixing" the Proxmox scripts, because I would be back to square one after a Proxmox update. So I fixed /etc/hosts manually but it gets modified again at boot, which I have just found out. Since there didn't seem to be an obvious fix (after searching the forum), I decided to just make the file read-only, in the hope that it would be left untouched, but now the server won't even come back online after a reboot or react to a Remote Reset command, so I had to pay a technician to do a hardware reset (still waiting for it). This is about the last thing I would have expected...

IMHO, not booting anymore because a perfectly correct /etc/hosts is read-only is a critical bug, and should be fixed. Either just overwrite it, or log an error message and move on, but don't simply jam forever.
 
I'm using Proxmox 1.6 on a Debian Squeeze Host. ...

Squeeze? Proxmox VE 1.x series is based on Lenny, Squeeze is not possible. (Squeeze will be used in the 2.x series)
 
Squeeze? Proxmox VE 1.x series is based on Lenny, Squeeze is not possible. (Squeeze will be used in the 2.x series)

No, no. I mean that I installed a Debian Lenny System (because my Provider doesn't allow me to use my own images), upgraded it to Squeeze to get GRUB (I failed to get GRUB installed on Lenny), and then installed Proxmox 1.6 on top. I have done this on 4 servers. This works perfectly well so far. :) Well, except that I wish I would have more control over what files PVE "edits", and how...
 
Again, running Proxmox 1.x on Squeeze is not supported.
 
What exactly did you fix?
I have vmbr0 defined as: "address 10.254.254.254", according to some How-To telling you how to setup Shorewall as Firewall. eth0 is my real Internet IP. Unfortunately Proxmox points the hostname to vmbr0 IP in /etc/hosts, instead of eth0 IP.

I've exchanged many emails with the support of my Provider, and eventually the server started working again, but I never really worked out what went wrong. Another person I know on the same provider said that "sometimes systems just don't reboot" there. Great!

OTOH, I repeated the same experiment on two test systems, and they didn't show any problems. So this was a "false alarm". If you make /etc/hosts read-only, it gets overwritten anyway on boot. I found a work-around by using "chattr +i /etc/hosts". This works, and still doesn't seem to prevent booting.

I'm doing this because I understood from some other posts that the hostname has to be the real IP if clustering is to work.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!