anacron killed immediately after resume from suspend state

Bug #497813 reported by Erwin
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: anacron

If I resume my system from hibernate, anacron is started, but killed immediately afterwards. This bug is reproducible.

/var/log/syslog has this:

Dec 17 16:14:47 auster kernel: [135486.210318] PM: resume devices took 7.220 seconds
Dec 17 16:14:47 auster kernel: [135486.210341] PM: Finishing wakeup.
Dec 17 16:14:47 auster kernel: [135486.210342] Restarting tasks ... done.
Dec 17 16:14:47 auster acpid: client 1618[0:0] has disconnected
Dec 17 16:14:47 auster acpid: client 1618[0:0] has disconnected
Dec 17 16:14:47 auster acpid: client connected from 1618[0:0]
Dec 17 16:14:47 auster acpid: client connected from 1618[0:0]
Dec 17 16:14:47 auster anacron[31175]: Anacron 2.3 started on 2009-12-17
Dec 17 16:14:47 auster anacron[31175]: Will run job `cron.daily' in 5 min.
Dec 17 16:14:47 auster anacron[31175]: Jobs will be executed sequentially
Dec 17 16:14:47 auster init: anacron main process (31175) killed by TERM signal

>uname -a
Linux auster.zuhause 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux

>cat /etc/issue.net
Ubuntu 9.10

Revision history for this message
Erwin (junkmail-hoefling) wrote :

This bug was already discussed in some forums

http://forum.ubuntuusers.de/topic/init-anacron-killed-by-term-signal/#post-2257598

http://ubuntuforums.org/showthread.php?p=8482125

The "solution" in the second thread is a real hack and far form a bug fix.

Revision history for this message
Toshio Ito (debug-ito) wrote :

anacron in my desktop PC is killed, too, although it is killed during the normal boot sequence.
I never use hibernate or suspend.
My desktop is fresh-installed Xubuntu 9.10. I have used Xubuntu 8.04 and 9.04, all fresh-installed,
in the same machine but never experienced the problem.
When manually activating anacron after boot, it runs just fine.

> grep anacron /var/log/syslog
Dec 19 10:57:09 toshio-desktop anacron[1055]: Anacron 2.3 started on 2009-12-19
Dec 19 10:57:09 toshio-desktop anacron[1055]: Will run job `cron.daily' in 5 min.
Dec 19 10:57:09 toshio-desktop anacron[1055]: Jobs will be executed sequentially
Dec 19 10:57:14 toshio-desktop init: anacron main process (1055) killed by TERM signal

> uname -a
Linux toshio-desktop 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009 i686 GNU/Linux

Is the problem related to power management?
It seems that my machine lacks some of ACPI supports, e.g.,
there's no file in /proc/acpi/ac_adapter or /proc/acpi/battery, and the return code of on_ac_power command is 255.

Revision history for this message
Erwin (junkmail-hoefling) wrote :

change to package sysvinit since kill is triggered by "init" according to log file

affects: anacron (Ubuntu) → sysvinit (Ubuntu)
Changed in sysvinit (Ubuntu):
assignee: nobody → Ubuntu Core Development Team (ubuntu-core-dev)
Changed in sysvinit (Ubuntu):
assignee: Ubuntu Core Development Team (ubuntu-core-dev) → nobody
Revision history for this message
Henning Moll (drscott) wrote :

The kill is initiated by /usr/lib/pm-utils/power.d/anacron which is invoked by /etc/acpi/power.sh resp. /usr/share/acpi-support/policy-funcs. For KDE4 systems it checks for a running PowerDevil service. So the user has to hurry up to login in to his KDE4 session. Otherwise the services gets started to late and anacron has been allready killed...

Maybe it is similar on Xfce?

Revision history for this message
Toshio Ito (debug-ito) wrote :

Thank you for the information, Henning.
I don't know the PowerDevil thing, but it seems to me that

 1. /etc/acpi/power.sh calls /usr/sbin/pm-powersave.
 2. pm-powersave calls run_hooks defined in /usr/lib/pm-utils/pm-functions.
 3. run_hooks executes /usr/lib/pm-utils/power.d/anacron with an argument of "true", and it stops anacron.

If arguments for pm-powersave are omitted in step 2,
it determines whether the system should enter low-power operation or not according to the result of "on_ac_power"
(line 47 in /usr/sbin/pm-powersave).
So I modified the script of on_ac_power so that it always returns 0.
When I rebooted afterward, anacron started normally, without aborting.

Therefore, in my case, the problem is not in anacron or init (maybe),
but in the fact that my system cannot recognize that it actually runs on AC power.

# BTW, I've got used to starting anacron manually...

Revision history for this message
Henning Moll (drscott) wrote :

Interesting, so pm-powersave also tries to detect if AC is used. So i don't really understand why there is a IDE-depended 'pre-check' in /etc/acpi/power.sh by callling function 'CheckPolicy'. The return code of this functions determines wheather pm-powersave gets executed or not...

Revision history for this message
Erwin (junkmail-hoefling) wrote :

Thanks for such a detailed analysis of the problem. On my desktop machine, on_ac_power returns 255 too as described by Toshio, /proc/acpi/ac_adapter is empty.

The whole mechanism seem quite weired, I would consider such an intricate list of dependencies a bug per construction.

It seems that the failing anacron is a consequence of Bug 412499
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/412499

But the error messages look a bit differently in my case. The only strange thing in 'dmesg | grep ACPI' after resume from hibernate state reads
[ 11.128661] ACPI: I/O resource piix4_smbus [0xb00-0xb07] conflicts with ACPI region SOR1 [0xb00-0xb0f]
[ 11.128664] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 373.901853] ACPI handle has no context!

Not sure whether this leads any further...

>uname --kernel-release --kernel-version
2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:02:26 UTC 2010

Henning Moll (drscott)
Changed in sysvinit (Ubuntu):
status: New → Confirmed
Revision history for this message
Rüdiger Kupper (ruediger.kupper) wrote :

Some problem on Ubuntu Maverick. My anacron jobs are never executed.
I'd judge that this is a rather big system flaw: Anacron may care for important jobs, like regular backups.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.