[open-ils-commits] r679 - ESI-Examples/trunk/tools/eg_dev_lenny_installer (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 11 16:51:20 EDT 2009
Author: erickson
Date: 2009-09-11 16:51:15 -0400 (Fri, 11 Sep 2009)
New Revision: 679
Modified:
ESI-Examples/trunk/tools/eg_dev_lenny_installer/eg_dev_lenny_installer.sh
Log:
Added test to see if the locale is using UTF-8 with suggestions on how to fix it so PG will be happy
Patch from Joe Atzberger to add some sanity checks for other actions, slight reformatting
Modified: ESI-Examples/trunk/tools/eg_dev_lenny_installer/eg_dev_lenny_installer.sh
===================================================================
--- ESI-Examples/trunk/tools/eg_dev_lenny_installer/eg_dev_lenny_installer.sh 2009-09-09 19:51:08 UTC (rev 678)
+++ ESI-Examples/trunk/tools/eg_dev_lenny_installer/eg_dev_lenny_installer.sh 2009-09-11 20:51:15 UTC (rev 679)
@@ -22,11 +22,31 @@
BASE_DIR=$PWD
+# And they're off...
+# Make sure the system is configured to use UTF-8. Otherwise, Postges setup will fail
+if [[ ! $LANG =~ "UTF-8" ]]; then
+ cat <<EOF
+ Your system locale is not configured to use UTF-8. This will cause problems with the PostgreSQL installation.
+
+ Do these steps (replace en_US with your locale):
-# And they're off...
+ 1. edit /etc/locale-gen and uncomment this line:
+ en_US.UTF-8 UTF-8
+ 2. edit /etc/default/locale and set the follow variable:
+ LANG=en_US.UTF-8
+
+ 3. run locale-gen
+ 4. log out
+ 5. log in
+ 6. Re-run this script
+EOF
+ exit;
+fi;
+
+
# Install some essential tools
apt-get update;
apt-get -yq dist-upgrade;
@@ -59,11 +79,11 @@
# Install pre-reqs
mkdir -p /usr/src/evergreen;
cd /usr/src/evergreen;
-wget 'http://svn.open-ils.org/trac/OpenSRF/export/HEAD/trunk/src/extras/Makefile.install' -O Makefile.install.osrf
+wget 'http://svn.open-ils.org/trac/OpenSRF/export/HEAD/trunk/src/extras/Makefile.install' -O Makefile.install.osrf
wget 'http://svn.open-ils.org/trac/ILS/export/HEAD/trunk/Open-ILS/src/extras/Makefile.install' -O Makefile.install.ils
make -f Makefile.install.osrf debian-lenny
-make -f Makefile.install.ils debian-lenny
-make -f Makefile.install.ils install_pgsql_server_debs_83
+make -f Makefile.install.ils debian-lenny
+make -f Makefile.install.ils install_pgsql_server_debs_83
# Patch Ejabberd and register users
@@ -76,10 +96,10 @@
chown ejabberd:ejabberd ejabberd.cfg
/etc/init.d/ejabberd start
sleep 2;
- ejabberdctl register router private.localhost $JABBER_PASSWORD
+ ejabberdctl register router private.localhost $JABBER_PASSWORD
ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
- ejabberdctl register router public.localhost $JABBER_PASSWORD
- ejabberdctl register opensrf public.localhost $JABBER_PASSWORD
+ ejabberdctl register router public.localhost $JABBER_PASSWORD
+ ejabberdctl register opensrf public.localhost $JABBER_PASSWORD
fi;
@@ -88,7 +108,7 @@
mkdir /home/opensrf/OpenSRF;
mkdir /home/opensrf/ILS;
svn co svn://svn.open-ils.org/OpenSRF/trunk /home/opensrf/OpenSRF/trunk;
-svn co svn://svn.open-ils.org/ILS/trunk /home/opensrf/ILS/trunk;
+svn co svn://svn.open-ils.org/ILS/trunk /home/opensrf/ILS/trunk;
cd /home/opensrf/OpenSRF/trunk;
./autogen.sh;
./configure --prefix=/openils --sysconfdir=/openils/conf;
@@ -108,8 +128,8 @@
su - opensrf sh -c "$OSRF_COMMAND"
cd /home/opensrf/ILS/trunk;
make install
-cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml
-cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
+cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml
+cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
# fetch and install Dojo
@@ -128,12 +148,12 @@
# Create the DB
PG_COMMAND='
createdb -E UNICODE evergreen;
-createlang plperl evergreen;
-createlang plperlu evergreen;
-createlang plpgsql evergreen;
+createlang plperl evergreen;
+createlang plperlu evergreen;
+createlang plpgsql evergreen;
psql -f /usr/share/postgresql/8.3/contrib/tablefunc.sql evergreen;
-psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql evergreen;
-psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql evergreen;
+psql -f /usr/share/postgresql/8.3/contrib/tsearch2.sql evergreen;
+psql -f /usr/share/postgresql/8.3/contrib/pgxml.sql evergreen;
echo -e "\n\nPlease enter a password for the evergreen database user. If you do not want to edit configs, use \"evergreen\"\n"
createuser -P -s evergreen;'
su - postgres sh -c "$PG_COMMAND"
@@ -145,35 +165,44 @@
--user evergreen --password evergreen --hostname localhost --database evergreen
# Copy apache configs into place and create SSL cert
-cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/
+cp Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/
cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
-cp Open-ILS/examples/apache/startup.pl /etc/apache2/
-mkdir /etc/apache2/ssl
-cd /etc/apache2/ssl
-echo -e "\n\nConfiguring a temporary SSL certificate....\n";
-openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+cp Open-ILS/examples/apache/startup.pl /etc/apache2/
+if [ ! -d /etc/apache2/ssl ] ; then
+ mkdir /etc/apache2/ssl
+fi
+if [ ! -f /etc/apache2/ssl/server.key ] ; then
+ echo -e "\n\nConfiguring a new temporary SSL certificate....\n";
+ openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+else
+ echo -e "\nkeeping existing ssl/server.key file\n";
+fi
a2enmod ssl
a2enmod rewrite
a2enmod expires
+if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
+ cat <<EOF
-cat <<EOF
+* Add these lines to /etc/hosts.
-* Add these lines to /etc/hosts. Type Enter when complete.
-
127.0.1.2 public.localhost public
127.0.1.3 private.localhost private
+EOF
+
+else
+ echo "INFO: /etc/hosts already has public.localhost line";
+fi
+
+cat <<EOF
* Start services
su - opensrf
osrf_ctl.sh -l -a start_router;
-osrf_ctl.sh -l -a start_perl;
-sleep 10;
-osrf_ctl.sh -l -a start_c;
-sleep 3;
-cd /openils/bin/;
-./autogen.sh ../conf/opensrf_core.xml;
+osrf_ctl.sh -l -a start_perl && sleep 10;
+osrf_ctl.sh -l -a start_c && sleep 3;
+/openils/bin/autogen.sh /openils/conf/opensrf_core.xml;
* Test the system
More information about the open-ils-commits
mailing list