Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r78 - trunk/sites/psi/scripts/admin/dmsd/dist

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r78 - trunk/sites/psi/scripts/admin/dmsd/dist


Chronological Thread 
  • From: "Apache" <apache AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r78 - trunk/sites/psi/scripts/admin/dmsd/dist
  • Date: Wed, 30 Apr 2008 16:22:08 +0200
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: huebner AT PSI.CH
Date: Wed Apr 30 16:22:08 2008
New Revision: 78

Log:
various fixes

Modified:
trunk/sites/psi/scripts/admin/dmsd/dist/dmsd
trunk/sites/psi/scripts/admin/dmsd/dist/dmsd.config
trunk/sites/psi/scripts/admin/dmsd/dist/stop-dmsd.sh

Modified: trunk/sites/psi/scripts/admin/dmsd/dist/dmsd
==============================================================================
--- trunk/sites/psi/scripts/admin/dmsd/dist/dmsd (original)
+++ trunk/sites/psi/scripts/admin/dmsd/dist/dmsd Wed Apr 30 16:22:08
2008
@@ -33,90 +33,45 @@
return ${?}
}

-function check_xvfb () {
- local line
- local pid
- local rest
- local res
- local rep=3;
- while (( rep != 0 )); do
- line=`ps -C Xvfb -o pid=,args= | grep "${DUMMY_DISPLAY}"`
- res=${?}
- (( res == 0 )) && break
- usleep 500
- (( rep-- ))
- done
- (( res == 0 )) || return 1
- read pid rest < <(echo ${line}) || return 1
- echo ${pid}
-}
-
-function start_xvfb () {
- local retries=10
- test -z ${DUMMY_DISPLAY:-""} && { echo $"Error: DUMMY_DISPLAY has
notbeen defined properly in dmsd.config"; return 1; }
- Xvfb -nolisten tcp -ac ${DUMMY_DISPLAY} < /dev/null > /dev/null 2>&1 &
- check_xvfb > /dev/null 2>&1 || return 1
- while (( retries > 0 )) && ! DISPLAY=${DUMMY_DISPLAY} xset q
${DUMMY_DISPLAY} > /dev/null 2>&1; do
- (( retries-- ))
- sleep 1
- done
- (( retries > 0 )) || return 1
-}
-
-function stop_xvfb () {
- local pid
- pid=`check_xvfb`
- (( ${?} == 0 )) || return 1
- kill ${pid} || return 1
-}
-
function jmx_port_open () {
netstat -ltn | grep :${JMX_PORT} &> /dev/null
return ${?}
}

function f_start () {
- local retries=10
+ local retries=10
dmsd_status && { echo $"${PROG} is already running"; return 0; }
test -r ./run-dmsd.sh || { echo $"Error: run-dmsd.sh is not readable";
return 1; }
- start_xvfb || { echo $"Error: failed to start Xvfb"; return 1; }
echo -n "Starting ${PROG}"
at -f run-dmsd.sh NOW < /dev/null &> /dev/null
while (( retries > 0 )) && ! jmx_port_open; do
(( retries-- ))
- sleep 2
+ sleep 2
done
- (( retries == 0 )) && { failed; stop_xvfb; return 1; }
- dmsd_status || { failed; stop_xvfb; return 1; }
+ (( retries == 0 )) && { failed; return 1; }
+ dmsd_status || { failed; return 1; }
succeeded
}

function f_stop () {
test -r ./stop-dmsd.sh || { echo $"Error: stop-dmsd.sh is not readable";
return 1; }
- stop_xvfb || echo $"Warning: failed to stop Xvfb"
echo -n "Stopping ${PROG}"
- ./stop-dmsd.sh < /dev/null > /dev/null 2>&1
- if (( ${?} != 0 )); then
- failed
- return 1
+ ./stop-dmsd.sh < /dev/null 2>&1
+ if ((${?} != 0)); then
+ failed
+ return 1
fi
- succeeded
+ succeeded
}

function f_status () {
- local xvfb
- check_xvfb > /dev/null 2>&1
- xvfb=${?}
dmsd_status;
- RETVAL=${?}
- if (( RETVAL == 0 )); then
- (( ${xvfb} == 0 )) || echo $"Warning: Xvfb is not running,
start it with Xvfb -nolisten tcp -ac ${DUMMY_DISPLAY}!"
- echo $"${PROG} (pid ${DMSD_PID:-unknown}) is running..."
+ if ((${?} != 0)); then
+ echo "dmsd is not running"
else
- (( ${xvfb} != 0 )) || echo $"Warning: Xvfb is still running!"
- echo $"${PROG} is stopped"
- fi;
- return ${RETVAL}
+ echo "dmsd is running with PID=${DMSD_PID}"
+ fi
+ return ${?}
}

function f_restart () {

Modified: trunk/sites/psi/scripts/admin/dmsd/dist/dmsd.config
==============================================================================
--- trunk/sites/psi/scripts/admin/dmsd/dist/dmsd.config (original)
+++ trunk/sites/psi/scripts/admin/dmsd/dist/dmsd.config Wed Apr 30 16:22:08
2008
@@ -10,7 +10,7 @@
DUMMY_DISPLAY=:2

# The port Open Office should listen to
-OOUNO_PORT=2002
+OOUNO_PORT=8100

# The initial log level and log file of the daemon
# .N will be appended to the log file by the file logging handler

Modified: trunk/sites/psi/scripts/admin/dmsd/dist/stop-dmsd.sh
==============================================================================
--- trunk/sites/psi/scripts/admin/dmsd/dist/stop-dmsd.sh (original)
+++ trunk/sites/psi/scripts/admin/dmsd/dist/stop-dmsd.sh Wed Apr 30
16:22:08 2008
@@ -36,4 +36,3 @@
${CONFIGURATOR} \
localhost \
${JMX_PORT}
-



  • [idok-commit] idok commit r78 - trunk/sites/psi/scripts/admin/dmsd/dist, Apache, 04/30/2008

Archive powered by MHonArc 2.6.19.

Top of Page