From: Thibault Godouet Date: Sat, 16 Jan 2010 10:46:00 +0000 (+0000) Subject: Merge branch 'master' of ssh://yo4096@git.tuxfamily.org/gitroot/fcron/fcron X-Git-Tag: ver3_1_0~38^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5ff8b503ee3074b41a3b878320384bde38f78e4;p=thirdparty%2Ffcron.git Merge branch 'master' of ssh://yo4096@git.tuxfamily.org/gitroot/fcron/fcron Conflicts: doc/en/todo.sgml read_string.c --- b5ff8b503ee3074b41a3b878320384bde38f78e4 diff --cc database.c index 7751148,65d8afd..d66a486 --- a/database.c +++ b/database.c @@@ -41,6 -41,11 +41,32 @@@ void run_serial_job(void) void run_lavg_job(lavg_t *l); void run_queue_job(cl_t *line); ++void ++run_reboot_jobs(void) ++{ ++ int reboot = 0; ++ struct job_t *j; ++ ++ /* lock exist - skip reboot jobs */ ++ if (access(REBOOT_LOCK, F_OK) == 0) { ++ info("@reboot jobs will only be run at computer's startup."); ++ return; ++ } ++ /* lock doesn't exist - create lock, run reboot jobs */ ++ if ((reboot = creat(REBOOT_LOCK, S_IRUSR & S_IWUSR)) < 0) ++ error_e("Can't create lock for reboot jobs."); ++ else ++ close(reboot); + -#if ! defined(HAVE_SETENV) || ! defined(HAVE_UNSETENV) -char env_tz[PATH_LEN]; -#endif ++ for (u = db->head; u != NULL; u = u->next) { ++ for (e = u->crontab; e != NULL; e = e->next) { ++ if (e->flags & WHEN_REBOOT) ++ job_add(e, u); ++ } ++ } ++ (void) job_runqueue(); ++} + void test_jobs(void) /* determine which jobs need to be run, and run them. */ diff --cc doc/en/todo.sgml index 216a93e,a133faf..34656cd --- a/doc/en/todo.sgml +++ b/doc/en/todo.sgml @@@ -24,12 -24,18 +24,24 @@@ A copy of the license is included in gf High priority + + change copyright to ...,2008,2009,2010 + + + could be worth checking fcron for memory leaks using specialized library (just in case...) + + + option to put a maximum limit on the execution time of a task + terminate it if not finished yet + send email to let the user know + - ++ + @reboot: don't run the job the first time it is loaded by fcron after having been created -- otherwise we can't use fcron as a 'rc' start/stop script for users without root privileges + + + jitter feature: if 100 jobs to be started at the same minute, then make them start at a random second of that minute to limit load spikes (see BSD cron jitter feature) + + + setting to limit the number of jobs of a single user in the serialq/lavgq to X jobs + make sure root always has Y slots that it can use in those queues (i.e. number of slots used by root + number of free slots >= Y) + Test (and use ?) docbook2x-man -- xlstproc ? cf http://antoine.ginies.free.fr/docbook/ch09.html @@@ -135,4 -141,4 +147,3 @@@ mode: sgm sgml-parent-document:("fcron-doc.sgml" "book" "chapter" "sect1" "") End: --> - -