[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: anacron apm script



I experienced a rather nasty problem yesterday (this morning?) at 12AM
related to this I think. I was testing to see if Debian was smart enough to
auto-hibernate or suspend if the battery was critically low (it didn't work
originally but that is another issue).

I happened to be testing this around midnight, when I found out the hard way
that the standard Debian woody installation runs some daily cleanup stuff. I
had the laptop unplugged on purpose to run down the battery. I then noticed
some heavy disk activity. Of course the heavy disk activity ran the battery
down quickly. Either the Bios or apmd detected this and tried to suspend,
but the other daily cron job was sucking so much CPU, the machine wasn't
able to perform the tasks to enter hibernate in time before the battery just
died. I could see the suspend light flashing right up until the battery
quit.

Several badly trashed partitions later... I hope there wasn't permanent data
damage. :(

I wonder if there is a way for apt/dpkg/whatever to verify that currently
installed packages aren't corrupted.


Bill Allombert wrote:
> Hello Debian laptop users,
>
> anacron include a script etc/apm/event.d/anacron
> that do
>
> case "$1,$2" in
> change,power|resume,*)
>     /etc/init.d/anacron start >/dev/null
>     ;;
> esac
>
> This is nice for user of suspend-to-disk machines since this give a
> chance to cron jobs to run even if they are schedulled at time when
> the machine is suspended (which is the default unless you don't sleep
> at night).
>
> Unfortunatly it seems that apm currenlty is unavailable during the
> execution of event.d scripts (someone to confirm ?). Since cron jobs
> can take a long time this is a problem (and that can cause hang if you
> try to suspend before the end of the cron job).
>
> I believe there is a simple solution around that: run anacron in
> background like in
>
> case "$1,$2" in
> change,power|resume,*)
>     setsid /etc/init.d/anacron start >/dev/null
>     ;;
> esac
>
> It work for me, but can, somebody with an understanding of the problem
> comment before I make a bug report ?
>
> Should apmd run every event script in the background to avoid similar
> problem ? Should event scripts decide for themself if they need to run
> in the background ?
>
> Friendly,
> --
> Bill. <ballombe@debian.org>
>
> Please CC me on reply, thanks!

-- 
Dwaine Gonyier
dwaine_gonyier@mindspring.com



Reply to: