Re: System hang when trying to enter sleep/standby state
From: Patrick Mochel <hidden>
Date: 2003-02-13 16:01:36
On Thu, 13 Feb 2003, Jens Haug wrote:
quoted
I would recommend never, ever doing 'echo 5 > /proc/acpi/sleep', especially if you're trying to suspend the system.It's not worse than pushing the power button on a normal system (or hold the power button on an ACPI system).
You're absolutely right. But, most people do those things deliberately, and know the consequences. Think about how this thread started: $Random User sees his system doesn't suspend when writing '4' to that file, so he tries every other value. That's a perfectly valid thing to do, and the kernel has no right to crash when he does something like that. In order not to crash, and to guarantee that data does not get corrupted, we should execute sys_reboot() from inside the kernel. Which is possible, but ludicrous. If you want to halt your system, use halt(1). We do not need to invent new ways to do old things, especially when they are dangerous.
quoted
ACPI should not allow a user to write '5' to that file. It used to be that way, but someone clever decided that that interface should support _all_ sleep states. (It might have been me, in one of my finer moments).The regular user can't write anything to that file - this must be root. He's supposed to know what he's doing. If he wants to turn the machine off without halting the system, then that's his choice. Think of something like an embedded system to control a machine. Many machines have an emergency off whith a huge red button. This is the software version of this red button. Your software can press this if you thing that's necessary.
That's crap. For one, most systems are single-user systems. That was certainly the case for the guy that crashed his system by writing to that file. So, by definition, root knows only as much as the most knowledgable user. For another, as mentioned before, we have safe mechanisms for halting a system. See 'man 1 halt'.
quoted
Andy, I recommend removing that from 2.4, and I'll send you a patch for 2.5..I'd like to have it in. I don't know what I could ever use it for, but I'd really prefer to have this possibility.
Listen to yourself. Also, take into account your design philosophies concerning Linux and other operating systems. This comment is poorly thought out and completely invalid. We don't keep features around because they might be useful to someone at some point in the future. We do what is necessary and nothing more. We also don't leave gaping holes for users to accidentally screw themselves. Deliberately, sure. But, not on accident, that's just rude. There is no freedom in anarchy. Just because you can have something doesn't mean that you should. This is not about enforcing policy or behavior, or knowing 'what is best' for a user. This is about saving users heartache and valuable data, and developers from saying 'don't do that' a thousand times. End of story. -pat ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en