Bug 190268 - check whether cron.daily was run with hibernation
Summary: check whether cron.daily was run with hibernation
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Brock Organ
URL:
Whiteboard:
: 125779 197394 205114 249586 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-29 19:42 UTC by Bastien Nocera
Modified: 2009-03-17 15:06 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-17 15:06:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bastien Nocera 2006-04-29 19:42:49 UTC
man-1.6c-2.fc5

makewhatis started running on my laptop, while it was unplugged from the AC. The
scripts should use on_ac_power and not run when the laptop is on battery power.

Comment 2 Marcela Mašláňová 2006-11-29 09:26:40 UTC
I have some bugs related with "laptop on battery". I'm thinking about some
global solution.

Comment 3 Marcela Mašláňová 2007-07-11 15:27:05 UTC
*** Bug 205114 has been marked as a duplicate of this bug. ***

Comment 4 Marcela Mašláňová 2007-07-11 15:29:18 UTC
*** Bug 197394 has been marked as a duplicate of this bug. ***

Comment 5 Marcela Mašláňová 2007-07-30 14:26:39 UTC
*** Bug 249586 has been marked as a duplicate of this bug. ***

Comment 6 Thorsten Leemhuis 2007-07-30 14:39:09 UTC
/me adjusts the summary of this bug to a general one, as the bugs that were
marked as dupes for this one are not specific to makewhatis (mine was for
prelink, which is way worse then makewhatis here)

(In reply to comment #0)
> man-1.6c-2.fc5
> makewhatis started running on my laptop, while it was unplugged from the AC. The
> scripts should use on_ac_power and not run when the laptop is on battery power.

Bastien, its just a workaround and we need a proper solution, but for now my
workaround was to add "MAKEWHATISDBUPDATES n" to /etc/man.config as I don't use
makewhatis

(In reply to comment #2)
> I have some bugs related with "laptop on battery". I'm thinking about some
> global solution.

Marcela, that was months ago. Did something come out of it? Otherwise I vote for
"fixing the worst jobs for F8 with small hacks" until we have a proper solution

Comment 7 Marcela Mašláňová 2007-07-30 14:55:26 UTC
I believe it should be fixed in some laptop configuration tool. In the meantime
I'll try to fix it with some script, which control on "battery" and don't run
some jobs.

Comment 8 Thorsten Leemhuis 2007-07-30 16:46:43 UTC
(In reply to comment #7)
> I believe it should be fixed in some laptop configuration tool.

Why configuration tool? It IMHO should "just work (tm)"

> In the meantime
> I'll try to fix it with some script, which control on "battery" and don't run
> some jobs.

thx; if you need any help let me know; I'm willing to help write some bash
scritps if you outline a rough solution (we can discuss our ideas on IRC, on a
mailing list or here as well beforehand); and of course I'm also willing to test
stuff. 



Comment 9 Bastien Nocera 2007-07-30 18:01:40 UTC
There's indeed no need for a configuration tool, and there's already a script,
it's called "on_ac_power", and it's in the pm-utils.

Comment 10 David Anderson 2007-08-01 13:12:47 UTC
IMO, it would be sufficient to use "on_ac_power" for the bigger cron jobs (the 
prelink monster, makewhatis). These are optional jobs which help save time 
later but don't affect functionality; ideal candidates for an optional cron 
job that can and should be skipped to save batter power. No global solution is 
really needed; this isn't an ugly hack, it's exactly the kind of situation 
that on_ac_power is designed for.

Comment 11 Marcela Mašláňová 2007-08-14 10:29:18 UTC
I used on_ac_power for anacron - cron.daily,... I hope that fix will be ok for
all  "jobs should not run when on battery". 

Comment 12 Marcela Mašláňová 2007-08-14 10:42:18 UTC
*** Bug 125779 has been marked as a duplicate of this bug. ***

Comment 13 Thorsten Leemhuis 2007-08-14 10:55:19 UTC
(In reply to comment #11)
> I used on_ac_power for anacron - cron.daily,... I hope that fix will be ok for
> all  "jobs should not run when on battery". 

I'd tend to say it's a hack that might create more problems then it solved:

- some of the cron.daily job IMHO should run even when on battery (e.g.
0logwatch and logrotate for example)

- what about cron.{hourly, weekly, monthly}?

- what if someone always starts his notebook on battery everyday in the morning
(e.g. when traveling by train to work for 90 minutes)? Then the daily jobs might
never run if cron tries to start the jobs in that timeframe (even when the
system is on_as later (e.g. when at work) most of the day).

Comment 14 Marcela Mašláňová 2007-08-14 11:09:04 UTC
It's upstream solution changed for fedora. If you have something better don't be
shy and let me know.

This script should start after each reboot and if the cron.daily wasn't run
today and the laptop is not on battery, then should it run dailly.



Comment 15 Aaron Kaplan 2007-10-13 11:51:22 UTC
Don't most laptop users hibernate rather than shutting down?  Checking at boot
time isn't much good on a machine that never reboots except for kernel updates.

Comment 16 Marcela Mašláňová 2007-10-15 07:05:33 UTC
Well, my laptop doesn't hibernate :)

I try to add other features (like running jobs after hibernate), but not in F-8.

Comment 17 Kurt Erickson 2008-03-02 00:58:54 UTC
Can we re-open this? It's a serious problem, and clearly hasn't been resolved.

Comment 18 Dave 2008-03-26 02:44:05 UTC
(In reply to comment #15)
> Don't most laptop users hibernate rather than shutting down?  

No they don't.
Almost nobody I know actually uses hibernate, because you generally need to 
authenticate to a whole bunch of resources when you get to your office and the 
easiest way to make sure it all happens correctly (on our company network 
anyway) is to shut down and do a clean boot.
If you hibernate and then try to use the machine without the expected resources 
connected, there is no end to the niggly little problems that make it 'not 
worth the effort'(tm)




Comment 19 Marcela Mašláňová 2008-03-27 10:33:09 UTC
#17 now my laptop can hibernate and you're right. The jobs weren't run after
hibernation.

Comment 20 Marcela Mašláňová 2008-05-05 10:34:01 UTC
I use a script in the cron.hourly, which checks whether cron.daily runs or not,
but at the moment I have problem with hibernation. dm-crypt and hibernate
doesn't work for some time, but I'll be solving issue.

Comment 21 Bug Zapper 2008-05-14 02:09:28 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 22 Marcela Mašláňová 2009-03-17 15:06:29 UTC
In the rawhide is cron set to run script which checks whether anacron executed daily jobs or not. This script check anacron every hour, so it's probable a laptop will be on power and also hibernation couldn't fail it. This will be fixed in F-11, also in F-10 are some workarounds script.


Note You need to log in before you can comment on or make changes to this bug.