As asked by Sergio Ballestreros, adding TS_SLOTS to set the default amount of
slots at server start time.
--- a/main.c Tue Aug 12 12:50:43 2008 +0200
+++ b/main.c Tue Aug 12 12:57:40 2008 +0200
@@ -311,6 +311,7 @@
printf(" TS_ONFINISH binary called on job end (passes jobid, error, outfile, command).\n");
printf(" TS_ENV command called on enqueue. Its output determines the job information.\n");
printf(" TS_SAVELIST filename which will store the list, if the server dies.\n");
+ printf(" TS_SLOTS amount of jobs which can run at once, read on server start.\n");
printf("Actions:\n");
printf(" -K kill the task spooler server\n");
printf(" -C clear the list of finished jobs\n");
--- a/server.c Tue Aug 12 12:50:43 2008 +0200
+++ b/server.c Tue Aug 12 12:57:40 2008 +0200
@@ -80,6 +80,19 @@
exit(1);
}
+static void set_default_maxslots()
+{
+ char *str;
+
+ str = getenv("TS_SLOTS");
+ if (str != NULL)
+ {
+ int slots;
+ slots = abs(atoi(str));
+ s_set_max_slots(slots);
+ }
+}
+
static void install_sigterm_handler()
{
struct sigaction act;
@@ -151,6 +164,8 @@
install_sigterm_handler();
+ set_default_maxslots();
+
notify_parent(notify_fd);
server_loop(ls);