[Bug 1050443] Re: ANACRON_RUN_ON_BATTERY_POWER setting does not work

Fumihito YOSHIDA hito at kugutsu.org
Thu Sep 13 14:23:07 UTC 2012


-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to anacron in Ubuntu.
https://bugs.launchpad.net/bugs/1050443

Title:
  ANACRON_RUN_ON_BATTERY_POWER setting does not work

Status in “anacron” package in Ubuntu:
  New

Bug description:
  Configuration of ANACRON_RUN_ON_BATTERY_POWER does not work on
  Ubuntu(upstart native job) environment.

  /usr/share/doc/anacron/README.Debian said:

    "By default, anacron does not run while on battery power.  See
  /etc/default/anacron to change that."

  And, default /etc/default/anacron are:
  ---------------------------------------------------
  # If set to "yes", start anacron even when on battery power.  By
  # default, the /etc/init.d/anacron script tries to avoid running
  # anacron unless on AC power, so as to avoid running down the battery.
  # (Things like the locate updatedb cause a lot of I/O.)

  ANACRON_RUN_ON_BATTERY_POWER=no
  ---------------------------------------------------

  But this feature does not work at all, because
  ANACRON_RUN_ON_BATTERY_POWER are implemented  by sysv init
  scripts(debian/init.d).

  debian/init.d has below, but /etc/init/anacron.conf did not care it.
  --------------------------------------------------------
      if test x"$ANACRON_RUN_ON_BATTERY_POWER" != x"yes" && test -x /usr/bin/on_ac_power
      then
          /usr/bin/on_ac_power >/dev/null
          if test $? -eq 1
          then
            log_progress_msg "deferred while on battery power"
            log_end_msg 0
            exit 0
          fi
      fi

      # on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
      # or on_ac_power returns 255 (undefined, desktop machine without APM)
      start-stop-daemon --start --exec /usr/sbin/anacron -- -s
  --------------------------------------------------------

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: anacron 2.3-19ubuntu1
  ProcVersionSignature: Ubuntu 3.5.0-14.16-generic 3.5.3
  Uname: Linux 3.5.0-14-generic i686
  ApportVersion: 2.5.1-0ubuntu7
  Architecture: i386
  Date: Thu Sep 13 23:16:30 2012
  InstallationMedia: Ubuntu 11.10 "Oneiric" - Build i386 LIVE Binary 20111014-16:01
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=ja_JP.utf8
   SHELL=/bin/zsh
  SourcePackage: anacron
  UpgradeStatus: Upgraded to quantal on 2011-12-03 (285 days ago)
  modified.conffile..etc.init.anacron.conf: [modified]
  mtime.conffile..etc.init.anacron.conf: 2012-09-13T23:13:27.309295

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/1050443/+subscriptions




More information about the foundations-bugs mailing list