From ec8d333ba8e0b5d978a54c79819162b71306f970 Mon Sep 17 00:00:00 2001 From: Todd Lyons Date: Fri, 30 May 2014 13:55:35 -0700 Subject: [PATCH] Add comment about umask 0022 --- Installation.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Installation.md b/Installation.md index 61c6a0a..aea4168 100644 --- a/Installation.md +++ b/Installation.md @@ -24,21 +24,22 @@ This will create the repo checkout in the directory *~/code/*. `mkdir $HOME/buildfarm` 11. Directory permissions must be lax enough for the **exim** user running the test suite to be able to access the files that user farm has checked out. Make the **farm** user's home directory be world readable and world searchable: `chmod o+rx $HOME` -12. Test the configure process by running `./run_build.pl --test --verbose=2 --only-steps=configure`. If there are errors, you'll need to correct them until the process succeeds (ends with OK). You can repeat this as many times as necessary because test mode does not store the status of the git repo or the status of each stage of the build. -13. Test the build process by running `./run_build.pl --test --verbose=2 --only-steps=configure,make`. If there are build errors, make adjustments, install additional packages, etc, and repeat the test. -14. Test the test suite by running `./run_build.pl --test --verbose=2 --only-steps=configure,make,test --override range_num_tests='1 2'`. If there are build errors when building the test suite, or runtime errors trying to run the test suite, you may need to install additional packages (you shouldn't though). -15. If you enabled the documentation building process in the *build-farm.conf*, then you can try to build it with `./run_build.pl --test --verbose=2 --only-steps=configure,make-doc`. For documentation generation to succeed, it will require extra packages to be installed to support xml, xslt, pdf, and a few other things. -16. If you can get past each of these steps, then your build farm system meets the minimum requirements. -17. The official process can be kicked off by running `/home/farm/code/run_cron.sh --run-all`. This will run the default build configuration, keep track of the git repository status, and upload the build results to the server. -18. Once that command runs with no complaints, add it to the **farm** user crontab. You can run it at whatever frequency you choose, I suggest 1 hour. If a previous instantiation is still running, the script will detect the lockfile and exit so as not to step on each other. -19. I had a problem running the *run_cron.sh* script in that cron gives a highly sanitized path to the script when it runs it. I made a second wrapper script to call the first one so I could put path elements in that were needed: +12. Make sure that your umask is 0022: `umask 0022`. This also will need to be set in any script you call the run_build.pl script. +13. Test the configure process by running `./run_build.pl --test --verbose=2 --only-steps=configure`. If there are errors, you'll need to correct them until the process succeeds (ends with OK). You can repeat this as many times as necessary because test mode does not store the status of the git repo or the status of each stage of the build. +14. Test the build process by running `./run_build.pl --test --verbose=2 --only-steps=configure,make`. If there are build errors, make adjustments, install additional packages, etc, and repeat the test. +15. Test the test suite by running `./run_build.pl --test --verbose=2 --only-steps=configure,make,test --override range_num_tests='1 2'`. If there are build errors when building the test suite, or runtime errors trying to run the test suite, you may need to install additional packages (you shouldn't though). +16. If you enabled the documentation building process in the *build-farm.conf*, then you can try to build it with `./run_build.pl --test --verbose=2 --only-steps=configure,make-doc`. For documentation generation to succeed, it will require extra packages to be installed to support xml, xslt, pdf, and a few other things. +17. If you can get past each of these steps, then your build farm system meets the minimum requirements. +18. The official process can be kicked off by running `/home/farm/code/run_cron.sh --run-all`. This will run the default build configuration, keep track of the git repository status, and upload the build results to the server. +19. Once that command runs with no complaints, add it to the **farm** user crontab. You can run it at whatever frequency you choose, I suggest 1 hour. If a previous instantiation is still running, the script will detect the lockfile and exit so as not to step on each other. +20. I had a problem running the *run_cron.sh* script in that cron gives a highly sanitized path to the script when it runs it. I made a second wrapper script to call the first one so I could put path elements in that were needed:
$ more /home/farm/bin/build_farm.sh
 #!/bin/bash
 export PATH="/usr/local/bin:/sbin:/usr/sbin:$PATH"
 $HOME/code/run_cron.sh --run-all $@
 
Then I make my cronjob call: `6 * * * * $HOME/bin/build_farm.sh` .... but ... -20. My cronjob ran great for a couple weeks. Then another problem popped up running the cron job in that the test portion suddenly started failing with an odd error: +21. My cronjob ran great for a couple weeks. Then another problem popped up running the cron job in that the test portion suddenly started failing with an odd error:
** runtest error: Failed to open /dev/tty: No such device or address
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:
# Press Enter to use defaults for all questions in
-- 
2.30.2