I have a CentOS-6.2 server in Italy. Every few months the server gets into a strange state and stops working after a power outage. I should say that this does not occur after every power outage; I suspect, but have no real evidence for this, that if the power comes back too quickly then the machine gets confused because it is in the middle of closing down. If I am in Italy the solution is simple; I just press the power button on the machine until it stops and then switch it on again, and everything works fine. I guess that the proper solution is to get a UPS. PowerTrust (or Trust) UPS's are available at a reasonable price (?40-?50). But I have one question about this solution. What if the outage lasts longer than the "life" of the UPS, about 10 minutes? I'd actually like the UPS simply to halt the machine in the proper way after say 1 minute; but can this be arranged? (If the machine knew it had gone onto UPS, this could be arranged fairly simply.) There is one other possibility. There is a Billion modem/router between the ADSL input and the computer. This does not seem to have any problem with power outages. So if it were possible to send a message to the router which would cause the computer to be turned off and on again, that might offer an alternative solution. One problem with this is that the Italian ISP only offers a dynamic IP address. I run ddclient with dyndns on the server to translate this into a fixed domain-name. But this means that any action of this kind would have to be taken before the IP address changes. I think it usually stays the same for several days, but I guess this might not be true if there is an outage at the ISP's site, during a big electric storm. Any suggestions, advice or experience of this problem gratefully received. -- Timothy Murphy e-mail: gayleard /at/ eircom.net tel: +353-86-2336090, +353-1-2842366 s-mail: School of Mathematics, Trinity College Dublin
get a ups that has a usb connection. What you can do then is when you loose power after x amount of time the ups software will gracefully shutdown the server automatically. some ups software will even start the server back up once a sufficient charge has been obtained. On 3/24/2012 7:33 AM, Timothy Murphy wrote:> I have a CentOS-6.2 server in Italy. > Every few months the server gets into a strange state > and stops working after a power outage. > I should say that this does not occur after every power outage; > I suspect, but have no real evidence for this, > that if the power comes back too quickly > then the machine gets confused because it is in the middle of closing down. > > If I am in Italy the solution is simple; > I just press the power button on the machine until it stops > and then switch it on again, and everything works fine. > > I guess that the proper solution is to get a UPS. > PowerTrust (or Trust) UPS's are available at a reasonable price (?40-?50). > But I have one question about this solution. > What if the outage lasts longer than the "life" of the UPS, about 10 > minutes? > I'd actually like the UPS simply to halt the machine in the proper way > after say 1 minute; but can this be arranged? > (If the machine knew it had gone onto UPS, > this could be arranged fairly simply.) > > There is one other possibility. > There is a Billion modem/router between the ADSL input and the computer. > This does not seem to have any problem with power outages. > So if it were possible to send a message to the router > which would cause the computer to be turned off and on again, > that might offer an alternative solution. > One problem with this is that the Italian ISP > only offers a dynamic IP address. > I run ddclient with dyndns on the server to translate this > into a fixed domain-name. > But this means that any action of this kind would have to be taken > before the IP address changes. > I think it usually stays the same for several days, > but I guess this might not be true if there is an outage at the ISP's site, > during a big electric storm. > > Any suggestions, advice or experience of this problem gratefully received. >
On Sat, Mar 24, 2012 at 7:33 AM, Timothy Murphy <gayleard at alice.it> wrote:> I have a CentOS-6.2 server in Italy. > Every few months the server gets into a strange state > and stops working after a power outage. > I should say that this does not occur after every power outage; > I suspect, but have no real evidence for this, > that if the power comes back too quickly > then the machine gets confused because it is in the middle of closing down. > > If I am in Italy the solution is simple; > I just press the power button on the machine until it stops > and then switch it on again, and everything works fine. > > I guess that the proper solution is to get a UPS. > PowerTrust (or Trust) UPS's are available at a reasonable price (?40-?50). > But I have one question about this solution. > What if the outage lasts longer than the "life" of the UPS, about 10 > minutes? > I'd actually like the UPS simply to halt the machine in the proper way > after say 1 minute; but can this be arranged? > (If the machine knew it had gone onto UPS, > this could be arranged fairly simply.) > > There is one other possibility. > There is a Billion modem/router between the ADSL input and the computer. > This does not seem to have any problem with power outages. > So if it were possible to send a message to the router > which would cause the computer to be turned off and on again, > that might offer an alternative solution. > One problem with this is that the Italian ISP > only offers a dynamic IP address. > I run ddclient with dyndns on the server to translate this > into a fixed domain-name. > But this means that any action of this kind would have to be taken > before the IP address changes. > I think it usually stays the same for several days, > but I guess this might not be true if there is an outage at the ISP's site, > during a big electric storm. > > Any suggestions, advice or experience of this problem gratefully received. >The solution here is to purchase a UPS. I prefer APC, but there are other brands that work great. Most connect with USB, but you might find some that still use serial ports. With the monitoring software loaded, apcupsd for APC, it will shutdown the computer based on the parameters you configure. This can be time elapsed on battery, UPS estimated run time remaining, etc. When the power returns the UPS will wait for time elapsed and minimum battery charge before turning back on. Usually these are adjustable parameters in the UPS firmware. Additionally if your computer BIOS supports configuring the AC recovery power mode to always on, the computer will start back up. Most default to last state, which doesn't work as well since shutting down will power off the computer, which means that last state is off. There are some workarounds to change the shutdown sequence to just halt and not power off. Ryan
On 03/24/2012 02:33 PM, Timothy Murphy wrote:> Any suggestions, advice or experience of this problem gratefully received.An advice among all others: - When the machine gets stable, disable FS checks (in fstab, I dont remember what field to set to 0) - Setup the filesystem not to ask for check every N mounts (tune2fs) - Have a "netboot" available when things get really bad, so that you can mount you usual "/" via the netbooted system -- RMA.