Using Chef To Determine If JBoss AS Is Started

Hi,

Is there a way for Chef to know when JBoss AS is started successfully? The only
way I can think of is to search the JBoss log file for the “started” indicator,
but I’m not sure how that can be done with Chef. I’m completely new to Chef and
I’m still learning the terminology and syntax. Any help is appreciated. Thanks.

Gavin

I'm not familiar with JBoss AS, does it create a PID file when running?

File.Exists?("/path/to/pid.file")

On Oct 7, 2011, at 12:30 PM, gavin.lam@commitent.com gavin.lam@commitent.com wrote:

Hi,

Is there a way for Chef to know when JBoss AS is started successfully? The only
way I can think of is to search the JBoss log file for the "started" indicator,
but I'm not sure how that can be done with Chef. I'm completely new to Chef and
I'm still learning the terminology and syntax. Any help is appreciated. Thanks.

Gavin

Does it ship with normal service scripts? Does "service jboss
start/stop/restart" work, for example?

Adam

On Fri, Oct 7, 2011 at 10:30 AM, gavin.lam@commitent.com wrote:

Hi,

Is there a way for Chef to know when JBoss AS is started successfully? The only
way I can think of is to search the JBoss log file for the "started" indicator,
but I'm not sure how that can be done with Chef. I'm completely new to Chef and
I'm still learning the terminology and syntax. Any help is appreciated. Thanks.

Gavin

--
Opscode, Inc.
Adam Jacob, Chief Product Officer
T: (206) 619-7151 E: adam@opscode.com

We use Jboss and chef and I recommend using runit + checking a service on a port once jboss has started to tell if the server is functional yet. Since depending on your service it may take longer to initialize depending on if the application is set to run on init of Jboss AS.

-Pete

-----Original Message-----
From: Adam Jacob [mailto:adam@opscode.com]
Sent: Friday, October 07, 2011 11:14 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Using Chef To Determine If JBoss AS Is Started

Does it ship with normal service scripts? Does "service jboss start/stop/restart" work, for example?

Adam

On Fri, Oct 7, 2011 at 10:30 AM, gavin.lam@commitent.com wrote:

Hi,

Is there a way for Chef to know when JBoss AS is started successfully?
The only way I can think of is to search the JBoss log file for the
"started" indicator, but I'm not sure how that can be done with Chef.
I'm completely new to Chef and I'm still learning the terminology and syntax. Any help is appreciated. Thanks.

Gavin

--
Opscode, Inc.
Adam Jacob, Chief Product Officer
T: (206) 619-7151 E: adam@opscode.com

Thanks for all the replies.

Aaron: I can't really use the PID since the file is created once the JBoss
start command is executed but that doesn't necessarily means that it has
started successfully.

Adam: JBoss doesn't ship with service scripts--none that I know of at least.
However, we did create one, and I can successfully use Chef to start and
stop the service. However, after the service is started, I need to make sure
that no deployment errors occurred before going to the next step.

Peter: That's an interesting idea. I'm going to have to think about it and
see which ports we can check to make sure everything is working properly.

On Fri, Oct 7, 2011 at 2:35 PM, Peter Crossley <Peter.Crossley@webtrends.com

wrote:

We use Jboss and chef and I recommend using runit + checking a service on a
port once jboss has started to tell if the server is functional yet. Since
depending on your service it may take longer to initialize depending on if
the application is set to run on init of Jboss AS.

-Pete

-----Original Message-----
From: Adam Jacob [mailto:adam@opscode.com]
Sent: Friday, October 07, 2011 11:14 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Using Chef To Determine If JBoss AS Is Started

Does it ship with normal service scripts? Does "service jboss
start/stop/restart" work, for example?

Adam

On Fri, Oct 7, 2011 at 10:30 AM, gavin.lam@commitent.com wrote:

Hi,

Is there a way for Chef to know when JBoss AS is started successfully?
The only way I can think of is to search the JBoss log file for the
"started" indicator, but I'm not sure how that can be done with Chef.
I'm completely new to Chef and I'm still learning the terminology and
syntax. Any help is appreciated. Thanks.

Gavin

--
Opscode, Inc.
Adam Jacob, Chief Product Officer
T: (206) 619-7151 E: adam@opscode.com

On Fri, Oct 7, 2011 at 3:03 PM, Gavin Lam gavin.lam@commitent.com wrote:

Thanks for all the replies.

Aaron: I can't really use the PID since the file is created once the JBoss
start command is executed but that doesn't necessarily means that it has
started successfully.

Adam: JBoss doesn't ship with service scripts--none that I know of at least.
However, we did create one, and I can successfully use Chef to start and
stop the service. However, after the service is started, I need to make sure
that no deployment errors occurred before going to the next step.

Peter: That's an interesting idea. I'm going to have to think about it and
see which ports we can check to make sure everything is working properly.

I'd consider using twiddle.sh to do some sanity tests. It would help,
obviously if you threw your own custom management beans in there to
inspect but that would be my first route.

On Fri, Oct 7, 2011 at 2:35 PM, Peter Crossley
Peter.Crossley@webtrends.com wrote:

We use Jboss and chef and I recommend using runit + checking a service on
a port once jboss has started to tell if the server is functional yet.
Since depending on your service it may take longer to initialize depending
on if the application is set to run on init of Jboss AS.

-Pete

-----Original Message-----
From: Adam Jacob [mailto:adam@opscode.com]
Sent: Friday, October 07, 2011 11:14 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Using Chef To Determine If JBoss AS Is Started

Does it ship with normal service scripts? Does "service jboss
start/stop/restart" work, for example?

Adam

On Fri, Oct 7, 2011 at 10:30 AM, gavin.lam@commitent.com wrote:

Hi,

Is there a way for Chef to know when JBoss AS is started successfully?
The only way I can think of is to search the JBoss log file for the
"started" indicator, but I'm not sure how that can be done with Chef.
I'm completely new to Chef and I'm still learning the terminology and
syntax. Any help is appreciated. Thanks.

Gavin

--
Opscode, Inc.
Adam Jacob, Chief Product Officer
T: (206) 619-7151 E: adam@opscode.com