3 Replies Latest reply on Jan 23, 2009 3:59 PM by rafaelcba

    Script's execution

    rafaelcba

      I normally use a specific shell script (jboss_init_debian.sh) to start/stop/restart all my JBoss AS. This script like the jboss_init_redhat.sh found in JBOSS_HOME/bin but it do more things.

      I want use this script from Jopr but I don't know how pass script's parameters like: jboss_init_debian.sh [start/stop/restart/etc]. It's possible?

      I need use a env. variable in run.conf file that is set in jboss_init_debian.sh. If I execute this script from Jopr is possible access the env. var. set on Script's Inventory on Jopr Web Interface? I try set a env. var. on Script's Inventory bus I can't access it in run.conf.

      Any tip for this scenario?

      Thanks!

        • 1. Problem whith shell script execution on RHQ UI
          rafaelcba

          Can someone help me with this issue?

          • 2. Re: Script's execution

            Yes, you can set variables that will be passed as the environment to the process that executes the script. If you look at the inventory tab of the Script resource, you'll see this comment for "Environment Variables":

            "the environment variables that will be passed to the script; each variable must be on a new line and have the syntax name=value; the variable's value can contain properties with the syntax %propertyName%; the script plugin will interpolate these with the current values of the corresponding properties from the script's parent JBossAS server's connection properties"

            So, let's say I set the "Environment Variables" value to:

            JBOSS_SERVER_NAME=%configurationSet%
            JBOSS_SERVER_HOME_DIR=%configurationPath%

            And my script contents are as follows:

            echo %JBOSS_SERVER_NAME%
            echo %JBOSS_SERVER_HOME_DIR%

            Then the output of the operation will be something like the following:

            Exit Code
            0

            Output
            C:\dev\dev-container\jbossas\bin>echo default
            default

            C:\dev\dev-container\jbossas\bin>echo C:\dev\dev-container\jbossas\server\default
            C:\dev\dev-container\jbossas\server\default

            This example is for Windows obviously, but the same principles apply equal well to Linux-based scripts.

            • 3. Re: Script's execution
              rafaelcba

              Yes Marques!

              Works!

              Thanks!