Skip to content

Commit

Permalink
proposed bugfixes for Issue #32 and Issue #30 ...
Browse files Browse the repository at this point in the history
Issue #32 fix involves waiting until the gem process has well an truly stopped .. changes made to stopGemServerGem and removal of delay in GemServer>>restartGems
Issue #30 involves using #printString and well-placed `"` for command line argument creation in GemServer>>executeStartGemCommand: and changes to stopGemServerGem and startGemServerGems to strip the `'` character from file names while leaving it for use in Smalltalk code ...
  • Loading branch information
dalehenrich committed May 28, 2015
1 parent cf0cd23 commit 41bedb3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 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
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

Large diffs are not rendered by default.

0 comments on commit 41bedb3

Please sign in to comment.