Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r752 - trunk/scripts/admin/test_server

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r752 - trunk/scripts/admin/test_server


Chronological Thread 
  • From: "AFS account Roman Geus" <geus AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r752 - trunk/scripts/admin/test_server
  • Date: Fri, 22 Feb 2008 16:42:22 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: geus
Date: Fri Feb 22 16:42:21 2008
New Revision: 752

Log:
init.d script for idok test server now checks if the server processes start
successfully

Modified:
trunk/scripts/admin/test_server/setup_test_server_ubuntu.sh

Modified: trunk/scripts/admin/test_server/setup_test_server_ubuntu.sh
==============================================================================
--- trunk/scripts/admin/test_server/setup_test_server_ubuntu.sh (original)
+++ trunk/scripts/admin/test_server/setup_test_server_ubuntu.sh Fri Feb 22
16:42:21 2008
@@ -126,8 +126,8 @@
# Startup scripts
#
cat > /etc/init.d/idok << "EOT"
-#!/bin/sh
-# Start/stop the cron daemon.
+#!/bin/bash
+# Start/stop the idok server.
#
### BEGIN INIT INFO
# Provides: idok
@@ -146,30 +146,66 @@
IDOK_HOST=idokserver
IDOK_SERVER_ROOT=/var/lib/idok_server

+# Start all iDok server processes and check if they have successfully started
+start_idok () {
+ start-stop-daemon --start --make-pidfile --pidfile=/var/run/orbd.pid
--chuid www-data:www-data --background --exec /usr/bin/ant -- -f
$IDOK_SRC_DIR/local-server.xml -Dserver.hostname=$IDOK_HOST
-Dserver.root.dir=$IDOK_SERVER_ROOT start-orbd
+ start-stop-daemon --start --make-pidfile
--pidfile=/var/run/dmssd.pid --chuid www-data:www-data --background --exec
/usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT
start-server-jacorb
+ start-stop-daemon --start --make-pidfile --pidfile=/var/run/xvfb.pid
--chuid www-data:www-data --background --exec /usr/bin/ant -- -f
$IDOK_SRC_DIR/local-server.xml -Dserver.hostname=$IDOK_HOST
-Dserver.root.dir=$IDOK_SERVER_ROOT start-xvfb
+ start-stop-daemon --start --make-pidfile
--pidfile=/var/run/indexer.pid --chuid www-data:www-data --background --exec
/usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-indexer
+
+ sleep 15
+
+ read pid < /var/run/orbd.pid
+ ps --pid $pid > /dev/null
+ if [ $? != 0 ]; then
+ log_warning_msg "Error starting orbd"
+ return 1
+ fi
+ read pid < /var/run/dmssd.pid
+ ps --pid $pid > /dev/null
+ if [ $? != 0 ]; then
+ log_warning_msg "Error starting dmssd"
+ return 1
+ fi
+ read pid < /var/run/indexer.pid
+ ps --pid $pid > /dev/null
+ if [ $? != 0 ]; then
+ log_warning_msg "Error starting indexer"
+ return 1
+ fi
+ read pid < /var/run/xvfb.pid
+ ps --pid $pid > /dev/null
+ if [ $? != 0 ]; then
+ log_warning_msg "Error starting xvfb"
+ return 1
+ fi
+ return 0
+}
+
+# Brute force approach: Kill all idok server processes
+kill_idok () {
+ killall Xvfb
+ killall java
+ killall orbd
+ rm -f /var/run/orbd.pid
+ rm -f /var/run/dmssd.pid
+ rm -f /var/run/indexer.pid
+ rm -f /var/run/xvfb.pid
+}
+
case "$1" in
start) log_daemon_msg "Starting iDok services" "idok"
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-orbd
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT
start-server-jacorb
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-xvfb
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-indexer
+ start_idok
log_end_msg $?
;;
stop) log_daemon_msg "Stopping iDok services" "idok"
- # Brute force approach: Kill all java and orbd processes
- killall java
- killall orbd
- killall Xvfb
+ kill_idok
log_end_msg $?
;;
restart) log_daemon_msg "Restarting iDok services" "idok"
# Brute force approach: Kill all java and orbd processes
- killall java
- killall orbd
- killall Xvfb
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-orbd
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT
start-server-jacorb
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-xvfb
- start-stop-daemon --start --chuid www-data:www-data --background
--exec /usr/bin/ant -- -f $IDOK_SRC_DIR/local-server.xml
-Dserver.hostname=$IDOK_HOST -Dserver.root.dir=$IDOK_SERVER_ROOT start-indexer
+ kill_idok
+ start_idok
log_end_msg $?
;;
reload|force-reload) log_daemon_msg "Reloading configuration files iDok
services" "idok"



  • [idok-commit] idok commit r752 - trunk/scripts/admin/test_server, AFS account Roman Geus, 02/22/2008

Archive powered by MHonArc 2.6.19.

Top of Page