AboutSummaryRefsLogTreeCommitDiffStats
path: root/mcron-core.scm
diff options
context:
space:
mode:
authordale_mellor <dale_mellor>2004-01-22 13:54:21 +0000
committerdale_mellor <dale_mellor>2004-01-22 13:54:21 +0000
commit627e81918e50e7806aace870d1529adf5d75a15d (patch)
tree379d46f025c297f9ab392d1663d85fd84227ef92 /mcron-core.scm
parenteb50865add48ceccfa38bf4165351dd0418df41f (diff)
downloadmcron-1.0.0.tar.gz
mcron-1.0.0.tar.bz2
mcron-1.0.0.zip
This is the version 1.0.0 release (many changes have occurred without commiting due to disruption to Savannah, including a skip over the 0.99.4 release).1.0.0
Diffstat (limited to 'mcron-core.scm')
-rw-r--r--mcron-core.scm23
1 files changed, 14 insertions, 9 deletions
diff --git a/mcron-core.scm b/mcron-core.scm
index 90e1da9..0aaacc6 100644
--- a/mcron-core.scm
+++ b/mcron-core.scm
@@ -40,10 +40,9 @@
;;
;; (vector user next-time-function action environment displayable next-time)
;;
-;; where action may be a string (indicating a shell command) or a list
-;; (indicating scheme code) or a procedure, and the environment is an alist of
+;; where action must be a procedure, and the environment is an alist of
;; modifications that need making to the UNIX environment before the action is
-;; run. The next-time elements is the only one that is modified during the
+;; run. The next-time element is the only one that is modified during the
;; running of a cron process (i.e. all the others are set once and for all at
;; configuration time).
;;
@@ -158,16 +157,16 @@
-;; If the user has requested a schedule of jobs that will run, we provide the
-;; information here and then get out.
+;; Create a string containing a textual list of the next count jobs to run.
;;
-;; Start by determining the number of time points in the future that output is
-;; required for. This may be provided on the command line as a parameter to the
-;; --schedule option, or else we assume a default of 8. Having determined this
-;; count we enter a loop of displaying the next set of jobs to run, artificially
+;; Enter a loop of displaying the next set of jobs to run, artificially
;; forwarding the time to the next time point (instead of waiting for it to
;; occur as we would do in a normal run of mcron), and recurse around the loop
;; count times.
+;;
+;; Note that this has the effect of mutating the job timings. Thus the program
+;; must exit after calling this function; the internal data state will be left
+;; unusable.
(define (get-schedule count)
(with-output-to-string
@@ -219,6 +218,12 @@
;; ones to run (may be more than one). Set an alarm and go to sleep. When we
;; wake, run the jobs and reap any children (old jobs) that have
;; completed. Repeat ad infinitum.
+;;
+;; Note that, if we wake ahead of time, it can only mean that a signal has been
+;; sent by a crontab job to tell us to re-read a crontab file. In this case we
+;; break out of the loop here, and let the main procedure deal with the
+;; situation (it will eventually re-call this function, thus maintaining the
+;; loop).
(define (run-job-loop . fd-list)