[clug] Real Time Clock Alarm Power Management Management

steve jenkin sjenkin at canb.auug.org.au
Sat Mar 31 20:10:23 MDT 2012

Hal Ashburner wrote on 1/04/12 8:58 AM:

> I've failed to find something obvious that does this (written by someone
> smarter than me - which goes without saying).

sounds like you either want to modify cron/at, or more portably and with
less effort, write a 'sleep-now' command that gets scheduled with "at"
and cron.

Using the cron scheduling queues saves you from creating a new queuing
system with yet another control file. To implement your belt-and-braces
check 'why aren't you asleep', you do need a status flag outside cron
with a job scheduled every 1-15 minutes to check it, and if wrong, try a
forced sleep.

On the lines of modding 'cron', the terminal login control system (init
& /etc/inittab) got modded to produce the first 'inetd'. SUN once had a
bug where 'inetd' would shut down a port that was 'spawning too fast'
(an error condition inherited from how init did serial terminals).

In 1996, I saw a very elegant extension of 'cron' that allowed job
dependencies (run this after that and that) and work could be scheduled
"sometime within this window, but not before or after". I'm surprised
more people have added useful stuff like this to the cron control files.

Paul Bonscheck (?sp) and his company "Eclectic Vision" seem to have
dropped off the face of the Internet since then :-(

If you're looking to write code, I was always hugely impressed by Steve
Landers toolkit (Functional Software) that become "The Admin Manager"
(later COS-manager, IIRC). A set of utilities that did database
operations on text files of all descriptions, including the output of
commands ('ls' is a read-only table). [cut-join-paste + select + awk
preprocessor that allowed use of named-fields, not $1, $2 etc]

Like Oracle, they built the complex functions from a base set of simple
tools. Instead of using 'binary blobs' locked up in a DB, they used
tab-separated files for their many interrelated tables.

[I'm not against DB's for what they do well: large collections of data,
esp with in-place update of rows/fields. For systems tools, having
everything in the filesystem means when you've got problems at boot time
and only very primitive tools, you've got a chance to figure out what's
wrong and even fix it.]

I'm not suggesting you reinvent SteveL's work, but think along those lines.

Is there a small, simple set of tools (read commands) you might
construct that can be used to build a generic queuing system, the first
instance of which manages the Real Time Clock for 'wake alarams' ?

Of course, with the collective wisdom of the list, someone is likely to
say "Oh, that's XXX" and all I've written is irrelevant :-(


Steve Jenkin, Info Tech, Systems and Design Specialist.
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

sjenkin at canb.auug.org.au http://members.tip.net.au/~sjenkin

More information about the linux mailing list