+++ /dev/null
-Author: Bill Erickson <berick@esilibrary.com>
-Copyright: (C) 2009-2012 Equinox Software Inc.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-----------------------------------------------------------
-
-Mostly automated "master" install of OpenSRF and Evergreen on Debian.
-
-WARNING: This is for development and evaluation purposes only. Use at own risk.
-
-Steps:
- 1. Install Debian
- 2. Put these files on the server
- 3. Run the script as root and do what it says
-
-
-
-
-
+++ /dev/null
-#!/bin/bash
-# -----------------------------------------------------------------------
-# Copyright (C) 2009-2012 Equinox Software Inc.
-# Bill Erickson <berick@esilibrary.com>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-while getopts ayst option
-do
- case "${option}"
- in
- a) AUTOSTART=1;;
- y) YES=1;;
- s) SAMPLEDATA=--load-all-sample;;
- t) LIVETEST=1;;
- esac
-done
-
-function my_init {
- date
- init_variables
- configure_timezone
- configure_cpan
- build_essentials
- setting_up_opensrf_env
- cloning_git_repos
- opensrf_prereqs
- evergreen_prereqs
- evergreen_db_prereqs
- setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd
- build_opensrf
- test_opensrf_build
- install_opensrf
- build_evergreen
- test_evergreen_build
- test_and_build_eg_browser_client
- install_evergreen
- configure_database
- configure_apache
- if [ $AUTOSTART ]; then
- start_evergreen
- if [ $LIVETEST ]; then
- test_evergreen_live
- fi
- fi
-}
-
-function init_variables {
- echo _.-~= initializing installer
- date
- # -----------------------------------------------------------------------
- # Handling passed arguments to the script
- # -----------------------------------------------------------------------
- export DOJO_VERSION='1.3.3';
- export PATH=/openils/bin:$PATH
- export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
- export BASE_DIR=$PWD
- echo AUTOSTART=${AUTOSTART}
- echo YES=${YES}
- echo SAMPLEDATA=${SAMPLEDATA}
- echo LIVETEST=${LIVETEST}
- echo DOJO_VERSION=${DOJO_VERSION}
- echo PATH=${PATH}
- echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
- echo BASE_DIR=${BASE_DIR}
- # -----------------------------------------------------------------------
- # Change to suit...
- # -----------------------------------------------------------------------
- # If you change the jabber password, you will need to
- # edit opensrf_core.xml and srfsh.xml accordingly
- export JABBER_PASSWORD='password'
- export ADMIN_USER='admin';
- export ADMIN_PASS='demo123';
- # -----------------------------------------------------------------------
- # You can override these like so:
- # EVERGREEN_BRANCH='master' ./eg_jessie_installer.sh
- # -----------------------------------------------------------------------
- OPENSRF_REPO='git://git.evergreen-ils.org/OpenSRF.git'
- OPENSRF_BRANCH='master'
- EVERGREEN_REPO='git://git.evergreen-ils.org/Evergreen.git'
- EVERGREEN_BRANCH='master'
- echo OPENSRF_REPO=${OPENSRF_REPO}
- echo OPENSRF_BRANCH=${OPENSRF_BRANCH}
- echo EVERGREEN_REPO=${EVERGREEN_REPO}
- echo EVERGREEN_BRANCH=${EVERGREEN_BRANCH}
- OPENSRF_PREREQ_TARGET=debian-jessie
- EVERGREEN_PREREQ_TARGET=debian-jessie
- EVERGREEN_DB_PREREQ_TARGET=postgres-server-debian-jessie
- echo OPENSRF_PREREQ_TARGET=${OPENSRF_PREREQ_TARGET}
- echo EVERGREEN_PREREQ_TARGET=${EVERGREEN_PREREQ_TARGET}
- echo EVERGREEN_DB_PREREQ_TARGET=${EVERGREEN_DB_PREREQ_TARGET}
-
- export NODEJS_REPO='https://github.com/joyent/node.git'
- export NODEJS_VERSION='v0.10.31'
- echo "NODEJS_REPO=$NODEJS_REPO"
- echo "NODEJS_VERSION=$NODEJS_VERSION"
-
- echo End of intializing installer =~-._
-}
-
-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
- yes | cpan Fcntl
- else
- cpan Fcntl
- fi
- echo Return Value = $?
- # CPAN follow pre-reqs?
- if [ ! "$(echo 'o conf prerequisites_policy' | cpan | grep follow)" ]; then
- if [ $YES ]; then
-
- echo "setting cpan prerequisites_policy to follow"
- echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
-
- else
-
- echo '
-
------------------------------------------------------------------------
-The install will go faster if CPAN is configured to automatically install
-prerequisites. You can revert the action later with:
-
-echo -e "o conf prerequisites_policy ask\n o conf commit" | cpan
-'
- while true; do
- echo -n 'Automatically install prereqs? [Y/n] ';
- read X;
- [ "$X" == 'n' -o "$X" == "N" ] && break;
- if [ "$X" == 'y' -o "$X" == 'Y' ]; then
- echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
- break;
- fi;
- done;
- fi;
- fi;
- echo End of configure CPAN =~-._
-}
-
-function build_essentials {
- echo _.-~= Installing some build essentials
- date
- # Install some essential tools
- apt-get update \
- && apt-get -yq dist-upgrade \
- && apt-get -yq install build-essential automake git psmisc ntp rsyslog;
- echo Return Value = $?
-
- if [ $LIVETEST ]; then
- cpan TAP::Parser::SourceHandler::pgTAP
- echo Return Value = $?
- fi;
- echo End of Installing some build essentials =~-._
-}
-
-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
- echo Return Value = $?
- echo 'export PATH=/openils/bin:$PATH' >> /home/opensrf/.bashrc
- echo 'export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH' >> /home/opensrf/.bashrc
- fi;
- echo end of creating opensrf user and environment =~-._
-}
-
-function cloning_git_repos {
- echo _.-~= cloning git repositories
- date
- OSRF_COMMAND="
- cd /home/opensrf;
- git clone --depth 1 --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
- git clone --depth 1 --branch $EVERGREEN_BRANCH $EVERGREEN_REPO Evergreen;
- "
- rm -rf /home/opensrf/Evergreen /home/opensrf/OpenSRF
- su - opensrf sh -c "$OSRF_COMMAND";
- echo Return Value = $?
-
- # Show tips
- cd /home/opensrf/OpenSRF/
- echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
- cd /home/opensrf/Evergreen/
- echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
-
- echo End of cloning git repositories =~-._
-}
-
-function opensrf_prereqs {
- echo _.-~= Installing OpenSRF pre-requisites
- date
- # Install pre-reqs
- mkdir -p /usr/src/evergreen;
- cd /usr/src/evergreen;
- if [ $YES ]; then
- yes | make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
- else
- make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
- fi;
- echo Return Value = $?
- echo End of Installing OpenSRF pre-requisites =~-._
-}
-
-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
- make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
- fi;
- echo Return Value = $?
- echo End of Installing Evergreen pre-requisites =~-._
-}
-
-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
- make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
- fi;
- echo Return Value = $?
- echo End of Installing Evergreen database pre-requisites =~-._
-}
-
-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 = $?
- # Configure rsyslog and restart
- cp /home/opensrf/Evergreen/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
- /etc/init.d/rsyslog restart
- echo Return Value = $?
- if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
-
- if [ $YES ]; then
- echo 'Adding public.localhost and private.localhost to /etc/hosts'
- echo '127.0.1.2 public.localhost public' >> /etc/hosts
- echo '127.0.1.3 private.localhost private' >> /etc/hosts
- else
-
- cat <<EOF
-
- * Add these lines to /etc/hosts.
-
- 127.0.1.2 public.localhost public
- 127.0.1.3 private.localhost private
-
-EOF
- fi;
-
- else
- echo "INFO: /etc/hosts already has public.localhost line";
- fi
- echo Return Value = $?
- # Patch Ejabberd and register users
- if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.cfg)" ]; then
- cd /etc/ejabberd/
- /etc/init.d/ejabberd stop;
- killall beam epmd; # just in case
- cp ejabberd.cfg /root/ejabberd.cfg.orig
- patch -p0 < $BASE_DIR/ejabberd.EG.patch
- chown ejabberd:ejabberd ejabberd.cfg
- echo starting ejabberd after patching
- date
- /etc/init.d/ejabberd start
- echo Return Value = $?
- sleep 10;
- ejabberdctl register router private.localhost $JABBER_PASSWORD
- echo Return Value = $?
- ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
- echo Return Value = $?
- ejabberdctl register router public.localhost $JABBER_PASSWORD
- echo Return Value = $?
- ejabberdctl register opensrf public.localhost $JABBER_PASSWORD
- echo Return Value = $?
- fi;
- echo End of setting ld.so.conf and rsyslog and /etc/hosts and ejabberd =~-._
-}
-
-function build_opensrf {
- # Build and install OpenSRF
- echo _.-~= Building OpenSRF
- date
- OSRF_COMMAND='
- cd /home/opensrf/OpenSRF;
- autoreconf -i;
- ./configure --prefix=/openils --sysconfdir=/openils/conf;
- make;'
- su - opensrf sh -c "$OSRF_COMMAND"
- echo Return Value = $?
- echo End of Building OpenSRF =~-._
-}
-
-function test_opensrf_build {
- echo _.-~= Running OpenSRF build tests
- date
- cd /home/opensrf/OpenSRF;
- make check
- echo Return Value = $?
- echo End of OpenSRF build tests =~-._
-}
-
-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;
- autoreconf -i;
- ./configure --prefix=/openils --sysconfdir=/openils/conf;
- make;
- '
- su - opensrf sh -c "$OSRF_COMMAND"
- echo Return Value = $?
- echo End of Building Evergreen =~-._
-}
-
-function test_evergreen_build {
- echo _.-~= Running Evergreen build tests
- date
- cd /home/opensrf/Evergreen
- make check
- echo Return Value = $?
- echo End of Evergreen build tests =~-._
-}
-
-
-# The evergreen browser client prereq installation and
-# build process is not baked into Evergreen proper (yet).
-# Run it as a standalone operation for now.
-function test_and_build_eg_browser_client {
- echo _.-~= Running Evergreen browser client build/test
- cd /tmp
- git clone $NODEJS_REPO
- cd node
- git checkout -b $NODEJS_VERSION $NODEJS_VERSION
- ./configure && make -j2 && make install
- echo Return Value = $?
- npm update
- echo Return Value = $?
- npm install -g grunt-cli # install grunt
- echo Return Value = $?
- npm install -g bower # install bower
- echo Return Value = $?
- cd /home/opensrf/Evergreen/Open-ILS/web/js/ui/default/staff
- npm install # fetch build depencies
- echo Return Value = $?
-
- # fetch JS/CSS/etc prereqs
- if [ $YES ]; then
- # yes == allow sending package stats
- yes | bower --allow-root install
- else
- bower --allow-root install
- fi
- echo Return Value = $?
-
- grunt build # concatentate, minify, copy into place
- echo Return Value = $?
- grunt test # run JS unit tests
- echo Return Value = $?
- echo End of Evergreen browser client build/test =~-._
-}
-
-function install_evergreen {
- echo _.-~= Installing Evergreen
- date
- cd /home/opensrf/Evergreen
- make install
- echo Return Value = $?
-
- 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
- cd /tmp;
- wget -N "http://download.dojotoolkit.org/release-$DOJO_VERSION/dojo-release-$DOJO_VERSION.tar.gz" \
- || wget -N "http://evergreen-ils.org/~phasefx/download.dojotoolkit.org/dojo-release-$DOJO_VERSION.tar.gz"
- tar -zxf dojo-release-$DOJO_VERSION.tar.gz;
- cp -r dojo-release-$DOJO_VERSION/* /openils/var/web/js/dojo/;
-
- # give it all to opensrf
- chown -R opensrf:opensrf /openils
-
- # copy srfsh config into place
- cp /openils/conf/srfsh.xml.example /home/opensrf/.srfsh.xml;
- chown opensrf:opensrf /home/opensrf/.srfsh.xml;
- echo End of Installing Evergreen =~-._
-}
-
-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;'
- else
- echo -e "\n\nPlease enter a password for the evergreen database user.\n If you do not want to edit configs, use \"evergreen\"\n"
- su - postgres sh -c 'createuser -P -s evergreen;'
- fi;
-
- # Apply the DB schema
- cd /home/opensrf/Evergreen
- perl Open-ILS/src/support-scripts/eg_db_config \
- --create-database \
- --create-schema \
- --create-offline \
- --update-config $SAMPLEDATA \
- --service all \
- --user evergreen \
- --password evergreen \
- --hostname localhost \
- --database evergreen \
- --admin-user $ADMIN_USER \
- --admin-pass $ADMIN_PASS;
- echo Return Value = $?
-
- if [ $LIVETEST ]; then
- PG_CMD="
- git clone --depth 0 https://github.com/theory/pgtap.git \
- && cd pgtap \
- && make \
- && make installcheck
- "
- su - postgres -c "$PG_CMD"
- cd /var/lib/postgresql/pgtap \
- && make install;
- echo 'CREATE EXTENSION pgtap;' | su - postgres -c "psql evergreen"
- fi;
- echo configure database =~-._
-}
-
-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/
- 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/eg_startup /etc/apache2/
-
- mkdir -p /etc/apache2/ssl;
- if [ ! -f /etc/apache2/ssl/server.key ] ; then
- echo -e "\n\nConfiguring a new temporary SSL certificate....\n";
- if [ $YES ]; then
- yes "" | openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
- else
- openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
- fi;
- else
- echo -e "\nkeeping existing ssl/server.key file\n";
- fi
-
- a2enmod ssl
- echo Return Value = $?
- a2enmod rewrite
- echo Return Value = $?
- a2enmod expires
- echo Return Value = $?
- a2dissite 000-default
- echo Return Value = $?
- a2ensite eg.conf
- echo Return Value = $?
-
- echo Modifying APACHE_RUN_USER/APACHE_RUN_GROUP in /etc/apache2/envvars
- sed -i 's/www-data/opensrf/g' /etc/apache2/envvars
-
- echo Making sure /var/lock/apache2 is owned by opensrf
- chown opensrf:opensrf /var/lock/apache2
-
- echo Modifying KeepAliveTimeout in /etc/apache2/apache2.conf
- sed -i 's/KeepAliveTimeout .*/KeepAliveTimeout 1/' /etc/apache2/apache2.conf
-
- echo End of configure apache =~-._
-}
-
-function start_evergreen {
- echo _.-~= Starting Evergreen
- date
- if [ $LIVETEST ]; then
- rm /openils/var/log/*.log
- fi
-
- OSRF_COMMAND='
- export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH \
- && export PATH=/openils/bin:$PATH \
- && OSRF_HOSTNAME="dns_hack" /openils/bin/osrf_control --localhost --restart-all && sleep 3 \
- && /openils/bin/autogen.sh /openils/conf/opensrf_core.xml \
- && echo Finis;
- '
- echo Starting services...
- su - opensrf sh -c "$OSRF_COMMAND";
- echo Return Value = $?
-
- echo Restarting Apache
- /etc/init.d/apache2 restart
- echo Return Value = $?
-
- echo End of Starting Evergreen =~-._
-}
-
-function test_evergreen_live {
- # 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'
- echo ''
- echo 'du -sh *.log:'
- su - opensrf sh -c 'cd /openils/var/log/ ; du -sh *.log'
- echo ''
- echo 'perl -ne ''if (/^\[.*?\] (.*?) \[/) { print "$1\n"; }'' osrfsys.log | sort | uniq -c | sort -k2:'
- (cd /openils/var/log/ ; perl -ne 'if (/^\[.*?\] (.*?) \[/) { print "$1\n"; }' osrfsys.log | sort | uniq -c | sort -k2)
- echo ''
- echo End of log summary =~-._
- cd /openils/var/log/
- for x in *.log; do
- echo _.-~= Log Output: $x
- date
- cat $x
- echo End of $x =~-._
- done
- echo _.-~= Gathering system information
- echo ''
- date
- echo ''
- uname -a
- echo 'select version();' | su - postgres -c 'psql -At'
- echo ''
- echo '/proc/meminfo:'
- cat /proc/meminfo
- echo ''
- echo '/proc/cpuinfo:'
- cat /proc/cpuinfo
- echo ''
- echo 'dpkg --list:'
- dpkg --list
- echo ''
- echo 'cpan -l:'
- cpan -l 2> /dev/null | sort
- echo End of system information =~-._
- date
-}
-
-my_init
-
-
+++ /dev/null
---- ejabberd.cfg 2010-08-13 16:03:40.000000000 -0400
-+++ /tmp/ejabberd.cfg.orig 2010-08-13 16:07:13.000000000 -0400
-@@ -58,7 +58,7 @@
- {acl, admin, {user, "", "localhost"}}.
-
- %% Hostname
--{hosts, ["localhost"]}.
-+{hosts, ["public.localhost", "private.localhost"]}.
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-@@ -115,7 +115,7 @@
- {5222, ejabberd_c2s, [
- {access, c2s},
- {shaper, c2s_shaper},
-- {max_stanza_size, 65536},
-+ {max_stanza_size, 200000},
- %%zlib,
- starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
- ]},
-@@ -133,7 +133,7 @@
-
- {5269, ejabberd_s2s_in, [
- {shaper, s2s_shaper},
-- {max_stanza_size, 131072}
-+ {max_stanza_size, 200000}
- ]},
-
- %% External MUC jabber-muc
-@@ -406,12 +406,12 @@
- %%
- %% The "normal" shaper limits traffic speed to 1.000 B/s
- %%
--{shaper, normal, {maxrate, 1000}}.
-+{shaper, normal, {maxrate, 500000}}.
-
- %%
- %% The "fast" shaper limits traffic speed to 50.000 B/s
- %%
--{shaper, fast, {maxrate, 50000}}.
-+{shaper, normal, {maxrate, 500000}}.
-
-
- %%% ====================
-@@ -457,7 +457,7 @@
- %%% ACCESS RULES
-
- %% Define the maximum number of time a single user is allowed to connect:
--{access, max_user_sessions, [{10, all}]}.
-+{access, max_user_sessions, [{5000, all}]}.
-
- %% Maximum number of offline messages that users can have:
- {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
-@@ -581,7 +581,7 @@
- {max_users, 500}
- ]},
- %%{mod_muc_log,[]},
-- {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
-+ %%{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
- {mod_privacy, []},
- {mod_private, []},
- {mod_proxy65, [
+++ /dev/null
-/openils/lib
-/usr/local/lib
-/usr/local/lib/dbd
+++ /dev/null
-#!/bin/bash
-sudo apt-get -q -y install git-core
-git clone git://git.evergreen-ils.org/working/random.git
-cd random/
-git checkout -b jessie origin/collab/phasefx/jessie_installer
-cd installer/jessie
-time sudo ./eg_jessie_installer.sh -y -a -s -t
--- /dev/null
+Author: Bill Erickson <berick@esilibrary.com>
+Copyright: (C) 2009-2012 Equinox Software Inc.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+----------------------------------------------------------
+
+Mostly automated "master" install of OpenSRF and Evergreen on Debian.
+
+WARNING: This is for development and evaluation purposes only. Use at own risk.
+
+Steps:
+ 1. Install Debian
+ 2. Put these files on the server
+ 3. Run the script as root and do what it says
+
+
+
+
+
--- /dev/null
+#!/bin/bash
+# -----------------------------------------------------------------------
+# Copyright (C) 2009-2012 Equinox Software Inc.
+# Bill Erickson <berick@esilibrary.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# -----------------------------------------------------------------------
+
+while getopts ayst option
+do
+ case "${option}"
+ in
+ a) AUTOSTART=1;;
+ y) YES=1;;
+ s) SAMPLEDATA=--load-all-sample;;
+ t) LIVETEST=1;;
+ esac
+done
+
+function my_init {
+ date
+ init_variables
+ configure_timezone
+ configure_cpan
+ build_essentials
+ setting_up_opensrf_env
+ cloning_git_repos
+ opensrf_prereqs
+ evergreen_prereqs
+ evergreen_db_prereqs
+ setting_ldconfig_and_rsyslog_and_hosts_and_ejabberd
+ build_opensrf
+ test_opensrf_build
+ install_opensrf
+ build_evergreen
+ test_evergreen_build
+ test_and_build_eg_browser_client
+ install_evergreen
+ configure_database
+ configure_apache
+ if [ $AUTOSTART ]; then
+ start_evergreen
+ if [ $LIVETEST ]; then
+ test_evergreen_live
+ fi
+ fi
+}
+
+function init_variables {
+ echo _.-~= initializing installer
+ date
+ # -----------------------------------------------------------------------
+ # Handling passed arguments to the script
+ # -----------------------------------------------------------------------
+ export DOJO_VERSION='1.3.3';
+ export PATH=/openils/bin:$PATH
+ export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
+ export BASE_DIR=$PWD
+ echo AUTOSTART=${AUTOSTART}
+ echo YES=${YES}
+ echo SAMPLEDATA=${SAMPLEDATA}
+ echo LIVETEST=${LIVETEST}
+ echo DOJO_VERSION=${DOJO_VERSION}
+ echo PATH=${PATH}
+ echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
+ echo BASE_DIR=${BASE_DIR}
+ # -----------------------------------------------------------------------
+ # Change to suit...
+ # -----------------------------------------------------------------------
+ # If you change the jabber password, you will need to
+ # edit opensrf_core.xml and srfsh.xml accordingly
+ export JABBER_PASSWORD='password'
+ export ADMIN_USER='admin';
+ export ADMIN_PASS='demo123';
+ # -----------------------------------------------------------------------
+ # You can override these like so:
+ # EVERGREEN_BRANCH='master' ./eg_trusty_installer.sh
+ # -----------------------------------------------------------------------
+ OPENSRF_REPO='git://git.evergreen-ils.org/OpenSRF.git'
+ OPENSRF_BRANCH='master'
+ EVERGREEN_REPO='git://git.evergreen-ils.org/Evergreen.git'
+ EVERGREEN_BRANCH='master'
+ echo OPENSRF_REPO=${OPENSRF_REPO}
+ echo OPENSRF_BRANCH=${OPENSRF_BRANCH}
+ echo EVERGREEN_REPO=${EVERGREEN_REPO}
+ echo EVERGREEN_BRANCH=${EVERGREEN_BRANCH}
+ OPENSRF_PREREQ_TARGET=ubuntu-trusty
+ EVERGREEN_PREREQ_TARGET=ubuntu-trusty
+ EVERGREEN_DB_PREREQ_TARGET=postgres-server-ubuntu-trusty
+ echo OPENSRF_PREREQ_TARGET=${OPENSRF_PREREQ_TARGET}
+ echo EVERGREEN_PREREQ_TARGET=${EVERGREEN_PREREQ_TARGET}
+ echo EVERGREEN_DB_PREREQ_TARGET=${EVERGREEN_DB_PREREQ_TARGET}
+
+ export NODEJS_REPO='https://github.com/joyent/node.git'
+ export NODEJS_VERSION='v0.10.31'
+ echo "NODEJS_REPO=$NODEJS_REPO"
+ echo "NODEJS_VERSION=$NODEJS_VERSION"
+
+ echo End of intializing installer =~-._
+}
+
+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
+ yes | cpan Fcntl
+ else
+ cpan Fcntl
+ fi
+ echo Return Value = $?
+ # CPAN follow pre-reqs?
+ if [ ! "$(echo 'o conf prerequisites_policy' | cpan | grep follow)" ]; then
+ if [ $YES ]; then
+
+ echo "setting cpan prerequisites_policy to follow"
+ echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
+
+ else
+
+ echo '
+
+-----------------------------------------------------------------------
+The install will go faster if CPAN is configured to automatically install
+prerequisites. You can revert the action later with:
+
+echo -e "o conf prerequisites_policy ask\n o conf commit" | cpan
+'
+ while true; do
+ echo -n 'Automatically install prereqs? [Y/n] ';
+ read X;
+ [ "$X" == 'n' -o "$X" == "N" ] && break;
+ if [ "$X" == 'y' -o "$X" == 'Y' ]; then
+ echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
+ break;
+ fi;
+ done;
+ fi;
+ fi;
+ echo End of configure CPAN =~-._
+}
+
+function build_essentials {
+ echo _.-~= Installing some build essentials
+ date
+ # Install some essential tools
+ apt-get update \
+ && apt-get -yq dist-upgrade \
+ && apt-get -yq install build-essential automake git psmisc ntp rsyslog;
+ echo Return Value = $?
+
+ if [ $LIVETEST ]; then
+ cpan TAP::Parser::SourceHandler::pgTAP
+ echo Return Value = $?
+ fi;
+ echo End of Installing some build essentials =~-._
+}
+
+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
+ echo Return Value = $?
+ echo 'export PATH=/openils/bin:$PATH' >> /home/opensrf/.bashrc
+ echo 'export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH' >> /home/opensrf/.bashrc
+ fi;
+ echo end of creating opensrf user and environment =~-._
+}
+
+function cloning_git_repos {
+ echo _.-~= cloning git repositories
+ date
+ OSRF_COMMAND="
+ cd /home/opensrf;
+ git clone --depth 1 --branch $OPENSRF_BRANCH $OPENSRF_REPO OpenSRF;
+ git clone --depth 1 --branch $EVERGREEN_BRANCH $EVERGREEN_REPO Evergreen;
+ "
+ rm -rf /home/opensrf/Evergreen /home/opensrf/OpenSRF
+ su - opensrf sh -c "$OSRF_COMMAND";
+ echo Return Value = $?
+
+ # Show tips
+ cd /home/opensrf/OpenSRF/
+ echo 'Tip of OpenSRF:' `git log --format=oneline | head -1`
+ cd /home/opensrf/Evergreen/
+ echo 'Tip of Evergreen:' `git log --format=oneline | head -1`
+
+ echo End of cloning git repositories =~-._
+}
+
+function opensrf_prereqs {
+ echo _.-~= Installing OpenSRF pre-requisites
+ date
+ # Install pre-reqs
+ mkdir -p /usr/src/evergreen;
+ cd /usr/src/evergreen;
+ if [ $YES ]; then
+ yes | make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+ else
+ make -f /home/opensrf/OpenSRF/src/extras/Makefile.install ${OPENSRF_PREREQ_TARGET}
+ fi;
+ echo Return Value = $?
+ echo End of Installing OpenSRF pre-requisites =~-._
+}
+
+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
+ make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_PREREQ_TARGET}
+ fi;
+ echo Return Value = $?
+ echo End of Installing Evergreen pre-requisites =~-._
+}
+
+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
+ make -f /home/opensrf/Evergreen/Open-ILS/src/extras/Makefile.install ${EVERGREEN_DB_PREREQ_TARGET}
+ fi;
+ echo Return Value = $?
+ echo End of Installing Evergreen database pre-requisites =~-._
+}
+
+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 = $?
+ # Configure rsyslog and restart
+ cp /home/opensrf/Evergreen/Open-ILS/examples/evergreen-rsyslog.conf /etc/rsyslog.d/evergreen.conf
+ /etc/init.d/rsyslog restart
+ echo Return Value = $?
+ if [ ! "$(grep 'public.localhost' /etc/hosts)" ]; then
+
+ if [ $YES ]; then
+ echo 'Adding public.localhost and private.localhost to /etc/hosts'
+ echo '127.0.1.2 public.localhost public' >> /etc/hosts
+ echo '127.0.1.3 private.localhost private' >> /etc/hosts
+ else
+
+ cat <<EOF
+
+ * Add these lines to /etc/hosts.
+
+ 127.0.1.2 public.localhost public
+ 127.0.1.3 private.localhost private
+
+EOF
+ fi;
+
+ else
+ echo "INFO: /etc/hosts already has public.localhost line";
+ fi
+ echo Return Value = $?
+ # Patch Ejabberd and register users
+ if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.cfg)" ]; then
+ cd /etc/ejabberd/
+ /etc/init.d/ejabberd stop;
+ killall beam epmd; # just in case
+ cp ejabberd.cfg /root/ejabberd.cfg.orig
+ patch -p0 < $BASE_DIR/ejabberd.EG.patch
+ chown ejabberd:ejabberd ejabberd.cfg
+ echo starting ejabberd after patching
+ date
+ /etc/init.d/ejabberd start
+ echo Return Value = $?
+ sleep 10;
+ ejabberdctl register router private.localhost $JABBER_PASSWORD
+ echo Return Value = $?
+ ejabberdctl register opensrf private.localhost $JABBER_PASSWORD
+ echo Return Value = $?
+ ejabberdctl register router public.localhost $JABBER_PASSWORD
+ echo Return Value = $?
+ ejabberdctl register opensrf public.localhost $JABBER_PASSWORD
+ echo Return Value = $?
+ fi;
+ echo End of setting ld.so.conf and rsyslog and /etc/hosts and ejabberd =~-._
+}
+
+function build_opensrf {
+ # Build and install OpenSRF
+ echo _.-~= Building OpenSRF
+ date
+ OSRF_COMMAND='
+ cd /home/opensrf/OpenSRF;
+ autoreconf -i;
+ ./configure --prefix=/openils --sysconfdir=/openils/conf;
+ make;'
+ su - opensrf sh -c "$OSRF_COMMAND"
+ echo Return Value = $?
+ echo End of Building OpenSRF =~-._
+}
+
+function test_opensrf_build {
+ echo _.-~= Running OpenSRF build tests
+ date
+ cd /home/opensrf/OpenSRF;
+ make check
+ echo Return Value = $?
+ echo End of OpenSRF build tests =~-._
+}
+
+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;
+ autoreconf -i;
+ ./configure --prefix=/openils --sysconfdir=/openils/conf;
+ make;
+ '
+ su - opensrf sh -c "$OSRF_COMMAND"
+ echo Return Value = $?
+ echo End of Building Evergreen =~-._
+}
+
+function test_evergreen_build {
+ echo _.-~= Running Evergreen build tests
+ date
+ cd /home/opensrf/Evergreen
+ make check
+ echo Return Value = $?
+ echo End of Evergreen build tests =~-._
+}
+
+
+# The evergreen browser client prereq installation and
+# build process is not baked into Evergreen proper (yet).
+# Run it as a standalone operation for now.
+function test_and_build_eg_browser_client {
+ echo _.-~= Running Evergreen browser client build/test
+ cd /tmp
+ git clone $NODEJS_REPO
+ cd node
+ git checkout -b $NODEJS_VERSION $NODEJS_VERSION
+ ./configure && make -j2 && make install
+ echo Return Value = $?
+ npm update
+ echo Return Value = $?
+ npm install -g grunt-cli # install grunt
+ echo Return Value = $?
+ npm install -g bower # install bower
+ echo Return Value = $?
+ cd /home/opensrf/Evergreen/Open-ILS/web/js/ui/default/staff
+ npm install # fetch build depencies
+ echo Return Value = $?
+
+ # fetch JS/CSS/etc prereqs
+ if [ $YES ]; then
+ # yes == allow sending package stats
+ yes | bower --allow-root install
+ else
+ bower --allow-root install
+ fi
+ echo Return Value = $?
+
+ grunt build # concatentate, minify, copy into place
+ echo Return Value = $?
+ grunt test # run JS unit tests
+ echo Return Value = $?
+ echo End of Evergreen browser client build/test =~-._
+}
+
+function install_evergreen {
+ echo _.-~= Installing Evergreen
+ date
+ cd /home/opensrf/Evergreen
+ make install
+ echo Return Value = $?
+
+ 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
+ cd /tmp;
+ wget -N "http://download.dojotoolkit.org/release-$DOJO_VERSION/dojo-release-$DOJO_VERSION.tar.gz" \
+ || wget -N "http://evergreen-ils.org/~phasefx/download.dojotoolkit.org/dojo-release-$DOJO_VERSION.tar.gz"
+ tar -zxf dojo-release-$DOJO_VERSION.tar.gz;
+ cp -r dojo-release-$DOJO_VERSION/* /openils/var/web/js/dojo/;
+
+ # give it all to opensrf
+ chown -R opensrf:opensrf /openils
+
+ # copy srfsh config into place
+ cp /openils/conf/srfsh.xml.example /home/opensrf/.srfsh.xml;
+ chown opensrf:opensrf /home/opensrf/.srfsh.xml;
+ echo End of Installing Evergreen =~-._
+}
+
+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;'
+ else
+ echo -e "\n\nPlease enter a password for the evergreen database user.\n If you do not want to edit configs, use \"evergreen\"\n"
+ su - postgres sh -c 'createuser -P -s evergreen;'
+ fi;
+
+ # Apply the DB schema
+ cd /home/opensrf/Evergreen
+ perl Open-ILS/src/support-scripts/eg_db_config \
+ --create-database \
+ --create-schema \
+ --create-offline \
+ --update-config $SAMPLEDATA \
+ --service all \
+ --user evergreen \
+ --password evergreen \
+ --hostname localhost \
+ --database evergreen \
+ --admin-user $ADMIN_USER \
+ --admin-pass $ADMIN_PASS;
+ echo Return Value = $?
+
+ if [ $LIVETEST ]; then
+ PG_CMD="
+ git clone --depth 0 https://github.com/theory/pgtap.git \
+ && cd pgtap \
+ && make \
+ && make installcheck
+ "
+ su - postgres -c "$PG_CMD"
+ cd /var/lib/postgresql/pgtap \
+ && make install;
+ echo 'CREATE EXTENSION pgtap;' | su - postgres -c "psql evergreen"
+ fi;
+ echo configure database =~-._
+}
+
+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/
+ 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/eg_startup /etc/apache2/
+
+ mkdir -p /etc/apache2/ssl;
+ if [ ! -f /etc/apache2/ssl/server.key ] ; then
+ echo -e "\n\nConfiguring a new temporary SSL certificate....\n";
+ if [ $YES ]; then
+ yes "" | openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+ else
+ openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
+ fi;
+ else
+ echo -e "\nkeeping existing ssl/server.key file\n";
+ fi
+
+ a2enmod ssl
+ echo Return Value = $?
+ a2enmod rewrite
+ echo Return Value = $?
+ a2enmod expires
+ echo Return Value = $?
+ a2dissite 000-default
+ echo Return Value = $?
+ a2ensite eg.conf
+ echo Return Value = $?
+
+ echo Modifying APACHE_RUN_USER/APACHE_RUN_GROUP in /etc/apache2/envvars
+ sed -i 's/www-data/opensrf/g' /etc/apache2/envvars
+
+ echo Making sure /var/lock/apache2 is owned by opensrf
+ chown opensrf:opensrf /var/lock/apache2
+
+ echo Modifying KeepAliveTimeout in /etc/apache2/apache2.conf
+ sed -i 's/KeepAliveTimeout .*/KeepAliveTimeout 1/' /etc/apache2/apache2.conf
+
+ echo End of configure apache =~-._
+}
+
+function start_evergreen {
+ echo _.-~= Starting Evergreen
+ date
+ if [ $LIVETEST ]; then
+ rm /openils/var/log/*.log
+ fi
+
+ OSRF_COMMAND='
+ export LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH \
+ && export PATH=/openils/bin:$PATH \
+ && OSRF_HOSTNAME="dns_hack" /openils/bin/osrf_control --localhost --restart-all && sleep 3 \
+ && /openils/bin/autogen.sh /openils/conf/opensrf_core.xml \
+ && echo Finis;
+ '
+ echo Starting services...
+ su - opensrf sh -c "$OSRF_COMMAND";
+ echo Return Value = $?
+
+ echo Restarting Apache
+ /etc/init.d/apache2 restart
+ echo Return Value = $?
+
+ echo End of Starting Evergreen =~-._
+}
+
+function test_evergreen_live {
+ # 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'
+ echo ''
+ echo 'du -sh *.log:'
+ su - opensrf sh -c 'cd /openils/var/log/ ; du -sh *.log'
+ echo ''
+ echo 'perl -ne ''if (/^\[.*?\] (.*?) \[/) { print "$1\n"; }'' osrfsys.log | sort | uniq -c | sort -k2:'
+ (cd /openils/var/log/ ; perl -ne 'if (/^\[.*?\] (.*?) \[/) { print "$1\n"; }' osrfsys.log | sort | uniq -c | sort -k2)
+ echo ''
+ echo End of log summary =~-._
+ cd /openils/var/log/
+ for x in *.log; do
+ echo _.-~= Log Output: $x
+ date
+ cat $x
+ echo End of $x =~-._
+ done
+ echo _.-~= Gathering system information
+ echo ''
+ date
+ echo ''
+ uname -a
+ echo 'select version();' | su - postgres -c 'psql -At'
+ echo ''
+ echo '/proc/meminfo:'
+ cat /proc/meminfo
+ echo ''
+ echo '/proc/cpuinfo:'
+ cat /proc/cpuinfo
+ echo ''
+ echo 'dpkg --list:'
+ dpkg --list
+ echo ''
+ echo 'cpan -l:'
+ cpan -l 2> /dev/null | sort
+ echo End of system information =~-._
+ date
+}
+
+my_init
+
+
--- /dev/null
+--- ejabberd.cfg 2010-08-13 16:03:40.000000000 -0400
++++ /tmp/ejabberd.cfg.orig 2010-08-13 16:07:13.000000000 -0400
+@@ -58,7 +58,7 @@
+ {acl, admin, {user, "", "localhost"}}.
+
+ %% Hostname
+-{hosts, ["localhost"]}.
++{hosts, ["public.localhost", "private.localhost"]}.
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+@@ -115,7 +115,7 @@
+ {5222, ejabberd_c2s, [
+ {access, c2s},
+ {shaper, c2s_shaper},
+- {max_stanza_size, 65536},
++ {max_stanza_size, 200000},
+ %%zlib,
+ starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
+ ]},
+@@ -133,7 +133,7 @@
+
+ {5269, ejabberd_s2s_in, [
+ {shaper, s2s_shaper},
+- {max_stanza_size, 131072}
++ {max_stanza_size, 200000}
+ ]},
+
+ %% External MUC jabber-muc
+@@ -406,12 +406,12 @@
+ %%
+ %% The "normal" shaper limits traffic speed to 1.000 B/s
+ %%
+-{shaper, normal, {maxrate, 1000}}.
++{shaper, normal, {maxrate, 500000}}.
+
+ %%
+ %% The "fast" shaper limits traffic speed to 50.000 B/s
+ %%
+-{shaper, fast, {maxrate, 50000}}.
++{shaper, normal, {maxrate, 500000}}.
+
+
+ %%% ====================
+@@ -457,7 +457,7 @@
+ %%% ACCESS RULES
+
+ %% Define the maximum number of time a single user is allowed to connect:
+-{access, max_user_sessions, [{10, all}]}.
++{access, max_user_sessions, [{5000, all}]}.
+
+ %% Maximum number of offline messages that users can have:
+ {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
+@@ -581,7 +581,7 @@
+ {max_users, 500}
+ ]},
+ %%{mod_muc_log,[]},
+- {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
++ %%{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
+ {mod_privacy, []},
+ {mod_private, []},
+ {mod_proxy65, [
--- /dev/null
+/openils/lib
+/usr/local/lib
+/usr/local/lib/dbd