<!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;">
    Re: Init script of jboss 4.2.3 GA - jdk6 for Debian 7
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/mikelvadillo">Mikel Vadillo</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/820781#820781">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi everyone....</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>At the end i found the problem in the man pages of start-stop-daemon:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&minus;S</strong>,<strong>&minus;&minus;start</strong> [<strong>&minus;&minus;</strong>]<em>arguments</em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Check for the existence of a specified process. If such a process exists,<strong>start&minus;stop&minus;daemon</strong> does nothing, and exits with error status 1 (0 if <strong>&minus;&minus;oknodo</strong> is specified). If such a process does not exist, it starts an instance, using either the executable specified by<strong>&minus;&minus;exec</strong> or, if specified, by<strong>&minus;&minus;startas</strong>. <strong>Any arguments given after&minus;&minus; on the command line are passed unmodified to the program being started.</strong></p><div class="mcePaste" id="_mcePaste" style="position: absolute; top: 0px; left: 0px;"></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>so .......</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><td style="border:1px solid black;border: 1px solid #000000;">...<br/>PARAMS="-b 192.168.1.205"<br/>DAEMON=${JBOSS_HOME}/bin/run.sh<br/>... <br/>do_start(){&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; start-stop-daemon --start --chuid jboss --user jboss --name jboss&#160; --exec ${DAEMON} -- ${PARAMS} <br/>&#160;&#160;&#160; }<br/>....</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I was missing the -- before the parametres.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks all anyway......</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>P.D.: the complete final script with a sleep modification too:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><td style="border:1px solid black;border: 1px solid #000000;"><p>#!/bin/sh<br/>### BEGIN INIT INFO<br/># Provides: jboss<br/># Required-Start: $local_fs $remote_fs $network $syslog<br/># Required-Stop: $local_fs $remote_fs $network $syslog<br/># Default-Start: 2 3 4 5<br/># Default-Stop: 0 1 6<br/># Short-Description: Start/Stop JBoss AS v7.0.0<br/>### END INIT INFO</p><p><br/>JBOSS_HOME=/opt/jboss</p><p>JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-i386</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>export JAVA_HOME<br/>export JBOSS_HOME</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>PARAMS="-b 192.168.1.205"<br/>DAEMON=${JBOSS_HOME}/bin/run.sh</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>do_start(){ <br/>&#160; start-stop-daemon --start --chuid jboss --user jboss --name jboss -b --exec ${DAEMON} -- ${PARAMS}<br/> }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>do_stop(){<br/>&#160; start-stop-daemon --stop -u jboss<br/>&#160; rm -f ${PIDFILE}<br/>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>case "$1" in<br/>&#160;&#160;&#160; start)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "Starting JBoss 4.2.3"<br/> do_start<br/>&#160;&#160;&#160; ;;<br/>&#160;&#160;&#160; stop)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "Stopping JBoss 4.2.3"<br/> do_stop<br/>&#160;&#160;&#160; ;;<br/>&#160;&#160;&#160; restart)<br/> echo "Restarting JBoss 4.2.3"<br/> do_stop<br/> sleep 30<br/> do_start<br/>&#160;&#160;&#160; ;;<br/>&#160;&#160;&#160; *)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "Usage: /etc/init.d/jboss4.2.3 {start|stop|restart}"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; exit 1<br/>&#160;&#160;&#160; ;;<br/>esac</p></td></tr></tbody></table></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/820781#820781">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>