Your message dated Tue, 2 Aug 2005 20:38:43 +1000
with message-id <[EMAIL PROTECTED]>
and subject line [anacron]: anacron *never* runs if power cannot be determined
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 6 Sep 2002 07:48:57 +0000
>From [EMAIL PROTECTED] Fri Sep 06 02:48:57 2002
Return-path: <[EMAIL PROTECTED]>
Received: from mailout05.sul.t-online.com [194.25.134.82] 
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 17nDrN-0002bn-00; Fri, 06 Sep 2002 02:48:57 -0500
Received: from fwd06.sul.t-online.de 
        by mailout05.sul.t-online.com with smtp 
        id 17nDrK-00036w-01; Fri, 06 Sep 2002 09:48:54 +0200
Received: from alcor.macd.com ([EMAIL PROTECTED]) by fmrl06.sul.t-online.com
        with esmtp id 17nDqy-25LaKmC; Fri, 6 Sep 2002 09:48:32 +0200
Received: from joerg by alcor.macd.com with local (Exim 3.35 #1 (Debian))
        id 17nDqx-0004zi-00; Fri, 06 Sep 2002 09:48:31 +0200
From: Joerg Thoennes <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: anacron *never* runs if power state cannot be determined
X-Mailer: reportbug 1.50
Date: Fri, 06 Sep 2002 09:48:30 +0200
Message-Id: <[EMAIL PROTECTED]>
X-Sender: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]

Package: anacron
Version: 2.3-6
Severity: grave
Tags: patch
Justification: renders package unusable

I noticed that my locate db is older than 8 days, but my Laptop was on
mains power the last nights. So I started to investigate and found the
following:

/etc/cron.daily/find is responsible for updating the database.

/etc/crontab specifies when to run daily cron jobs:

25 6    * * *   root    test -e /usr/sbin/anacron || run-parts --report 
/etc/cron.daily

Since anacron is installed, running the job is left to anacron.

/etc/cron.d/anacron specifies when to run anacron:

30 7    * * *   root    test -x /etc/init.d/anacron && /etc/init.d/anacron 
start >/dev/null

Looking at /etc/init.d/anacron reveals the problem:

[...]
  start)
    # Really on_ac_power is not a sufficient test, as it only looks at
    # APM and we ought to also check whether we're on a UPS battery.
    if test \! -x /usr/bin/on_ac_power || on_ac_power >/dev/null
    then
        echo -n "Starting anac(h)ronistic cron: anacron"
        anacron -s
        echo "."
    else       
        echo "Starting anac(h)ronistic cron: deferred while on battery power."
    fi
    ;;
[...]

Running by hand

    /etc/init.d/anacron start

gives

    Starting anac(h)ronistic cron: deferred while on battery power.

but my system is *NOT* on battery power.

Looking at "man on_ac_power" shows the solution:

[...]

EXIT STATUS
       0 (true)  System is on mains power
       1 (false) System is not on mains power
       255 (false)    Power status could not be determined
       ^^^^^^^^^^^
[...]

Since != 0 counts as false, the above test also fails, if the power
status could not be determined: My current (default Debian) kernel had no APM 
support enabled.

I suggest the following patch:

-----
  start)
    # Really on_ac_power is not a sufficient test, as it only looks at
    # APM and we ought to also check whether we're on a UPS battery.
    if test \! -x /usr/bin/on_ac_power || (on_ac_power >/dev/null; test "$?" 
-eq 0)
    then
        echo -n "Starting anac(h)ronistic cron: anacron"
        anacron -s
        echo "."
    else       
        echo "Starting anac(h)ronistic cron: deferred while on battery power."
    fi
    ;;
-----

Cheers, Jörg

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux alcor 2.2.19 #1 Sat Oct 20 18:09:49 EST 2001 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages anacron depends on:
ii  debianutils                   1.16       Miscellaneous utilities specific t
ii  exim                          3.35-1     An MTA (Mail Transport Agent)
ii  exim [mail-transport-agent]   3.35-1     An MTA (Mail Transport Agent)
ii  libc6                         2.2.5-6    GNU C Library: Shared libraries an
ii  sysklogd                      1.4.1-10   System Logging Daemon
ii  sysklogd [system-log-daemon]  1.4.1-10   System Logging Daemon


---------------------------------------
Received: (at 159828-done) by bugs.debian.org; 2 Aug 2005 10:38:52 +0000
>From [EMAIL PROTECTED] Tue Aug 02 03:38:52 2005
Return-path: <[EMAIL PROTECTED]>
Received: from adsl-75-59.swiftdsl.com.au (taco.synerger.com) [218.214.75.59] 
(postfix)
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1DzuAe-0000D5-00; Tue, 02 Aug 2005 03:38:52 -0700
Received: from kelloe.redellipse.net (taco.synerger.com [127.0.0.1])
        by taco.synerger.com (Postfix) with ESMTP id E6A8DFF04
        for <[EMAIL PROTECTED]>; Tue,  2 Aug 2005 20:38:41 +1000 (EST)
Received: by kelloe.redellipse.net (Postfix, from userid 1000)
        id 0E52413B696; Tue,  2 Aug 2005 20:38:43 +1000 (EST)
Date: Tue, 2 Aug 2005 20:38:43 +1000
From: Pascal Hakim <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [anacron]: anacron *never* runs if power cannot be determined
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.9i
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02

Hi,

I'm closing this bug as it has been fixed in the recently released
Debian Sarge distribution.

Cheers,

Pasc
-- 
Pascal Hakim                                          0403 411 672
Do Not Bend


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to