utilize ${jobs}

Boris Samorodov bsam at ipt.ru
Fri Dec 5 17:55:10 EST 2008


Boris Samorodov <bsam at ipt.ru> writes:
> Joe Marcus Clarke <marcus at marcuscom.com> writes:
>> On Thu, 2008-12-04 at 09:30 +0300, Boris Samorodov wrote:
>>> 
>>> since I have 4-way server for package building I'd like to utilize a
>>> $jobs variable (make option -j). Is it possible? Thanks!
>>
>> No, it's not.  Parallel build support was never finished.
>
> Thanks.
>
>> You can, however, run multiple simultaneous builds.
>
> Yep, but it's not often applicable for my needs.

Nevertheless, it's better then none.  Tim posted original here:
http://marcuscom.com/mailman/htdig/tinderbox-list/2008-August/001205.html

Here is an updated script for tinderbox-3.x:
-----
diff -u scripts/etc/rc.d/tinderd.orig scripts/etc/rc.d/tinderd
--- scripts/etc/rc.d/tinderd.orig	2008-12-05 18:21:16.402721853 +0300
+++ scripts/etc/rc.d/tinderd	2008-12-06 01:08:58.000000000 +0300
@@ -24,6 +24,7 @@
 : ${tinderd_directory="/space/scripts"}
 : ${tinderd_flags=""}
 : ${tinderd_debug="NO"}
+: ${tinderd_instances="1"}
 
 # path to your executable, might be libexec, bin, sbin, ...
 command="${tinderd_directory}/tinderd"
@@ -39,4 +40,13 @@
     command_args=">/dev/null &"
 fi
 
+start_cmd="${name}_start"
+
+tinderd_start()
+{
+	for i in `jot - 1 ${tinderd_instances}`; do
+		${command} ${tinderd_flags} >/dev/null 2>&1 &
+	done
+}
+
 run_rc_command "$1"
diff -u scripts/tinderd.orig scripts/tinderd
--- scripts/tinderd.orig	2008-12-05 18:21:16.412782070 +0300
+++ scripts/tinderd	2008-12-06 01:36:56.435417070 +0300
@@ -19,7 +19,22 @@
     do
 	trap "" 1
 
-	ENTRY=$(${pb}/scripts/tc listBuildPortsQueue -s ENQUEUED -r | head -1)
+	ENTRY=""
+
+	if mkdir /tmp/tinderdlock >/dev/null 2>&1; then
+		${pb}/scripts/tc listBuildPortsQueue -s ENQUEUED -r > /tmp/tinderd.$$
+		while read line; do
+			BUILD=$(echo ${line} | cut -d: -f3)
+			if [ ! -f $pb/builds/$BUILD/tinderdlock -a ! -f $pb/builds/$BUILD/lock ]; then
+				touch $pb/builds/$BUILD/tinderdlock
+				ENTRY=$line
+				break
+			fi
+		done < /tmp/tinderd.$$
+		rm /tmp/tinderd.$$
+		rmdir /tmp/tinderdlock
+	fi
+
 	ID=$(echo ${ENTRY} | cut -d: -f1)
 	USER=$(echo ${ENTRY} | cut -d: -f2)
 	BUILD=$(echo ${ENTRY} | cut -d: -f3)
@@ -52,6 +67,7 @@
 
 	   ${pb}/scripts/tc reorgBuildPortsQueue
 
+	   rm $pb/builds/$BUILD/tinderdlock
 	else
 	    tinderEcho "INFO: Nothing to do. Sleeping ${TINDERD_SLEEPTIME} seconds."
 	    trap main_loop 1
-----


WBR
-- 
Boris Samorodov (bsam)
Research Engineer, http://www.ipt.ru Telephone & Internet SP
FreeBSD committer, http://www.FreeBSD.org The Power To Serve


More information about the tinderbox-list mailing list