Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a strange problem which seems to be related to the power management implementation on my laptop.
I installed a new kernel, and now when I type telinit 0 to shutdown, the machine goes into hibernate. In the previous kernel telinit 0 causes a complete power-off, which is what I want.
Any ideas how to get round this so I don't have to boot a separate kernel in order to turn off the machine?
I'd really recommend running shudown over "telinit" just so you're in the habit. Your distro may always do a "shutdown" on doing "telinit" (or "init") but most flavors of Unix didn't until recently. You can cause damage by telling it to stop the operating system but not stop underlying processes first as shutdown does.
shutdown -h 0 has the same effect as telinit 0 on my system. It must be referenced by the runlevel script.
However, shutdown -h 0 definitely has different effects in the two kernels (2.6.5.x and 2.6.12.x). In the older kernel, the "off-click" is brutal and precedes the disk spindown. In the newer kernel, the disk spins down gently before the off-click.
This gives the impression of it going into hibernation, and I would swear that when I last tried this kernel a few months ago I got a spontaneous disk spin-up several hours after shutting down. But possibly I am imagining things.
I would still like to understand better how the kernel influences these things, given that they are governed by the scripts in /etc.
/etc/init.d (more appropriately /etc/rc?.d since its possible one would be there not linked backed to /etc/init.d) are only part of the story. Actually these are a fairly recent development in Unix/Linux (considering Unix has been around since 1969). On HP-UX 9 they didn't exist so have only been around about 10 years. (NOTE: some flavors of Linux apparently don't use SysV init scripts.)
You can have a look at /etc/inittab which has been there far longer. Once upon a time I did most of my startups from within that and it is still what happens first.
The process "init" is PID 1 because it is the first thing that starts. Doing a "man init" should give you some additional details on this. For more detail as to what the kernel does I'll have to defer to someone else as I dont' really delve into that despite having attended internals training once upon a time.
Last edited by MensaWater; 10-06-2005 at 07:17 AM.
I guess the difference in shutdown behaviour between the kernels is just a refinement of the hardware support in the later kernel. As long as the effect is the same, I suppose that can only be a good thing.
Under kernel 2.6.12.3, my laptop will not properly power off. Having done a telinit 0 or a shutdown -h apparently with success, the machine will then turn on and boot up spontaneously in the middle of the night. I assume this was at 4.15am for a cron job, though to be honest I was in too much of a daze to check the cause.
Since I sleep in close proximity to my laptop, 4am boot-ups are not really desirable. And in any case I can't see how the cron job will get done, because the machine is in an unbooted state to start with. It seems to be a question of interference with the ACPI modules.
Anyone got any ideas what I can tweak or disable? Other than unplugging and taking the battery out, that is...
This thread has had a good few hits, so perhaps I'm not the only one with this unsolved problem.
To recap. My laptop does not power off completely with a telinit 0 or a shutdown -h now under recent kernels (2.6.12.3 and 2.6.13.4 at the very least). It did under 2.6.5.x.
Somewhere there must be a conflict between the kernel and the hardware, perhaps involving the ACPI power management protocols. Still seems strange to me that Linux doesn't have a command which just turns the machine off, always.
Any more ideas on commands and switch combos to try? Or power management settings to tweak?
Check the power-management support in the kernel. There are lots of ways that a laptop can implement power-management. The /var/log/messages file should have something to say... error-messages resulting from attempts to power-off and so forth.
Shutting down produces no error messages, and works fine. The problem is in the way the hardware interprets the command.
Oh well. I guess I will just have to resort to the foolproof option to prevent the machine waking up unasked - pulling out the battery. Seems silly to have to do this, but there you go. :/
But yep, it's definitely the kernel. As detailed in my posts above, the sound of the hard drive powering down is different. No other settings or the BIOS have been touched.
I was thinking about modifying the cronjob schedule to get round the nocturnal boot-up issue, but this hardly addresses the issue. The issue is that I don't want my computer starting up when it is meant to be turned off...
Perhaps this post should be in the hardware forum, because it seems to be a pure hardware problem. For my part I have no idea how to solve it, in any case!
Disabled hibernation in the BIOS. Made no difference to the "soft" power-down.
The reason this seems strange to me is that the machine does seem to be turning off properly, as under the older kernel. The shutdown script executes properly. All the services shut down one by one (including 'cron.d') before the final power-down.
So if the cron daemon and nothing else is running, how on earth is the machine powering up spontaneously?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.