Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Random behavior in assertServiceIsDown - sc on windows

18 views
Skip to first unread message

Miguel A. Lamy

unread,
Jun 26, 2012, 4:16:53 AM6/26/12
to contr...@googlegroups.com
Hi

I'm using controltier 3.6.

I have a random behavior executing "sc" command in windows.
Sometimes it seems it's executed at all and sometiimes is not executed. sc is used when checking if a service
is down in stop workflow.

I post an output of this weird behavior. Please note the two diferent behavior on assertserviceis down. I
hope someone can help me avoid this random behavior.
Thank you.

Output of a failed execution (sc command does not output)

[Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Deploy][INFO] begin workflow command (1/5) -> "Stop "
...
10:21:07 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][WARN] Start: "Conditionally stops the
JBoss Server" commands: assertServiceIsDown
10:21:07 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][INFO] begin workflow command (1/1) ->
"assertServiceIsDown " ...
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] The "SIAG"
service is not running
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][INFO] end workflow command (1/1) ->
"assertServiceIsDown "
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][INFO]
[command.timer.SIAG.JBossServer.Stop: 20.283 sec]
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][WARN] Workflow completed. execution
time: 20.283 sec
10:21:11 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Deploy][INFO] end workflow command (1/5) ->
"Stop "


Output of a correct execution on same server:


[Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Deploy][INFO] begin workflow command (1/5) -> "Stop "
...
08:50:44 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][WARN] Start: "Conditionally stops the
JBoss Server" commands: assertServiceIsDown
08:50:44 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][INFO] begin workflow command (1/1) ->
"assertServiceIsDown " ...
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] SERVICE_NAME: SIAG
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] TYPE : 10
WIN32_OWN_PROCESS
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] STATE : 4 RUNNING
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] (STOPPABLE,
NOT_PAUSABLE, IGNORES_SHUTDOWN)
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] WIN32_EXIT_CODE :
0 (0x0)
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] SERVICE_EXIT_CODE
: 0 (0x0)
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] CHECKPOINT : 0x0
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN] WAIT_HINT : 0x0
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Stop][INFO] Running handler command ->
"stopServiceWrapper "
08:50:45 [Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag stopServiceWrapper][WARN] Start: "wraps the
jboss stop procedure and waits for stop event" commands: stopService,waitforStopEvent


Code in controltier - macrodef assertServiceIsDown


<macrodef name="assertServiceIsDown">
<sequential>
<exec executable="sc" failonerror="false" outputproperty="outputProperty"
resultproperty="resultproperty">
<arg line="query ${opts.svcname}"/>
</exec>
<echo>${outputProperty}</echo>
<fail message="The &quot;${opts.svcname}&quot; service is running">
<condition>
<matches string="${outputProperty}" pattern=".*: 4 RUNNING"/>
</condition>
</fail>
<echo message="The &quot;${opts.svcname}&quot; service is not running"/>
</sequential>
</macrodef>


Thank you,

Miguel Lamy

Miguel A. Lamy

unread,
Jun 28, 2012, 12:58:54 PM6/28/12
to contr...@googlegroups.com
Hello again,

Sorry to insist...

Does someone have any clues about what is happening and can give me some hints to avoid this random behavior.

Thank you,

Miguel Lamy


Miguel A. Lamy on ter�a-feira, 26 de Junho de 2012 at 09:16 wrote:
:Hi

Moses Lei

unread,
Jun 28, 2012, 1:44:01 PM6/28/12
to contr...@googlegroups.com
Hi Miguel. It looks like the sc command is erroring, but the error's not being captured.

Try modifying it to this:

<macrodef name="assertServiceIsDown">
   <sequential>
         <exec executable="sc" failonerror="false" outputproperty="outputProperty"
resultproperty="resultproperty" errorproperty="errorproperty">

           <arg line="query ${opts.svcname}"/>
         </exec>
         <echo>${outputProperty}</echo>
         <echo>${errorproperty}</echo>
         <fail message="The &quot;${opts.svcname}&quot; service is running">
           <condition>
             <matches string="${outputProperty}" pattern=".*: 4  RUNNING"/>
           </condition>
         </fail>
         <echo message="The &quot;${opts.svcname}&quot; service is not running"/>
   </sequential>
 </macrodef>

