function init_variables {
echo _.-~= initializing installer
+ date
# -----------------------------------------------------------------------
# Handling passed arguments to the script
# -----------------------------------------------------------------------
function configure_timezone {
echo _.-~= configure timezone
+ date
# should be America/New_York
perl -e 'print "2\n\n104\n";' | dpkg-reconfigure -fteletype tzdata
echo End of configure timezone =~-._
function configure_cpan {
echo _.-~= configure CPAN
+ date
# -----------------------------------------------------------------------
# force CPAN to load by installing something that should already be installed
if [ $YES ]; then
function build_essentials {
echo _.-~= Installing some build essentials
+ date
# Install some essential tools
apt-get update \
&& apt-get -yq dist-upgrade \
function setting_up_opensrf_env {
echo _.-~= creating opensrf user and environment
+ date
# Create opensrf user and set up environment
if [ ! "$(grep ^opensrf: /etc/passwd)" ]; then
useradd -m -s /bin/bash opensrf
function cloning_git_repos {
echo _.-~= cloning git repositories
+ date
OSRF_COMMAND="
cd /home/opensrf;
git clone --depth 0 --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
function opensrf_prereqs {
echo _.-~= Installing OpenSRF pre-requisites
+ date
# Install pre-reqs
mkdir -p /usr/src/evergreen;
cd /usr/src/evergreen;
function evergreen_prereqs {
echo _.-~= Installing Evergreen pre-requisites
+ date
if [ $YES ]; then
yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
else
function evergreen_db_prereqs {
echo _.-~= Installing Evergreen database pre-requisites
+ date
if [ $YES ]; then
yes | make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
else
function setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd {
echo _.-~= setting ld.so.conf and rsyslog and /etc/hosts and ejabberd
+ date
cp $BASE_DIR/evergreen.ld.conf /etc/ld.so.conf.d/
ldconfig;
echo Return Value = $?
function build_opensrf {
# Build and install OpenSRF
echo _.-~= Building OpenSRF
+ date
OSRF_COMMAND='
cd /home/opensrf/OpenSRF;
autoreconf -i;
function test_opensrf_build {
echo _.-~= Running OpenSRF build tests
+ date
cd /home/opensrf/OpenSRF;
make check
echo Return Value = $?
function install_opensrf {
echo _.-~= Installing OpenSRF
+ date
make install
echo Return Value = $?
echo End of Installing OpenSRF =~-._
function build_evergreen {
echo _.-~= Building Evergreen
+ date
OSRF_COMMAND='
export PATH=/openils/bin:$PATH
cd /home/opensrf/Evergreen;
function test_evergreen_build {
echo _.-~= Running Evergreen build tests
+ date
cd /home/opensrf/Evergreen
make check
echo Return Value = $?
function install_evergreen {
echo _.-~= Installing Evergreen
+ date
make install
echo Return Value = $?
function configure_database {
echo _.-~= configure database
+ date
if [ $YES ]; then
echo "Using password evergreen for the evergreen database user."
echo -e "evergreen\nevergreen\n" | su - postgres sh -c 'createuser -P -s evergreen;'
function configure_apache {
echo _.-~= configure apache
+ date
/etc/init.d/apache2 stop
# Copy apache configs into place and create SSL cert
cd /home/opensrf/Evergreen/
function start_evergreen {
echo _.-~= Starting Evergreen
+ date
if [ $LIVETEST ]; then
rm /openils/var/log/*.log
fi
# TODO: Eventually move these tests into a Make target within Evergreen
cd /home/opensrf/Evergreen
echo _.-~= Running pgTAP tests
+ date
su - postgres -c 'cd /home/opensrf/Evergreen ; pg_prove -vr -d evergreen Open-ILS/src/sql/Pg/t/ ; echo Return Value = $?'
echo End of pgTAP tests =~-._
echo _.-~= Running pgTAP live tests
+ date
su - postgres -c 'cd /home/opensrf/Evergreen ; pg_prove -vr -d evergreen Open-ILS/src/sql/Pg/live_t/ ; echo Return Value = $?'
echo End of pgTAP live tests =~-._
echo _.-~= Running settings-tester.pl
+ date
su - opensrf sh -c 'export PATH=/openils/bin:$PATH ; cd /home/opensrf/Evergreen/Open-ILS/src/support-scripts/ ; ./settings-tester.pl ; echo Return Value = $?'
echo End of settings-tester.pl output =~-._
echo _.-~= Running perl live tests
+ date
su - opensrf sh -c 'export PATH=/openils/bin:$PATH ; cd /home/opensrf/Evergreen/Open-ILS/src/perlmods/ ; make livecheck; echo Return Value = $?'
echo End of perl live tests =~-._
echo _.-~= Gathering log summary
+ date
echo ''
echo 'wc -l *.log:'
su - opensrf sh -c 'cd /openils/var/log/ ; wc -l *.log'
cd /openils/var/log/
for x in *.log; do
echo _.-~= Log Output: $x
+ date
cat $x
echo End of $x =~-._
done