Skip to content

Commit

Permalink
Merge pull request #3 from glassdb/master
Browse files Browse the repository at this point in the history
Fix for Issue #2: update to support GsDevKit/gsDevKitHome
  • Loading branch information
Monty committed Dec 13, 2014
2 parents fc2d7e2 + 9a33dfb commit a09656f
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 43 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
.svn
.svnignore
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
*.zip

24 changes: 13 additions & 11 deletions README.rdoc → README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
== daemontools setup scripts for GemStone/S on Ubuntu or other Debian systems
## daemontools setup scripts for GemStone/S on Ubuntu or other Debian systems

=== Prerequisites
### Prerequisites

* Install and set up GemStone/S 2.4.4.1 or later
* Install daemontools (sudo apt-get install daemontools daemontools-run svtools)
Note: It's OK to install daemontools after running the setup, but /etc/init.d/topaz
and /etc/init.d/statmon won't work until you do.

=== Running the setup scripts
### Running the setup scripts

Make sure that the config file in this directory is appropriate for your setup.
Make sure you have root access so the setup can execute properly. Then execute:
sudo bash ./setupAll.sh

You can load Seaside 3.0 into GemStone by using the installSeaside30 script,
using your own customized script, or loading Seaside interactively.
It is recommended that you follow the [gsDevKitHome intallation instructions][1] to
install GemStone on your system.

There are some utility scripts not run by setupAll.sh that can be useful when
testing. Even though they prompt you before executing, you should read them and
understand what they do before using them -- particularly any 'destroy_' scripts.

=== Setting up your user account
### Setting up your user account

The scripts in bin/ that start and stop GemStone use sudo. You may find it
convenient to setup your sudoers file so you don't have to supply a password to
run them. There is an example sudoers file in etc/. Add the appropriate lines to
your system sudoers file using "visudo".

It's easier if you add the daemontools control scripts to your path, and define
the GemStone environment variables in your bashrc rather than sourcing the
definition each time you login. Add these lines:
export PATH=$PATH:~/GemStone_daemontools_setup/bin
source /opt/gemstone/product/seaside/defSeaside
You should add the daemontools control scripts to your path by adding the following
line to your .bashrc:

```Shell
export PATH=$PATH:~/GemStone_daemontools_setup/bin
```

[1]: https://github.com/GsDevKit/gsDevKitHome#open-source-development-kit-for-gemstones-64-bit-
6 changes: 5 additions & 1 deletion bin/gemstone_start
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Find out where files are located
source /etc/default/gemstone # Provide $SERVICE_DIR and $GEMSTONE_CONFIG
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "This script restarts all Gemstone processes."
echo "Shall I continue? (Y/N)"
Expand Down
6 changes: 5 additions & 1 deletion bin/gemstone_status
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Find out where files are located
source /etc/default/gemstone # Provide $SERVICE_DIR and $GEMSTONE_CONFIG
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

