<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=522&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] anacron hangs on battery power]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=522</link>
		<description><![CDATA[The most recent posts in [SOLVED] anacron hangs on battery power.]]></description>
		<lastBuildDate>Fri, 24 Mar 2017 23:51:48 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[[SOLVED] anacron hangs on battery power]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=1029#p1029</link>
			<description><![CDATA[<p>I&#039;m creating this post in the hope that it helps others with this problem, as it took me a long time to solve.</p><p>I installed anacron on my Devuan Jessie laptop. I want anacron to run regardless of whether my laptop is plugged in to AC power or running on battery. I dutifully edited /etc/default/anacron with my favorite text editor and changed &quot;ANACRON_RUN_ON_BATTERY_POWER=no&quot; to &quot;ANACRON_RUN_ON_BATTERY_POWER=yes&quot;.</p><p>If I&#039;m on battery and boot my laptop or resume from suspend, anacron starts as expected and fools you into thinking that all is well:</p><div class="codebox"><pre><code>bruno@devuan:~$ sudo grep anacron /var/log/syslog
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.daily&#039; in 5 min.
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.weekly&#039; in 10 min.
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.monthly&#039; in 15 min.
Mar 24 13:32:12 bruno anacron[1596]: Jobs will be executed sequentially</code></pre></div><p>THE PROBLEM<br />The problem is that if I&#039;m on battery power, anacron never actually runs any jobs--it says that it will (as you can see in syslog), but it just hangs indefinitely and never actually does anything. Here&#039;s another look at the syslog, hours later:</p><div class="codebox"><pre><code>bruno@devuan:~$ sudo grep anacron /var/log/syslog
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.daily&#039; in 5 min.
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.weekly&#039; in 10 min.
Mar 24 13:32:12 bruno anacron[1596]: Will run job `cron.monthly&#039; in 15 min.
Mar 24 13:32:12 bruno anacron[1596]: Jobs will be executed sequentially</code></pre></div><p>Looking at the timestamps in /var/spool/anacron confirms that no jobs were run.</p><p>THE SOLUTION<br />Such &quot;silent errors&quot; are so tough to solve! I tried everything under the sun and eventually got this idea from somewhere:</p><div class="codebox"><pre><code>$ sudo chmod a-x /usr/lib/pm-utils/power.d/anacron</code></pre></div><p>BINGO! Once that wicked script is no longer executable, anacron runs its jobs when it says it will--even on battery power. Here&#039;s what syslog shows 16 minutes after a reboot while running on battery:</p><div class="codebox"><pre><code>bruno@devuan:~$ sudo grep anacron /var/log/syslog
Mar 24 18:32:12 bruno anacron[1596]: Will run job `cron.daily&#039; in 5 min.
Mar 24 18:32:12 bruno anacron[1596]: Will run job `cron.weekly&#039; in 10 min.
Mar 24 18:32:12 bruno anacron[1596]: Will run job `cron.monthly&#039; in 15 min.
Mar 24 18:32:12 bruno anacron[1596]: Jobs will be executed sequentially
Mar 24 18:37:12 bruno anacron[1596]: Job `cron.daily&#039; started
Mar 24 18:37:12 bruno anacron[2716]: Updated timestamp for job `cron.daily&#039; to 2017-03-24
Mar 24 18:37:15 bruno anacron[1596]: Job `cron.daily&#039; terminated
Mar 24 18:42:12 bruno anacron[1596]: Job `cron.weekly&#039; started
Mar 24 18:42:12 bruno anacron[2895]: Updated timestamp for job `cron.weekly&#039; to 2017-03-24
Mar 24 18:42:12 bruno anacron[1596]: Job `cron.weekly&#039; terminated
Mar 24 18:47:12 bruno anacron[1596]: Job `cron.monthly&#039; started
Mar 24 18:47:12 bruno anacron[2980]: Updated timestamp for job `cron.monthly&#039; to 2017-03-24
Mar 24 18:47:12 bruno anacron[1596]: Job `cron.monthly&#039; terminated
Mar 24 18:47:12 bruno anacron[1596]: Normal exit (3 jobs run)</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Fri, 24 Mar 2017 23:51:48 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=1029#p1029</guid>
		</item>
	</channel>
</rss>
