Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed May 28, 2015
2 parents cf0cd23 + 508330a commit 9cd4999
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 19 deletions.
7 changes: 4 additions & 3 deletions bin/startGemServerGem
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

GemServer="$1"
Port="$2"
PortName=`echo ${Port} | sed "s/'//g"` #strip ' off in case of a non-integer argument

set -e # exit on error

Expand Down Expand Up @@ -52,7 +53,7 @@ logDir=${GEMSTONE_LOGDIR}
if [ "${logDir}x" = "x" ] ; then
logDir=/opt/gemstone/log
fi
logFile="${logDir}/${GemServer}_server-${Port}.log"
logFile="${logDir}/${GemServer}_server-${PortName}.log"

username=$GEMSTONE_USER_NAME
if [ "${GEMSTONE_USER_NAME}x" = "x" ] ; then
Expand All @@ -78,11 +79,11 @@ run
| logEntry |
System beginTransaction.
(logEntry := ObjectLogEntry
fatal: '${GemServer}_server_${Port}: topaz exit'
fatal: '${GemServer}_server_${PortName}: topaz exit'
object:
'pid: ', (System gemVersionReport at: 'processId') printString) addToLog.
(GemServerRegistry gemServerNamed: '$GemServer')
ifNotNil: [:gemServer | gemServer crashLog add: (${Port}) asString -> logEntry ].
ifNotNil: [:gemServer | gemServer crashLog add: (${PortName}) asString -> logEntry ].
System commitTransaction.
%
Expand Down
6 changes: 5 additions & 1 deletion bin/stopGemServerGem
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

GemServer="$1"
Port="$2"
PortName=`echo ${Port} | sed "s/'//g"` #strip ' off in case of a non-integer argument

# must match GemServer>>gemPidFileName:

logDir=${GEMSTONE_LOGDIR}
if [ "${logDir}x" = "x" ] ; then
logDir=/opt/gemstone/log
fi
pidfile="${logDir}/${GemServer}_server-${Port}.pid"
pidfile="${logDir}/${GemServer}_server-${PortName}.pid"

if [ -e $pidfile ]; then
pid=`cat $pidfile`
rm $pidfile
echo " Stopping topaz PID $pid running on port $port"
kill $pid
while [[ ( -d /proc/$pid ) && ( -z `grep zombie /proc/$pid/status` ) ]]; do
sleep 1
done
else
echo " No PID file found for gem on port $port, not running?"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server specialization
executeStartGemCommand: portOrResourceName
| commandLine |
commandLine := self startScriptPath , ' ' , self name , ' '
, portOrResourceName asString , ' "' , self exeConfPath , '"'.
commandLine := self startScriptPath , ' ' , self name , ' "'
, portOrResourceName printString , '" "' , self exeConfPath , '"'.
self performOnServer: commandLine
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ service instance-control
restartGems
self logControlEvent: 'Restart Gems: ' , self name.
self stopGems.
(Delay forSeconds: 3) wait. "give gem a chance to close sockets"
self startGems
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
service instance-control
waitForStartGems: timeOutSeconds
| pidList count |
pidList := ''.
count := 0.
self logControlEvent: 'Wait for Gems: ' , self name.
self portOrResourceNameList
do: [ :portOrResourceName |
| pidFilePath file |
pidFilePath := self gemPidFileName: portOrResourceName.
[ GsFile existsOnServer: pidFilePath ]
whileFalse: [
(Delay forSeconds: 1) wait.
count := count + 1.
count > timeOutSeconds
ifTrue: [ ^ false ] ] ].
^ true
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"enableRemoteBreakpoints" : "dkh 12/10/2014 17:01",
"enableRemoteBreakpoints:" : "dkh 11/26/2014 19:16",
"exeConfPath" : "dkh 01/01/2015 16:54",
"executeStartGemCommand:" : "dkh 01/06/2015 15:31",
"executeStartGemCommand:" : "dkh 05/27/2015 17:02",
"executeStatusGemCommand:" : "dkh 12/20/2014 21:46",
"executeStopGemCommand:" : "dkh 01/06/2015 15:30",
"gemPidFileName:" : "dkh 01/26/2015 15:07",
Expand Down Expand Up @@ -99,7 +99,7 @@
"reentryAllowed" : "dkh 01/09/2015 13:12",
"reentryDisallowed" : "dkh 01/09/2015 13:11",
"register" : "dkh 01/06/2015 13:39",
"restartGems" : "dkh 12/06/2014 13:04",
"restartGems" : "dkh 05/27/2015 16:24",
"saveContinuationFor:titled:inTransactionDo:" : "dkh 12/30/2014 07:25",
"scriptBinDirPath" : "dkh 11/29/2014 09:44",
"scriptLogEvent:object:" : "dkh 01/09/2015 17:18",
Expand Down Expand Up @@ -132,4 +132,5 @@
"transactionMutex" : "dkh 12/22/2014 14:48",
"unregister" : "dkh 01/06/2015 13:39",
"validateName:" : "dkh 11/26/2014 18:29",
"waitForStartGems:" : "dkh 05/28/2015 00:47",
"writeGemLogEntryFor:titled:" : "dkh 01/06/2015 16:49" } }

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ startGems: gemServer
self
notify:
'evaluate on server: abort; /home/gemserver/example --start=Test_Server' ]
ifFalse: [ gemServer startGems ]
ifFalse: [
gemServer startGems.
self
waitForGemServer: gemServer
message: 'Gems did not start ' , self gemServerName ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
private
stopGems: gemServer
self staticRemoteServer
ifFalse: [
gemServer stopGems.
(Delay forSeconds: 3) wait ]
ifFalse: [ gemServer stopGems ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
private
waitForGemServer: gemServer message: message
(gemServer waitForStartGems: 20)
ifFalse: [
Transcript
cr;
show: message.
self assert: false ]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"instance" : {
"createGemServer" : "dkh 01/09/2015 14:05",
"interactiveRemoteServer" : "dkh 01/09/2015 14:02",
"startGems:" : "dkh 01/09/2015 14:08",
"startGems:" : "dkh 05/28/2015 01:26",
"staticRemoteServer" : "dkh 01/09/2015 14:03",
"stopGems:" : "dkh 01/09/2015 14:08",
"testForceBeginTransaction" : "dkh 01/09/2015 14:08" } }
"stopGems:" : "dkh 05/28/2015 01:05",
"testForceBeginTransaction" : "dkh 01/09/2015 14:08",
"waitForGemServer:message:" : "dkh 05/28/2015 01:25" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
useEventLog: anObject

useEventLog := anObject
useEventLog := anObject

Large diffs are not rendered by default.

0 comments on commit 9cd4999

Please sign in to comment.