[jboss-as7-dev] Providing server name on command line?
Brian Stansberry
brian.stansberry at redhat.com
Tue Mar 29 10:20:47 EDT 2011
On 3/29/11 7:31 AM, Heiko W.Rupp wrote:
>
> Am 29.03.2011 um 14:25 schrieb Heiko Braun:
>> Thats the server configuration name you see in the logs.
>> You can get a list of names like this:
>> "result" => [
>> "server-one",
>> "server-two",
>> "server-three"
>> ],
>>
>
>> Is this what you are looking for?
>
> Not exactly.
> When I do ps I get:
>
> $ ps auxw|grep org.jboss.as.server
> hrupp 10375 0,1 1,0 1329304 87832 s003 S+ 1:20pm 0:07.26 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xms64m -Xmx512m -Dorg.jboss.boot.log.file=domain/servers/server-one/log/boot.log -Dlogging.configuration=file:/devel/jbas7/jboss-as/build/target/jboss-7.0.0.Beta2/domain/configuration/logging.properties -jar jboss-modules.jar -mp modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.server
> hrupp 10376 0,0 0,9 1057880 79560 s003 S+ 1:20pm 0:07.22 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xms64m -Xmx256m -Dorg.jboss.boot.log.file=domain/servers/server-two/log/boot.log -Dlogging.configuration=file:/devel/jbas7/jboss-as/build/target/jboss-7.0.0.Beta2/domain/configuration/logging.properties -jar jboss-modules.jar -mp modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.server
>
> those two instances only differer in the value of -Dorg.jboss.boot.log.file ; RHQ is able to discover processes and then needs to give them a name.
> Here the server name 'server-one' etc. comes to mind. This is helpful as it can be correlated to the information in the domain model that you
> showed.
> I just have the fear that the log file name is too fragile to be used to uniquely identify a single managed AS instance.
>
Users shouldn't be able to change the name of running servers. (Maybe
they can, but that would be a bug.)
If you need to be able to read the server name from the OS process info,
it should be a regular feature, not depending on something like the
-Dorg.jboss.boot.log.file that we're free to change. <hack-alert>If need
be could add a bogus arg to org.jboss.as.server like --name
server-one.</hack-alert>
> I was first thinking of having -Das.name=server-one , but when the user changes the server name, this property will not change until next process restart,
> which is uncool.
>
> Another option could be that the domain model is returning the pid of the running instance.
>
The host controller has no access to the pid.
> Heiko
>
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
More information about the jboss-as7-dev
mailing list