How to prevent "apm" from turning off hard drive during uptime?

How to prevent "apm" from turning off hard drive during uptime?

Post by vector sigm » Thu, 12 Sep 2002 23:08:05



Hi there:

  Quick question. I have a tower desktop, not a laptop. I want to keep my
  hard drive running at all times when the system is up, but when I do
  "shutdown -p now,"  I want to use apm to first turn off the hard drive and
  then the whole system. I posted a similar question few days ago, but I am
  not sure whether apm automatically turns everything off when idle. I want
  to be sure what apm does before I recompile another kernel.

  Thanks for any suggestions.

  vector sigma

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Bill Vermilli » Fri, 13 Sep 2002 01:26:43




>  Quick question. I have a tower desktop, not a laptop. I want
>  to keep my hard drive running at all times when the system
>  is up, but when I do "shutdown -p now," I want to use apm to
>  first turn off the hard drive and then the whole system.

I'm curious as to why you would want to do this - eg turn off drive
and then system.  What is to be gained.

I can also see that if you attempted to turn the drive off before
all the sync'ing was done you could have a potential problem on
reboot.

This is more of a curiosity question than anything else.

Quote:> I posted a similar question few days ago, but I am not sure
> whether apm automatically turns everything off when idle.
> I want to be sure what apm does before I recompile another
> kernel.

I don't run APM but I have heard of others on other OSes that have
had power with APM shutting off the drive when the Unix kernel
wants to make it's normal updates.

Bill
--


 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Chuck Swige » Fri, 13 Sep 2002 05:14:26




> first of all, i don't know how to power down the HDD with apm, but i
> would LOVE to know how i can do this. even doing a 'zzz' will only
> shutdown cpu+fan and stuff, but the harddrives keep spinning (now isn't
> that silly?)

Not really.  Spinning a normal hard drive up and down puts a lot of wear on
the bearing and costs a lot of energy.  (Laptop hard drives are much smaller
and have less rotational inertia, so they handle power-cycles with less
overhead.)

-Chuck


       -------------+-------------------+-----------------------------------
       "The human race's favorite method for being in control of the facts
        is to ignore them."  -Celia Green

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by vector sigm » Fri, 13 Sep 2002 12:28:33



Quote:> I'm curious as to why you would want to do this - eg turn off drive
> and then system.  What is to be gained.

I just thought that having the kernel shut off the hard drive and the system
is safer than having me manually press the power button to shut off
everything, and I was trying to prevent myself from damaging the hardware.

Do people normally have to manually turn off their Unix machines or leave it
to the OS?

vector sigma

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by vector sigm » Fri, 13 Sep 2002 13:23:23



Quote:> but if you are doing 'shutdown -p now' then the system will go into
> "stand-by" and turn off completely (including _everything_).

Not quite: when I do that, the system halts and becomes unresponsive, but
the power is still on and the hard drive still spins. I want the kernel to
turn off the power when I do "shutdown -p now"

vector

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Chuck Swige » Sat, 14 Sep 2002 02:38:04




>> I'm curious as to why you would want to do this - eg turn off drive
>> and then system.  What is to be gained.

> I just thought that having the kernel shut off the hard drive and the system
> is safer than having me manually press the power button to shut off
> everything, and I was trying to prevent myself from damaging the hardware.

Ah.  What you should do is 'halt' the system and wait a few seconds while it
closes all running processes and flushes memory to disk, and then you can
power off the system safely.

Quote:> Do people normally have to manually turn off their Unix machines or leave it
> to the OS?

I have APM enabled and I have the OS power-off the hardware.

-Chuck


       -------------+-------------------+-----------------------------------
       "The human race's favorite method for being in control of the facts
        is to ignore them."  -Celia Green

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by vector sigm » Sat, 14 Sep 2002 05:06:09


Thank you  all, FreeBSD people. I am able to power off my computer with
kernel now. This all I did (in case anyone else needs to know what to do):

1. I have a desktop tower, not a laptop, and my motherboard BIOS supports
apm.
2. In kernel, I added: "device apm0"
3. make device "/dev/MAKEDEV apm"
4. in /etc/rc.conf, I added "apm_enable="YES" "
5. command "shutdown -p now" will turn off harddrive and power.

Once again, thank you all.

vector sigma

Before *tron was, I was.

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Bill Vermilli » Tue, 17 Sep 2002 04:57:17





>> I'm curious as to why you would want to do this - eg turn off drive
>> and then system.  What is to be gained.
>I just thought that having the kernel shut off the hard drive
>and the system is safer than having me manually press the power
>button to shut off everything, and I was trying to prevent
>myself from damaging the hardware.
>Do people normally have to manually turn off their Unix machines
>or leave it to the OS?

When I have to turn them off I do it myself.  However I try not to
turn them off - ever.  The machine that preceded this one stayed up
24x7x365 until the disk controller finally went [it could have been
the drive but it acted more like the controller which was not
replaceable then].  So that was 7 years 2 months and a few days
of always being on.

--

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Bill Vermilli » Tue, 17 Sep 2002 04:57:24






>>> I'm curious as to why you would want to do this - eg turn off drive
>>> and then system.  What is to be gained.

>> I just thought that having the kernel shut off the hard drive and the system
>> is safer than having me manually press the power button to shut off
>> everything, and I was trying to prevent myself from damaging the hardware.
>Ah. What you should do is 'halt' the system and wait a few
>seconds while it closes all running processes and flushes memory
>to disk, and then you can power off the system safely.

