Bug 803625
Summary: | AS7 plugin does not support jboss.server.base.dir | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Mattias Nilsson Grip <matn> | ||||||
Component: | Plugins | Assignee: | Libor Zoubek <lzoubek> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 4.3 | CC: | ccrouch, hrupp, theute | ||||||
Target Milestone: | --- | ||||||||
Target Release: | RHQ 4.4.0 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2013-08-31 10:16:21 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 707223 | ||||||||
Attachments: |
|
Description
Mattias Nilsson Grip
2012-03-15 09:50:14 UTC
Interesting idea - even if I am not entirely sure it was intended that way by the AS guys, but I see that this should work without the need to duplicate all the modules etc. Would you be able to provide a patch? Yes, I think I should be able to provide a patch. Will give it a try during next week. per BZ triage (crouch, loleary, mfoley) Created attachment 571994 [details]
Proposed patch 803625
Attaching a patch that fixes the problem in my local Linux environment. I found another thing. The discovered management port is not correct if one uses -Djboss.socket.binding.port-offset. But that setting can be changed via RHQ web interface so I can report that as a lower priority bug.
Hope you find this patch useful!
Regards Mattias
Matthias, thanks for the patch. It looks to me like it lacks two things - setting the base directory - log file path (that should now also be standalone2/... To see what I mean, go to the inventory tab , connection settings Could you please look into this and either send a completely new patch or a follow up to the above? Thanks Heiko Hi Heiko, before this patch the base directory value in connection settings was populated with $JBOSS_HOME. I saw that this value is used in BaseServerComponent.startServer to prepend the path to the start script so I did not change it. It still points to $JBOSS_HOME after my patch. Is this wrong? Maybe a JBoss 7 resource should have two directory paths ("Home directory" corresponding to $JBOSS_HOME and "Base directory" corresponding to system properties jboss.server.base.dir/jboss.domain.base.dir)? The log file path was actually correctly evaluated even before my patch. In my environment it does point to standalone2/log/server.log, since it is deducted from the boot log path which is deducted from command line param -Dorg.jboss.boot.log.file (see BaseProcessDiscovery.getLogFileFromCommandLine). Does that code not work in your environment? I'm using JBoss AS 7.1.1.Final when testing. Regards, Mattias Hi Mattias, > before this patch the base directory value in connection settings was populated > with $JBOSS_HOME. I saw that this value is used in > BaseServerComponent.startServer to prepend the path to the start script so I > did not change it. It still points to $JBOSS_HOME after my patch. Is this Have you checked that for re-starts, this also uses the -Djboss.server.base.dir found? > wrong? Maybe a JBoss 7 resource should have two directory paths ("Home > directory" corresponding to $JBOSS_HOME and "Base directory" corresponding to > system properties jboss.server.base.dir/jboss.domain.base.dir)? Yes I think this is the right solution. > The log file path was actually correctly evaluated even before my patch. In my > environment it does point to standalone2/log/server.log, since it is deducted > from the boot log path which is deducted from command line param > -Dorg.jboss.boot.log.file (see BaseProcessDiscovery.getLogFileFromCommandLine). I only specified -Djboss.server.base.dir - the server does not set the boot log file to this base dir by itself. Interestingly enough the boot.log file is written to standalone/logs/ while the server.log is written to standalone2/logs/ See https://issues.jboss.org/browse/AS7-4271 > Does that code not work in your environment? I'm using JBoss AS 7.1.1.Final > when testing. Here too. As well as (internal) eap6 beta builds (In reply to comment #8) > Have you checked that for re-starts, this also uses the -Djboss.server.base.dir > found? I have not checked restarts actually... I will do that and adjust the patch if necessary. >> Maybe a JBoss 7 resource should have two directory paths ("Home >> directory" corresponding to $JBOSS_HOME and "Base directory" corresponding to >> system properties jboss.server.base.dir/jboss.domain.base.dir)? > > Yes I think this is the right solution. Ok to introduce this new path as part of this patch? If it is ok I can look into it. > I only specified -Djboss.server.base.dir - the server does not set the boot log > file to this > base dir by itself. Interestingly enough the boot.log file is written to > standalone/logs/ > while the server.log is written to standalone2/logs/ > > See https://issues.jboss.org/browse/AS7-4271 > Strangely, my standalone.sh script has code that sets JBOSS_LOG_DIR to $JBOSS_BASE_DIR/log and then -Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log so there seems to be some discrepancy between our AS7 versions/envs. I'll wait with adjusting this patch until AS7-4271 has been analyzed. (In reply to comment #9) > (In reply to comment #8) > > Have you checked that for re-starts, this also uses the -Djboss.server.base.dir > > found? > I have not checked restarts actually... I will do that and adjust the patch if > necessary. Great. > > Yes I think this is the right solution. > Ok to introduce this new path as part of this patch? If it is ok I can look > into it. Yes. I don't mind if you send one or more individual .patch files. > > > I only specified -Djboss.server.base.dir - the server does not set the boot log > > file to this > > base dir by itself. Interestingly enough the boot.log file is written to > > standalone/logs/ > > while the server.log is written to standalone2/logs/ > > > > See https://issues.jboss.org/browse/AS7-4271 > > > Strangely, my standalone.sh script has code that sets JBOSS_LOG_DIR to > $JBOSS_BASE_DIR/log and then -Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log > so there seems to be some discrepancy between our AS7 versions/envs. I'll wait > with adjusting this patch until AS7-4271 has been analyzed. The script has "if $linux; then " which explains it. The magic of turning -Djboss.server.base.dir and to update the other settings is only called on Linux. Which also means it will very probably fail on Solaris or HP/UX etc. I have updated my initial description on AS7-4271 Thanks Heiko Created attachment 573608 [details]
Follow-up patch
This is a follow-up patch that extends patch 0001. It fixes restarts for standalone AS7 servers that use -Djboss.server.base.dir.
This patch introduces two new connection setting properties for AS7:
homeDir: root directory of the JBoss installation (i.e. JBOSS_HOME)
startScriptArgs: arguments that need to be passed to the start script
The baseDir property is still there but now it points to jboss.server.base.dir or jboss.domain.base.dir instead of JBOSS_HOME.
I verified that AS7 in domain node is still discovered and possible to restart via RHQ after this patch.
verified on JON 3.1.Beta1 Bulk close of old bugs in VERIFIED state. |