jenkins can’t finish build script that executes a "while true" loop

we are using a self-made build server (based on Ubuntu 12.04) to build an embedded linux project. We are successfully using this server for some time now without problems by logging in via ssh and executing a build script which performs the necessary build stuff.

We would like to automate the builds with jenkins. We actually thought this should be quite easy as the jenkins job would simply call the build script to do the job.

However, it fails and hangs forever on a certain while loop within the build script. The while loop looks like this (it is used to accept default suggestions from make config)


[... other stuff]
echo Configure project sources ...
(while true ; do echo ; done
) | make config_config >> $WORKDIR/project.log 2>&1
echo Debug output to see that this line is reached ...
[... other stuff] is called from some other script ( which is again called from some other script (like This is because uses some environment variables which are setup by for the specific build environment and calls the script to set up the environment for the build server. So a builder can simply login and call “” and everything is done without any further settings.

If the script is called from jenkins, the console output looks like:

jenkins console output

[... other stuff]
Configure project sources ...

and then… it hangs forever and does not finish until the process is aborted manually in jenkins. If the while loop is removed, and e.g. replaced with a certain amount of sleep and echo to enter return, it works. However, it would be good to not change the build script (the same while loop approach is used several times in the scripts..)

Any ideas why this while loop is causing trouble? Is it even the while loop or do we miss something else here?

Source: ubuntu

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.