void run_lavg_job(lavg_t *l);
void run_queue_job(cl_t *line);
-#if ! defined(HAVE_SETENV) || ! defined(HAVE_UNSETENV)
-char env_tz[PATH_LEN];
-#endif
++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);
+
++ 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. */
<sect2>
<title>High priority</title>
<itemizedlist>
- <listitem>
+ <listitem>
+ <para>change copyright to ...,2008,2009,2010</para>
+ </listitem>
+ <listitem>
+ <para>could be worth checking fcron for memory leaks using specialized library (just in case...)</para>
+ </listitem>
+ <listitem>
+ <para>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</para>
+ </listitem>
++ <listitem>
+ <para>@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</para>
+ </listitem>
+ <listitem>
+ <para>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)</para>
+ </listitem>
+ <listitem>
+ <para>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)</para>
+ </listitem>
<listitem>
<para>Test (and use ?) docbook2x-man -- xlstproc ? cf http://antoine.ginies.free.fr/docbook/ch09.html</para>
</listitem>
sgml-parent-document:("fcron-doc.sgml" "book" "chapter" "sect1" "")
End:
-->
-
-