aspose file tools*
The moose likes JBoss/WildFly and the fly likes restarting script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "restarting script" Watch "restarting script" New topic
Author

restarting script

Wiesel Mueller
Greenhorn

Joined: Feb 15, 2011
Posts: 2
Hi all,
i would like to create a script which stop jboss and postgresql and firstly start postgresql then jboss.

That's not difficult but often jboss runs on server2 and postgresql on server1.

if the script would like to start jboss via ssh on server2, jboss isn't shutdown in this time.

Is it possible to check with the script on server1, that jboss is shut down before jboss will be restarted.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Wiesel, welcome to Java Ranch!

I usually use "ps -ef | grep java" to see what Java apps are running. You could further refine that to "ps -ef | grep org.jboss.Main". This works OK if you run a single instance; if you run multiple instance you should also grep for the configuration name (e.g. "...| grep '-c defult'")


JBoss In Action
Wiesel Mueller
Greenhorn

Joined: Feb 15, 2011
Posts: 2
Hi Peter,
but what's the script code to check this.
I would like that a cronjob will check it, and if jboss is shut down completly, than the script will start jboss again.

Does Jboss doesn't have function for this?

JBoss can also check on start for a running instance of jboss, if the instance is existing jboss won't start.

Best regards
Wiesel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Take a look at the run.sh script, it actually restarts JBoss AS under certain situations. You should be able to modify the script to do what you want.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: restarting script