Re: [ControlTier] can't execute scripts under Cygwin (windows)

161 views
Skip to first unread message

Anthony Shortland

unread,
Apr 19, 2012, 11:24:54 AM4/19/12
to contr...@googlegroups.com
Hmm ... this is where Java, Cygwin and Windows collide!

Can you post your "assertServiceIsDown" command? Does it use the "exec" task to run Cygwin /bin/sh? Where is Cygwin installed? C:\?

Ctl runs using the Windows JVM which is oblivious to the internal setup of Cygwin so you should run programs using their Windows path. e.g "C:\bin\sh.exe".

Anthony.

On Apr 19, 2012, at 6:18 AM, marco tol wrote:

If I try to attach scripts to the existing settings in Controltier and I execute em under cygwin(windows), it gives me an error under saying.
 
It says I can't execute /bin/sh under CygwiN? but this should be possible right?
$ ctl -p Ingkub -t Service -r Kubdeploy -c assertServiceIsDown
Error: The following error occurred while executing this line:
C:\ctier\ctl\projects\Ingkub\modules\Service\commands\assertServiceIsDown.xml:23: Execute failed: java.io.IOException: Cannot run program "\bin\sh" (in directory "C:\ctier\ctl\projects\Ingkub\modules\Service\commands"): CreateProcess error=2, The system cannot find the file specified
Op woensdag 18 april 2012 17:33:45 UTC+2 schreef Anthony Shortland het volgende:
Could you post the command line and command output in full?

--
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


marco tol

unread,
Apr 20, 2012, 3:26:49 AM4/20/12
to contr...@googlegroups.com
Cygwin is installed under C:\cygwin.  And I use the "assertServiceisDown" command that is already build in controltier, I only try to attach my own scripts to them as settings.
 
I've put the scripts in my service module, through the workbench(files).
 
Here my settings:
service-start-executable:            

C:\bin\sh.exe    type: shell

service-start-script:

C:\ctier\ctl\projects\Ingkub\modules\Service\bin\start.sh      type : script

 
I try to call the assertServiceIsDown command on the windows client on cygwin with the command : $ ctl -p Ingkub -t Service -r Kubdeploy -c assertServiceIsDown.
 
Not sure if it uses exec. For some reason it can't execute bin/sh under cygwin. or i'm calling the wrong executable, not sure.
 
Hope you can help, I'm really stuck here.
 
 
Not sure if you needed this:
 
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Command Module:   Service
    Command Name:     assertServiceIsDown
    Command Template: http://127.0.0.1:8080/webdav/templates/mbuilder/Command.template.xml
    Description:      checks if service is down
    Author:           ControlTier
    Created:          Mon May 22 14:00:10 PDT 2006
-->
<project name="assertServiceIsDown" default="execute">
  <description>Confirm the service process is down.</description>
  <property name="command.name" value="assertServiceIsDown"/>
  <import file="${module.dir}/lib/command.xml"/>
  <!--
        -execute - This command handler acts
        like a wrapper around an external shell script. Key metadata
        is passed to the shell script via environment variables.
      -->
  <target name="-execute">
    <!--Generator: com.controltier.shared.convert.TypeXMLHandlerGenerator-->
    <!--NOTE: -execute target content is auto-generated by the handler generation process. -->
    <script-exec executable="${opts.executable}" script="${opts.script}" exportproperties="^(?:opts|resource|context|entity|framework|setting).*"/>
  </target>
  <target name="-getopts" depends="-pre-opts">
    <!--NOTE: -getopts target and content is auto-generated by the handler generation process. -->
    <get-opts failonerror="true" usageProperty="getopts.usage" errorProperty="getopts.error" optsValue="${cmd.line}">
      <opts>
        <opt parameter="executable" description="executable to run" required="false" property="opts.executable" type="string" defaultproperty="resource.attribute.service-isdown-executable"/>
        <opt parameter="script" description="script to execute" required="false" property="opts.script" type="string" defaultproperty="resource.attribute.service-isdown-script"/>
      </opts>
    </get-opts>
  </target>
</project>

Op donderdag 19 april 2012 17:24:54 UTC+2 schreef Anthony Shortland het volgende:
To unsubscribe from this group, send email to controltier-unsubscribe@googlegroups.com

marco tol

unread,
Apr 20, 2012, 4:07:11 AM4/20/12
to contr...@googlegroups.com
I have already fixed it. I used C:\bin\sh.exe as the executable but it should have been C:\cygwin\bin\sh.exe
 
thnx alot:)

Op vrijdag 20 april 2012 09:26:49 UTC+2 schreef marco tol het volgende:

Anthony Shortland

unread,
Apr 20, 2012, 10:47:14 AM4/20/12
to contr...@googlegroups.com
Ah ha! Windows (and Java and Ctl) sees Cygwin under C:\cygwin ... while Cygwin itself maps that directory to "/"!

For this reason, we've often installed Cygwin straight into C:\ to ensure all systems use the same paths as a convenience.

Anthony.

To unsubscribe from this group, send email to controltier...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages