* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: config.h.in,v 1.28 2001-05-28 18:51:24 thib Exp $ */
+ /* $Id: config.h.in,v 1.29 2001-05-29 19:32:45 thib Exp $ */
/* *********************************************************** */
* added to serial queue each time it has to grow
* up */
+#define SERIAL_MAX_RUNNING 1 /* fcron will run (by default) no more than this
+ * number of serial job simultaneously.
+ * (this may be overridden by fcron option -m */
+
#define LAVG_QUEUE_MAX 30 /* if lavg queue contains this number of entries,
* the next lavg job to be executed will be run
* before a new lavg job is added */
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: database.c,v 1.52 2001-05-24 19:59:47 thib Exp $ */
+ /* $Id: database.c,v 1.53 2001-05-29 19:32:37 thib Exp $ */
#include "fcron.h"
#include "database.h"
run_queue_job(line);
}
else {
- warn(" process already running: %s %s",
+ warn(" process already running: %s's %s",
line->cl_file->cf_user,
line->cl_shell
);
/* debug("running next serial job"); */
/* // */
-/* debug("num: %d running:%d index:%d", serial_num, serial_running, */
-/* serial_array_index); */
+ debug("num: %d running:%d index:%d", serial_num, serial_running,
+ serial_array_index);
if ( serial_num != 0 ) {
run_queue_job(serial_array[serial_array_index]);
serial_array[serial_array_index] = NULL;
return;
}
-/* debug("inserting in serial queue %s", line->cl_shell); */
+ debug("inserting in serial queue %s", line->cl_shell);
if ( serial_num >= serial_array_size ) {
if ( serial_num >= SERIAL_QUEUE_MAX )
if ( is_serial_once(line->cl_option) ) {
clear_serial_once(line->cl_option);
- if ( --serial_running <= 0 )
+ if ( --serial_running < serial_max_running )
run_serial_job();
}
else if ( is_serial(line->cl_option)
&& ! is_lavg(line->cl_option) ) {
- if (--serial_running <= 0)
+ if (--serial_running < serial_max_running)
run_serial_job();
}
else if ( is_lavg(line->cl_option) &&
i = 0;
while ( i < lavg_num ) {
/* check if the line should be executed */
- if ( lavg_serial_running > 0 &&
+ if ( lavg_serial_running >= serial_max_running &&
is_serial(lavg_array[i].l_line->cl_option) ) {
i++;
continue;
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcron.h,v 1.22 2001-05-17 00:57:25 thib Exp $ */
+ /* $Id: fcron.h,v 1.23 2001-05-29 19:27:55 thib Exp $ */
#ifndef __FCRON_H__
#define __FCRON_H__
extern short int serial_array_index;
extern short int serial_num;
extern short int serial_running;
+extern short int serial_max_running;
extern struct exe *exe_array;
extern short int exe_array_size;
extern short int exe_num;