admin@glassfish.java.net

Re: --echo

From: Sankar Neelakandan <Sankar.Neelakandan_at_Sun.COM>
Date: Tue, 11 Aug 2009 15:51:37 -0700

Bill Shannon wrote:
> Sankar Neelakandan wrote on 8/11/09 9:29 AM:
>
>> Hi Bill,
>>
>> When a asadmin command was constructed from client side(previous
>> releases) and sent to server for execution it was useful to know the
>> options asadmin passed to the server besides user supplied options.
>> Now server has all the command implementations and decides what to use
>> in a command before executing it.
>>
>
> I'm not that familiar with how v2 worked. Are you saying that it
> would print out the values of *all* options, even command options
> that weren't explicitly specified? I was under the impression that
> it only did this for the options that we're now calling the "asadmin
> program (or utility) options".
>
I think so, for example --checkports option will be printed in v2 with
--echo for create-domain command even if it was not specified in command
line by the user.
Recently in v3 this option was made as false by default and
create-domain didn't fail with adminport which was in use. I have no way
of debugging this unless I see what exactly is the command being executed.

>
>> So if we can print what exactly being executed in the server as opposed
>> to what is being passed to server , that would be beneficial for
>> debugging and scripting purposes.
>>
>
> I don't believe there's any way to get this information back from the
> server. asadmin can printout what it *sends* to the server, but it
> doesn't have any way to know what defaults the server might be applying
> for options that aren't explicitly set.
>
>
>> /So, my question is, how important is it that --echo include values for asadmin options that have not been specified? Would it be sufficient if asadmin simply echoed the commands *as entered*?/
>>
>> No, It is important to know what is being executed, than as entered in
>> the command
>>
>
> So you're not using this in the way people use "sh -x"?
>
I tend to differ from this comparison, sh -x simply prints the commands
as it executes. But --echo in asadmin prints the hidden/unspecified
options when the command is executed.
> Do you want this extra information in order to debug problems?
> Or are you just looking for addition assurance that it's executing
> the command you expect with the options you expect?
>
For debugging purposes. If asadmin doesn't include any other params
other than user supplied then we don't need --echo option. So one would
like to know what is being passed /executed, when things go wrong.
> I'm fine with adding more debugging options, but I always thought
> of --echo as synonymous with "sh -x", where echoing the commands
> as entered would be sufficient to (e.g.) track what a script was
> doing.
>
>
>> $ asadmin --echo version
>> asadmin program options: --host localhost --port 4848 --terse false
>> --interactive true --secure false --echo false
>> command: version --verbose false
>>
>>
>> Also we don't need to print the command in two lines with words like all
>> *program options:* and *command:* when the --echo=true simply print all
>> the command options and subcommand and its options like below.
>>
>> $ asadmin --echo version
>> asadmin --host=localhost --port=4848 --terse=false --interactive=true --secure=false --echo=true version --verbose false
>>
>> If it is multimode simply print the subcommand and its options excluding
>> the asadmin options, like below.
>>
>> $ asadmin > --echo version
>> version --verbose false
>>
>
> So when running a multimode script with (e.g.)
> asadmin --echo multimode -f myscript
> you don't need to see the details of the program options for each command
> executed?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>
>