rtcidle Code
Status: Beta
Brought to you by:
sgerwk
rtcidle is a Linux daemon that suspend the computer (with apm or acpi) if no user activity has been detected for a given amount of time; - does not suspend if a program listed in /etc/rtcidle.conf is running - if an at or cron job is to be executed in less than 5 minutes, it does not sleep - it sleeps until 2 minutes before the next scheduled at or cron job, or until 22:58 hours in the future, whichever comes first ************************************** * See also index.html in the package * ************************************** Installation ------------ Vixie cron or cronie sources are required in a local directory; update the VCRDIR variable in Makefile.local accordingly; make cp rtcidle.conf /etc Copying rtcidle.before and rtcidle.after to /etc and customizing them might be useful. Queues ------ The directories at/ and cron/ contains code for finding the next time at or cron have a scheduled job. atqueue.c: time_t atnext(time_t now, int *running); next time for an at scheduled job; if running is not NULL, it will be stored whether an at job is currently running (according to the at queue, note that is not reliable) cronqueue.c: time_t cronnext(time_t now, char *include, char *exclude, char *prog_name); next time for a cron job; pass argv[0] as prog_name; include and exclude limit the search by cmdline programs.c: char **readList(char *filename); reads a list from a file (list of program names to check) int runningProgram(char **list); checks whether any of the program in the list is running Child ----- This directory contains 'waiting', a standalone program. Run a program as 'waiting programname arg arg arg...' to avoid suspending when the program is running. This program also allows specifying a timeout.