<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    jboss autostart script
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/gjerich">gasper jeric</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/753403#753403">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>hello</p><p>this maybe help someone. I modified ex jboss_init_redhat.sh script to work it for jboss 7.1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>#!/bin/sh</p><p>#jboss home</p><p>JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss"}</p><p>#make sure java is in your path</p><p>JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}</p><p>#define the classpath for the shutdown class</p><p>JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/jboss-cli.sh --connect command=:shutdown"}</p><p>#define the script to use to start jboss</p><p>JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/standalone.sh"}</p><p>#define what will be done with the console log</p><p>JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"</p><p>JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JBOSSCP"}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then</p><p>&#160; export PATH=$PATH:$JAVAPTH</p><p>fi</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>if [ ! -d "$JBOSS_HOME" ]; then</p><p>&#160; echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME</p><p>&#160; exit 1</p><p>fi</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>#echo JBOSS_CMD_START = $JBOSS_CMD_START</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>case "$1" in</p><p>start)</p><p>&#160;&#160;&#160; cd $JBOSS_HOME/bin &amp; echo starting...</p><p>&#160;&#160;&#160; if [ -z "$SUBIT" ]; then</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; eval $JBOSS_CMD_START &gt;${JBOSS_CONSOLE} 2&gt;&amp;1 &amp;</p><p>&#160;&#160;&#160; else</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $SUBIT "$JBOSS_CMD_START &gt;${JBOSS_CONSOLE} 2&gt;&amp;1 &amp;" </p><p>&#160;&#160;&#160; fi</p><p>&#160;&#160;&#160; ;;</p><p>stop)</p><p>&#160;&#160;&#160; if [ -z "$SUBIT" ]; then</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $JBOSS_CMD_STOP &amp; echo stopping...</p><p>&#160;&#160;&#160; else</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $SUBIT "$JBOSS_CMD_STOP"</p><p>&#160;&#160;&#160; fi </p><p>&#160;&#160;&#160; ;;</p><p>restart)</p><p>&#160;&#160;&#160; $0 stop</p><p>&#160;&#160;&#160; $0 start</p><p>&#160;&#160;&#160; ;;</p><p>*)</p><p>&#160;&#160;&#160; echo "usage: $0 (start|stop|restart|help)"</p><p>esac</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>usage</strong>:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">sudo service jboss start</li><li style="text-align: start;">sudo service jboss stop</li><li style="text-align: start;">sudo service jboss restart</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">or this way:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">sudo /etc/init.d/jboss start</li><li style="text-align: start;">sudo /etc/init.d/jboss stop</li><li style="text-align: start;">sudo /etc/init.d/jboss restart</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">all comments apreciated</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/753403#753403">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>