Use 'shutdown' and not 'halt'. Even though the 'halt' is supposed
to flush everything properly in BSD it doesn't always work that
cleanly in other OSes so shutdown is good habit to get into.

--

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Chuck Swige » Wed, 18 Sep 2002 05:12:48





[ ... ]
>>Ah. What you should do is 'halt' the system and wait a few
>>seconds while it closes all running processes and flushes memory
>>to disk, and then you can power off the system safely.

> Use 'shutdown' and not 'halt'. Even though the 'halt' is supposed
> to flush everything properly in BSD it doesn't always work that
> cleanly in other OSes so shutdown is good habit to get into.

A point.  On some SysV systems, you want to invoke shutdown or telinit to
switch to the appropriate runlevel, which will run various /etc/init.d scripts
to stop running services, and then sync and halt the system.

By comparison, FreeBSD and many other BSD-derived systems simply do a kill
-TERM, kill -9, which doesn't always shut down complex systems like a database
very cleanly, either.

-Chuck


       -------------+-------------------+----4-------------------------------
       "The human race's favorite method for being in control of the facts
        is to ignore them."  -Celia Green

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by John S. Dyso » Wed, 18 Sep 2002 05:16:30






> [ ... ]
> >>Ah. What you should do is 'halt' the system and wait a few
> >>seconds while it closes all running processes and flushes memory
> >>to disk, and then you can power off the system safely.

> > Use 'shutdown' and not 'halt'. Even though the 'halt' is supposed
> > to flush everything properly in BSD it doesn't always work that
> > cleanly in other OSes so shutdown is good habit to get into.

> A point.  On some SysV systems, you want to invoke shutdown or telinit to
> switch to the appropriate runlevel, which will run various /etc/init.d scripts
> to stop running services, and then sync and halt the system.

> By comparison, FreeBSD and many other BSD-derived systems simply do a kill
> -TERM, kill -9, which doesn't always shut down complex systems like a database
> very cleanly, either.

Yes, but at least that is a two stage process.   One is a 'clean up your mess or
you'll get killed', and the next (later on), the process will be forced down.   Ill
conceived of applications (those which are supposed to be reliable) forget to
catch the signals, and have serious ramifications on shutdowns.

John

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Chuck Swige » Wed, 18 Sep 2002 05:32:18




>> By comparison, FreeBSD and many other BSD-derived systems simply do a kill
>> -TERM, kill -9, which doesn't always shut down complex systems like a
>> database very cleanly, either.

> Yes, but at least that is a two stage process.  One is a 'clean up your mess
> or you'll get killed', and the next (later on), the process will be forced
> down.  Ill conceived of applications (those which are supposed to be
> reliable) forget to catch the signals, and have serious ramifications on
> shutdowns.

And that works very well when processes are written properly and do not have
external dependencies.  Software ported from non-Unix systems, software
running in an interpreter (like a Java VM, perhaps), and software with complex
dependencies between multiple processes tend to not do so well.

For example, even if each and every Oracle process handled kill -TERM
properly, having your transaction log writer process shutdown cleanly before
various other database processes do doesn't result in Oracle closing and
dismounting the databases cleanly.

-Chuck


       -------------+-------------------+-----------------------------------
       "The human race's favorite method for being in control of the facts
        is to ignore them."  -Celia Green

 
 
 

How to prevent "apm" from turning off hard drive during uptime?

Post by Steve O'Hara-Smit » Wed, 18 Sep 2002 06:15:10


On Mon, 16 Sep 2002 20:12:48 +0000 (UTC)

CS> By comparison, FreeBSD and many other BSD-derived systems simply do a
CS> kill-TERM, kill -9, which doesn't always shut down complex systems
CS> like a database very cleanly, either.

        The rc.shutdown script is a little more sophisticated than that,
among other things it runs the scripts in the various rc.d directories
with "stop" as the  argument. The killing starts after everything has
been asked nicely to stop :) See man rc for further details.

--
C:>WIN                                      |     Directable Mirrors
The computer obeys and wins.                |A Better Way To Focus The Sun
You lose and Bill collects.                 |  licenses available - see:
                                            |   http://www.sohara.org/

 
 
 

1. Strange "w", "who" and "uptime" output

Hi!  I've upgraded my Slackware 3.5 system to use a 2.2.12 kernel,
glibc-2.1.2, and gcc-2.95.1.  During the kernel upgrade, I've upgraded a
number of other packages, per the 2.2 kernel doc.  I've installed
procps-2.0.5 and util-linux-2.9y.

I'm finding that when I issue the "w" or "who" commands, 1 user (me) is
shown as being logged on, but I see no entry for my session.  When I
issue the "uptime" command, again 1 user is reported as being logged in.
This happens when I'm logged at the console.

When I login from remote (via rlogin), "w", "who", and "uptime" all
report 0 users logged in.

What am I missing here????

Thanks in advance for your time!

Peace....

Tom Williams

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Awesome PC Demand Drives Outstanding Microsoft Quarterly Results

3. GETSERVBYNAME()????????????????????"""""""""""""

4. The newest version of ncurses

5. Hard drive access during "idle time"

6. Is there no installer for KDE?

7. very weird: entire system "blocks" during hard-drive IO

8. Emails and virtual servers

9. "boot0: error80" during hard drive boot process

10. During Linux install "Disk Druid" not recognizing 20GB Hard Drive properly....

11. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

12. "load average" in "uptime"