<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This won't work as there's no guarantee there will be a server.log
and/or that it would live in log directory. The best solution
involves not reading logs at all. I don't have any great ideas on
the best way to currently do that.<br>
<br>
<div class="moz-cite-prefix">On 06/11/2015 10:25 PM, Jorge Solórzano
wrote:<br>
</div>
<blockquote
cite="mid:CA+cVU8MXT+n4B5bgHTBu4Aq+Oj__SOXgxx3mOtPjcgKhYgtDXQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:verdana,sans-serif">I think there is no
easy fix, we can assume for example that after 3 seconds that
the PID exists then the process is up and return OK, but if
the process stops latter, it will be a fake start.<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">I know that we should
not rely on read the log as James stated, but until we can
figure out a better aproach this is my proposal, I can modify
wildfly-init-debian.sh to have this behavior<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">1. Add to logging
subsystem to standalone*.xml:<br>
<logger category="<a moz-do-not-send="true"
href="http://org.jboss.as" target="_blank">org.jboss.as</a>"><br>
<level name="INFO"/><br>
</logger><br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">2. Remove
JBOSS_CONSOLE_LOG and read JBOSS_LOG_DIR<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">3. If standalone read
"$JBOSS_LOG_DIR/server.log"<br>
if domain read "$JBOSS_LOG_DIR/host-controller.log"<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">to find <span><span></span>WFLYSRV0025
or the string used for EAP... this is probably volatile but
it's not changed frequently, in fact it has been changed
only once.<br>
<br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><span>4. Always check
the status of pid (if dies return immediately).<br>
<br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><span>5. If server.log
is not found, deactivated or not print the correct output
there are two choices:<br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><span>a. On wait
timeout, send a warning about an unknow status (this is how
works right now).<br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><span>b. On wait
timeout, just check if PID is still up and return OK,
otherwise FAILURE.<br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><span><br>
</span></div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">I believe this approach
avoids the problem of console log...<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><br>
</div>
<div class="gmail_extra">
<div class="gmail_default"
style="font-family:verdana,sans-serif">
<div class="gmail_default"
style="font-family:verdana,sans-serif;display:inline"></div>
Best regards,<br>
</div>
<br clear="all">
<div>
<div><br>
Jorge Solórzano<br>
<a moz-do-not-send="true" href="http://www.jorsol.com"
target="_blank">http://www.jorsol.com</a></div>
</div>
<br>
<div class="gmail_quote">On Thu, Jun 11, 2015 at 5:29 PM, Chao
Wang <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:chaowan@redhat.com" target="_blank">chaowan@redhat.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Thanks for your reply. Please see in-line below<span><br>
<br>
On 06/11/2015 12:44 AM, Brian Stansberry wrote:<br>
</span></div>
<span>
<blockquote type="cite">
<pre>A couple thoughts:
1) Looking at wildfly-init-redhat.sh at least, I don't see how that
check is actually testing for successful startup. It looks like it's
just trying to delay start() returning for a while, max 30 secs.
So, what purpose is this fulfilling?</pre>
</blockquote>
</span> My bad about issue background. It's actually an
case in EAP 6 (not yet in wildfly). EAP 6.x script has
launched state like: <a moz-do-not-send="true"
href="https://github.com/jbossas/jboss-eap/blob/6.4.x/build/src/main/resources/bin/init.d/jboss-as-standalone.sh#L110"
target="_blank">https://github.com/jbossas/jboss-eap/blob/6.4.x/build/src/main/resources/bin/init.d/jboss-as-standalone.sh#L110</a>
(not in wildfly's script). Also, console log handler has
been removed only in EAP full-ha mode long time ago due
to performance concern.(wildfly keeps it for the
moment). This leads to issue in <a
moz-do-not-send="true"
href="https://bugzilla.redhat.com/show_bug.cgi?id=1224170"
target="_blank">bz1224170</a>. <br>
That's why I try to seek an better option than current
behavior from wildfly. <span>
<blockquote type="cite">
<pre>2) How does other software solve this problem? If it's solving a valid
problem, it seems like there would be a typical solution.</pre>
</blockquote>
</span> I have checked some other application servers,
most of them let users themselves to write a script to
run as service for their OS. Geronimo does provide a
script, Although I did damage to its configuration file
to make a fatal error, terminal output still displays
"Server started". In fact, process does not event exist
and detail error can be seen in log file.
<div>
<div>
<blockquote type="cite">
<pre>On 6/9/15 8:59 AM, Chao Wang wrote:
</pre>
<blockquote type="cite">
<pre>Hi all,
The Wildfly start-up as service scripts wildfly-init-redhat.sh and
wildfly-init-debian.sh currently depend on a grep action of key message
'WFLYSRV0025:' in console log to determinate whether service start is
successful. The log message indication is accurate, however, it's not
that robust since user can always remove console handler from logging
subsystem. I have opened a WFCORE enhancement jira
<a moz-do-not-send="true" href="https://issues.jboss.org/browse/WFCORE-747" target="_blank">https://issues.jboss.org/browse/WFCORE-747</a> for it.
For the moment, I have tried three options, they're all not that perfect
to implement
1. Stay with exact log message, users need to define their jboss log
directory such as $JBOSS_HOME/standalone/log/server.log for standalone
and $JBOSS_HOME/domain/log/host-controller.log for domain instead of
searching in console log. This is more like another workaround since it
is also volatile once we update log message in future release.(EAP has
'JBAS015874:')
2. Use service pid, this is not precise because a long start-up can
crash in the last second. It needs to wait a suitable seconds before
checking pid existence. and still it can not avoid fake success in rare
case just before timeout.
3. Use read-attribute server-state through CLI connection as I did in
Pull Request on Jira. This is declined as it is possible that
authentication is required before connection. In such case, any non
encrypted password is not advised in configuration files.
Therefore, I would like to listen for your opinions for them. Any other
suggestion is certainly welcomed in mail or on jira.
<div class="gmail_default" style="font-family:verdana,sans-serif;display:inline"></div>
Best regards,
Chao
_______________________________________________
wildfly-dev mailing list
<a moz-do-not-send="true" href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>
<a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a>
</pre>
</blockquote>
</blockquote>
<br>
</div>
</div>
[1] <a moz-do-not-send="true"
href="https://bugzilla.redhat.com/show_bug.cgi?id=1224170"
target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1224170</a><span><font
color="#888888"><br>
<pre cols="72">--
Chao Wang
Software Engineer
JBoss by Red Hat</pre>
</font></span></div>
<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:wildfly-dev@lists.jboss.org"
target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/wildfly-dev"
rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
wildfly-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/wildfly-dev">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
James R. Perkins
JBoss by Red Hat</pre>
</body>
</html>