function _gs_status () {
$GEMSTONE/bin/gslist -clv
Expand Down
6 changes: 5 additions & 1 deletion bin/gemstone_stop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Find out where files are located
source /etc/default/gemstone # Provide $SERVICE_DIR and $GEMSTONE_CONFIG
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "This script stops all Gemstone processes. It may take a minute..."
echo "Shall I continue? (Y/N)"
Expand Down
6 changes: 5 additions & 1 deletion bin/statmon_purge
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Find out where files are located
source /etc/default/gemstone # Provide $GEMSTONE_CONFIG
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "`basename $0` deletes \"1-second\" statmon files older than 4 hours"
echo "and \"60-second\" statmon files older than 30 days. Would you like to"
Expand Down
15 changes: 13 additions & 2 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ export GEMSTONE_VERSION=3.1 # Must be 2.4 or 3.1 Add by DTR for maintenance sc
export SEASIDE_VERSION=3.0 # Must be 2.8 or 3.0
export STARTING_PORT=9001 # First port for Gems -- will increment by one through ending port
export ENDING_PORT=9003 # Last port for Gems
export WWW_DOCROOT="/var/www" # Static document-root for lighttpd config

# Uncomment the following two lines if want to include lighttpd in daemontools setup
# export LIGHTTPD_SETUP="YES"
# export WWW_DOCROOT="/var/www" # Static document-root for lighttpd config

# GS_HOME must point to the location of gsDevKitHome
# GS_STONE must identify the name of the gsDevKitHome stone
# Comment out the following three lines if NOT using GsDevKit/gsDevKitHome
export GS_HOME=/home/notroot/gsDevKitHome
export GS_STONE=kit
export GEMSTONE_USER=notroot

# The following file must export these ENV variables:
# GEMSTONE, GEMSTONE_LOGDIR, GEMSTONE_NAME, GEMSTONE_USER
export GEMSTONE_CONFIG="/opt/gemstone/product/seaside/defSeaside" # GemStone ENV setup file
# Uncomment out the following line and set appropriately if NOT using GsDevKit/gsDevKitHome
# export GEMSTONE_CONFIG="/opt/gemstone/product/seaside/defSeaside" # GemStone ENV setup file
6 changes: 5 additions & 1 deletion copySeasideScripts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ fi

# Find out where files are located
source config
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "`basename $0` copies modified Seaside scripts to $GEMSTONE/seaside/bin"
echo "They do not overwrite existing scripts, as they have different names."
Expand Down
24 changes: 20 additions & 4 deletions daemontools_setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ fi

# Find out where files are located
source config
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "`basename $0` creates GemStone templates in $TEMPLATE_DIR for daemontools to run"
echo "Seaside gems, a maintenance gem, and statmons. It does not create links in $SERVICE_DIR."
Expand Down Expand Up @@ -61,7 +65,11 @@ mkdir -p $TEMPLATE_DIR/gs_maintenance $TEMPLATE_DIR/gstemplate_seaside
cat > $TEMPLATE_DIR/gs_maintenance/run <<-EOF
#!/bin/bash
source /etc/default/gemstone
source \$GEMSTONE_CONFIG
if [ "\${GEMSTONE_CONFIG}x" = "x" ] ; then
source \$GS_HOME/gemstone/stones/\$GS_STONE/defStone.env \$GS_STONE
else
source \$GEMSTONE_CONFIG
fi
\$GEMSTONE/bin/waitstone $GEMSTONE_NAME 2
exec setuidgid $GEMSTONE_USER \$GEMSTONE/seaside/bin/$MAINT_SCRIPT
EOF
Expand All @@ -71,7 +79,11 @@ chmod 755 $TEMPLATE_DIR/gs_maintenance/run
cat > $TEMPLATE_DIR/gstemplate_seaside/run <<-EOF
#!/bin/bash
source /etc/default/gemstone
source \$GEMSTONE_CONFIG
if [ "\${GEMSTONE_CONFIG}x" = "x" ] ; then
source \$GS_HOME/gemstone/stones/\$GS_STONE/defStone.env \$GS_STONE
else
source \$GEMSTONE_CONFIG
fi
scriptpath=\$(dirname \$0)
[ -r \$scriptpath/config.local ] && source \$scriptpath/config.local
\$GEMSTONE/bin/waitstone $GEMSTONE_NAME 2
Expand Down Expand Up @@ -100,7 +112,11 @@ for i in 1 60 ; do
cat > $TEMPLATE_DIR/gs_statmon-${i}/run <<-EOF
#!/bin/bash
source /etc/default/gemstone
source \$GEMSTONE_CONFIG
if [ "\${GEMSTONE_CONFIG}x" = "x" ] ; then
source \$GS_HOME/gemstone/stones/\$GS_STONE/defStone.env \$GS_STONE
else
source \$GEMSTONE_CONFIG
fi
\$GEMSTONE/bin/waitstone $GEMSTONE_NAME 2
# Create the stats directory if it's not there
mkdir -p /home/$GEMSTONE_USER/stats/${i}-second
Expand Down
15 changes: 12 additions & 3 deletions etc/init.d/gemstone
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
. /lib/lsb/init-functions
. /etc/default/rcS

# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG, the GemStone ENV setup file
# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG or GS_HOME and GS_STONE, the GemStone ENV setup file
STARTUP_DEFAULTS=/etc/default/gemstone

if [ -s $STARTUP_DEFAULTS ]; then
Expand All @@ -34,11 +34,20 @@ else
exit 1
fi

if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
if [ -s $GS_HOME/gemstone/stones/$GS_STONE/defStone.env ]; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
else
if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
fi

export GEMSTONE GEMSTONE_SYS_CONF GEMSTONE_EXE_CONF GEMSTONE_DATADIR GEMSTONE_LOGDIR \
Expand Down
4 changes: 2 additions & 2 deletions etc/init.d/glass_ip_address
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
. /lib/lsb/init-functions
. /etc/default/rcS

# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG, the GemStone ENV setup file
# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG or $GS_HOME and $GS_STONE, the GemStone ENV setup file
STARTUP_DEFAULTS=/etc/default/gemstone

if [ -s $STARTUP_DEFAULTS ]; then
Expand All @@ -28,7 +28,7 @@ if [ -s $STARTUP_DEFAULTS ]; then
;;
esac
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
log_failure_msg "Configuration file $STARTUP_DEFAULTS not found, aborting startup"
exit 1
fi

Expand Down
17 changes: 13 additions & 4 deletions etc/init.d/netldi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
. /lib/lsb/init-functions
. /etc/default/rcS

# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG, the GemStone ENV setup file
# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG or $GS_HOME and $GS_STONE, the GemStone ENV setup file
STARTUP_DEFAULTS=/etc/default/gemstone

if [ -s $STARTUP_DEFAULTS ]; then
Expand All @@ -28,15 +28,24 @@ if [ -s $STARTUP_DEFAULTS ]; then
;;
esac
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
log_failure_msg "Configuration file $STARTUP_DEFAULTSG not found, aborting startup"
exit 1
fi

if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
if [ -s $GS_HOME/gemstone/stones/$GS_STONE/defStone.env ]; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
else
if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
fi

export GEMSTONE GEMSTONE_SYS_CONF GEMSTONE_EXE_CONF GEMSTONE_DATADIR GEMSTONE_LOGDIR \
Expand Down
17 changes: 13 additions & 4 deletions etc/init.d/statmon
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
. /lib/lsb/init-functions
. /etc/default/rcS

# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG, the GemStone ENV setup file
# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG or $GS_HOME and $GS_STONE, the GemStone ENV setup file
# and $SERVICE_DIR, used by daemontools to locate run scripts
STARTUP_DEFAULTS=/etc/default/gemstone

Expand All @@ -29,15 +29,24 @@ if [ -s $STARTUP_DEFAULTS ]; then
;;
esac
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
log_failure_msg "Configuration file $STARTUP_DEFAULTS not found, aborting startup"
exit 1
fi

if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
if [ -s $GS_HOME/gemstone/stones/$GS_STONE/defStone.env ]; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
else
if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
fi

export GEMSTONE GEMSTONE_SYS_CONF GEMSTONE_EXE_CONF GEMSTONE_DATADIR GEMSTONE_LOGDIR \
Expand Down
17 changes: 13 additions & 4 deletions etc/init.d/topaz
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
. /lib/lsb/init-functions
. /etc/default/rcS

# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG, the GemStone ENV setup file
# STARTUP_DEFAULTS must provide $GEMSTONE_CONFIG or $GS_HOME and $GS_STONE, the GemStone ENV setup file
# and $SERVICE_DIR, used by daemontools to locate run scripts
STARTUP_DEFAULTS=/etc/default/gemstone

Expand All @@ -29,15 +29,24 @@ if [ -s $STARTUP_DEFAULTS ]; then
;;
esac
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
log_failure_msg "Configuration file $STARTUP_DEFAULTS not found, aborting startup"
exit 1
fi

if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
if [ -s $GS_HOME/gemstone/stones/$GS_STONE/defStone.env ]; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
else
if [ -s $GEMSTONE_CONFIG ]; then
. $GEMSTONE_CONFIG
else
log_failure_msg "Configuration file $GEMSTONE_CONFIG not found, aborting startup"
exit 1
fi
fi

export GEMSTONE GEMSTONE_SYS_CONF GEMSTONE_EXE_CONF GEMSTONE_DATADIR GEMSTONE_LOGDIR \
Expand Down
6 changes: 5 additions & 1 deletion lighttpd_setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ fi

# Find out where files are located
source config
source $GEMSTONE_CONFIG
if [ "${GEMSTONE_CONFIG}x" = "x" ] ; then
source $GS_HOME/gemstone/stones/$GS_STONE/defStone.env $GS_STONE
else
source $GEMSTONE_CONFIG
fi

echo "`basename $0` creates and installs lighttpd configuration files for GLASS."
echo "WARNING: It will overwrite /etc/lighttpd/conf-available/10-GLASS.conf"
Expand Down
9 changes: 8 additions & 1 deletion setupAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ echo ""
./bootGemstone_setup
#
echo ""
./lighttpd_setup
case "$LIGHTTPD_SETUP" in
YES)
./lighttpd_setup
;;
*)
echo "./lighttpd_setup skipped ..."
;;
esac
#
echo ""
./daemontools_start
Expand Down

0 comments on commit a09656f

Please sign in to comment.