-This is not a sudo issue. This is happening because the cron daemon does not give a tty to the cronjob that it starts. (How the heck did it ever work?) The runtest script needs a tty in normal operation. To fix this, I used an old trick of ssh'ing to localhost with the *-tt* option to **force** allocation of a local tty when starting the *build_farm.sh* script. To do this, you need to configure the **farm** user to use key-based authentication with its own key. Assuming you have not generated an ssh key yet:
+This is not a sudo issue. This is happening because the cron daemon does not give a tty to the cronjob that it starts. (How the heck did it ever work?) The runtest script needs a tty in normal operation. To fix this, you have two options: a) scripting magic to start screen and run the build inside of screen b) an old trick of ssh'ing to localhost with the *-tt* option to force allocation of a local tty when starting the *build_farm.sh* script.
+<pre></pre>
+**Option A**: To use the screen based solution, I made a simple script:
+<pre><code>
+$ more $HOME/bin/build_farm_screen.sh
+#!/bin/bash
+TITLE="BuildFarm"
+COUNT=`screen -list | grep $TITLE | wc -l`
+if [ $COUNT -eq 0 ]; then
+ echo "Screen not running, start a new one"
+ screen -d -m -S $TITLE
+fi
+screen -S $TITLE -p 0 -X stuff 'for DACONF in $HOME/code/build-farm.conf
+ do
+ $HOME/bin/build_farm.sh --config=$DACONF $@ 2>/dev/null
+ done
+'
+</code></pre>
+Note that the lone single quote on the last line is required, and it must be on the next line, not at the end of the previous line because it emits a newline, causing the command to be executed in the screen session. Once that works properly, then the cron command changes to:
+<pre>`6 */2 * * * $HOME/bin/build_farm_screen.sh`</pre>
+**Option B**: To use the ssh based solution, you need to configure the **farm** user to use key-based authentication with its own key. Assuming you have not generated an ssh key yet: