5 Replies Latest reply on Jul 31, 2012 5:25 AM by Wolf-Dieter Fink

    Possible to invoke deployments scanner with CLI command?

    Ben Schofield Novice

      I would like to have the deployment scanner turned off. Then be able to force it to run at any time without a server restart.  Is it possible to force the deployment scanner to run once and only once with a CLI command?  This is JBoss 7.1.

        • 1. Re: Possible to invoke deployments scanner with CLI command?
          Stan Silvert Master

          I don't see any direct way to do this.  However, you could accomplish this with a more sophisticated CLI script written in Groovy, Java, or some other JVM-based language.  You would just set the scan interval to some really high value, enable the scanner, then Thread.sleep() for awhile, and disable the scanner.

           

          But I wonder why you need the deployment scanner at all.  Direct deployment with the "deploy" command is usually preferred.  You could easily write a script that looks in a directory and deploys whatever is there.

           

          Stan

          • 2. Re: Possible to invoke deployments scanner with CLI command?
            Ben Schofield Novice

            You could easily write a script that looks in a directory and deploys whatever is there.

            This is exactly what the deployment scanner does.  Was hoping to not replicate functionality that already exists and then impose the need to manage an installation script.  You are correct though I could write a script that does the same thing.

             

            Another requirement is that ops personnel need the ability to see what content is deployed to any JBoss instance at anytime.   Ideally would love to have the repository content readable from the file system and then scripting an install would be fine.  Unfortunately this is not possible.  By going the scripting route I now have to manage the synchronization of what is in the directory the script looks in and what is actually successfully deployed on the server.  The deployment scanner helps with this task with the marker files. 

             

            So at the end of the day the need for the deployment scanner is a temporary solution attempting to make successfully deployed content visible to operations and support personnel. 

            • 3. Re: Possible to invoke deployments scanner with CLI command?
              Stan Silvert Master

              You should already be able to see what is deployed to each instance, though this command is not ideal for your needs:

              /host=master/server=server-one/:read-children-resources(child-type=deployment)

               

              Maybe you should put in a feature request or even a patch.  I'm sure a run-once feature for the deployment scanner wouldn't be hard to implement.

               

              The ability to "pull back" and examine something stored in the content respository is an interesting feature as well.  It is possible to pull back the bytes but there is nothing I know of that writes the bytes back to the file system for examination.  We do need this though.

               

              Stan

              • 4. Re: Possible to invoke deployments scanner with CLI command?
                Ben Schofield Novice

                You should already be able to see what is deployed to each instance, though this command is not ideal for your needs:

                /host=master/server=server-one/:read-children-resources(child-type=deployment)

                Unfortunately this command only gives the name of the deployment so it is not much help. 

                 

                I know of two issues related to be being able to view deployed content.  From an ops standpoint and ease of use 5228 would be preferable but I don't know the full impact of such an approach.

                If you agree with the need for such features please vote them up.

                 

                As for the run-once feature for the deployment scanner, I have created AS7-5270.  I haven't looked at the code related to CLI yet but would be interested in supplying the patch.  Any hints on where to get started would be appreciated.

                • 5. Re: Possible to invoke deployments scanner with CLI command?
                  Wolf-Dieter Fink Master

                  What you might do is to disable the deployment-scanner, set the interval to a high value.

                  If you need scanning you can enable the scan with.

                       /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled,value=true)

                  and disable it after the deployment is done