Ticket #204 (closed enhancement: fixed)
Opened 10 months ago
Last modified 8 months ago
move fsck:_on_ac_power into exported functions.sh
Reported by: | www.google.com/accounts/o8/id?id=aitoawkbw4vdu6aaynqe8cbzdws7zvktd-esybq | Owned by: | roy |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | rc | Version: | 0.5 |
Keywords: | Cc: |
Description
i get requests from people to update cronjobs to not run when on battery (like updatedb), and i personally do the same thing in my own cronjob scripts. rather than duplicating this crap, openrc should export it for all to use.
Change History
comment:1 Changed 10 months ago by roy.marples.name
comment:2 Changed 10 months ago by www.google.com/accounts/o8/id?id=aitoawkbw4vdu6aaynqe8cbzdws7zvktd-esybq
i could care less about services. if you read the comment, i need to use it in random cronjobs.
the point of functions.sh is to include utility functions that scripts like to use -- which is exactly what on_ac_power() is. considering what the code looks like, pushing it into an applet/C code doesnt really make sense. but you're the one maintaining it, so i guess if you want to do it that way, more power to you.
comment:3 Changed 10 months ago by roy.marples.name
Sorry, I thought you mean only run cron when on power, otherwise don't run any jobs.
It doesn't have to be in a plugin - a shell script also suffices.
comment:4 Changed 10 months ago by www.google.com/accounts/o8/id?id=aitoawkbw4vdu6aaynqe8cbzdws7zvktd-esybq
- Type changed from defect to enhancement
gotcha. sorry for not being clearer in the original report.
comment:5 Changed 8 months ago by roy.marples.name
- Status changed from new to closed
- Resolution set to fixed
I disagree.
What we need is support for RC events so that the user can say what services are stopped/started when battery state changes.
Although generic support for detecting battery state could be added into an rc-plugin and available via $PATH rather than bloating functions.sh