Then when it fails, it should print out whatever error is being thrown. Hopefully that should help you figure out the problem.

--
Moses Lei
[ Professional Services | DTO Solutions, Inc. ]
[ mobile: +1 703.901.5969 | e-mail: ml...@dtosolutions.com | aim/gtalk: ml...@controltier.com | yahoo: moseslei | windows live (msn): ml...@dtosolutions.com ]



On Thu, Jun 28, 2012 at 9:58 AM, Miguel A. Lamy <mrib...@gedi.pt> wrote:
Hello again,

Sorry to insist...

Does someone have any clues about what is happening and can give me some hints to avoid this random behavior.

Thank you,

Miguel Lamy


--
You received this message because you are subscribed to the Google Groups "ControlTier" group.
To post to this group, send email to contr...@googlegroups.com
To unsubscribe from this group, send email to controltier...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/controltier?hl=en
http://wiki.controltier.org

Miguel A. Lamy

unread,
Jul 1, 2012, 7:15:12 AM7/1/12
to contr...@googlegroups.com
Hi Moses,

Thanks you for your help. I'll give it a try :-)

Miguel Lamy


contr...@googlegroups.com on quinta-feira, 28 de Junho de 2012 at 18:44 wrote:
:Hi Miguel. It looks like the sc command is erroring, but the error's not
:> Miguel A. Lamy on ter a-feira, 26 de Junho de 2012 at 09:16 wrote:
:> :Hi
:> :
:> :I'm using controltier 3.6.
:> :
:> :I have a random behavior executing "sc" command in windows.
:> :Sometimes it seems it's executed at all and sometiimes is not executed.
:> sc is used when checking if a
:> :service is down in stop workflow.
:> :
:> :I post an output of this weird behavior. Please note the two diferent
:> behavior on assertserviceis down. I
:> :hope someone can help me avoid this random behavior.
:> :Thank you.
:> :
:> :Output of a failed execution (sc command does not output)
:> :
:> :[Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Deploy][INFO]
:> begin workflow command (1/5) -> "Stop "
:> :...
:> : 10:21:07 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][WARN] Start:
:"Conditionally stops the
:> :JBoss Server" commands: assertServiceIsDown
:> : 10:21:07 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][INFO] begin workflow
:command (1/1) ->
:> :"assertServiceIsDown " ...
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:The "SIAG"
:> :service is not running
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][INFO] end workflow
:command (1/1) ->
:> :"assertServiceIsDown "
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][INFO]
:> :[command.timer.SIAG.JBossServer.Stop: 20.283 sec]
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][WARN] Workflow
:completed. execution
:> :time: 20.283 sec
:> : 10:21:11 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Deploy][INFO] end workflow
:command (1/5) ->
:> :"Stop "
:> :
:> :
:> :Output of a correct execution on same server:
:> :
:> :
:> :[Administrator@centauro9 SIAG.SIAGSiagJBossServer.siag Deploy][INFO]
:> begin workflow command (1/5) -> "Stop "
:> :...
:> : 08:50:44 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][WARN] Start:
:"Conditionally stops the
:> :JBoss Server" commands: assertServiceIsDown
:> : 08:50:44 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][INFO] begin workflow
:command (1/1) ->
:> :"assertServiceIsDown " ...
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:SERVICE_NAME:
:> :SIAG
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:TYPE : 10
:> :WIN32_OWN_PROCESS
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:STATE : 4 RUNNING
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:(STOPPABLE,
:> :NOT_PAUSABLE, IGNORES_SHUTDOWN)
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:WIN32_EXIT_CODE
:> :: 0 (0x0)
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:> :SERVICE_EXIT_CODE : 0 (0x0)
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:CHECKPOINT : 0x0
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag assertServiceIsDown][WARN]
:WAIT_HINT : 0x0
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag Stop][INFO] Running handler
:command ->
:> :"stopServiceWrapper "
:> : 08:50:45 [Admini...@centauro9SIAG.SIAGSiagJBossServer.siag stopServiceWrapper][WARN]
:>
:
:--
Reply all
Reply to author
Forward
0 new messages