Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 90944 invoked from network); 13 Feb 2007 18:34:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 18:34:27 -0000 Received: (qmail 517 invoked by uid 500); 13 Feb 2007 18:34:35 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 297 invoked by uid 500); 13 Feb 2007 18:34:34 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 286 invoked by uid 99); 13 Feb 2007 18:34:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 10:34:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 10:34:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BADBC7142BF for ; Tue, 13 Feb 2007 10:34:05 -0800 (PST) Message-ID: <14821523.1171391645762.JavaMail.jira@brutus> Date: Tue, 13 Feb 2007 10:34:05 -0800 (PST) From: "Alex Karasulu (JIRA)" To: dev@directory.apache.org Subject: [jira] Closed: (DIRSERVER-730) init script fails due to missing commands "success" and "failure" In-Reply-To: <10283150.1157604502362.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DIRSERVER-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Karasulu closed DIRSERVER-730. ----------------------------------- Resolution: Fixed Committed revision 507141 on 1.0 branch here: http://svn.apache.org/viewvc?view=rev&revision=507141 Committed revision 507143 on 1.5 branch (trunk) here: http://svn.apache.org/viewvc?view=rev&revision=507143 Note that I could not apply the supplied patches because they seemed a bit out of date and were garbled up by JIRA: attach a patch to avoid these problems instead of putting them in a comment or description. I took your advice and made the following fixes: o all server.init scripts now return $RETVAL instead of $? o scripts targeting non-rpm based distros use /bin/sh instead of /bin/bash It seems as though I already removed the calls to success and failure which are specific to RH distros. Now there is a simple echo of success or failure instead of using these functions. Just for the record these scripts are really aweful. They were put together rapidly and should probably be rewritten. > init script fails due to missing commands "success" and "failure" > ----------------------------------------------------------------- > > Key: DIRSERVER-730 > URL: https://issues.apache.org/jira/browse/DIRSERVER-730 > Project: Directory ApacheDS > Issue Type: Bug > Affects Versions: 1.0-RC4 > Environment: OpenSuSE 10.0 > Reporter: Michael Henry > Assigned To: Alex Karasulu > Fix For: 1.0.1, 1.5.0 > > Attachments: apacheds-daemon-trunk-serverinit.patch > > > Here is the output for startup: > samsara:~ # /etc/init.d/apacheds start > JAVA_HOME=/usr/lib/jvm/java > APACHEDS_HOME=/usr/local/apacheds-1.0_RC4 > CLASSPATH=:/usr/lib/jvm/java/lib/tools.jar:/usr/local/apacheds-1.0_RC4/bin/bootstrapper.jar:/usr/local/apacheds-1.0_RC4/bin/logger.jar:/usr/local/apacheds-1.0_RC4/bin/daemon.jar > Starting apacheds server: /etc/init.d/apacheds: line 155: success: command not found > /etc/init.d/apacheds: line 156: failure: command not found > ...and shutdown: > samsara:/etc/init.d # ./apacheds stop > JAVA_HOME=/usr/lib/jvm/java > APACHEDS_HOME=/usr/local/apacheds-1.0_RC4 > CLASSPATH=:/usr/lib/jvm/java/lib/tools.jar:/usr/local/apacheds-1.0_RC4/bin/bootstrapper.jar:/usr/local/apacheds-1.0_RC4/bin/logger.jar:/usr/local/apacheds-1.0_RC4/bin/daemon.jar > Shutting down apacheds server: ./apacheds: line 188: success: command not found > ./apacheds: line 189: failure: command not found > Both cases have the exact same problem so I will just cover the startup case. > Lines 155 and 156 are: > [ "$RETVAL" -eq 0 ] && success $"apacheds server startup" || \ > failure $"apacheds server start" > My guess is that "success" and "failure" are functions which are expected to be defined in the following which starts at line 14: > # Source function library. > if [ -f /etc/init.d/functions ] ; then > . /etc/init.d/functions > fi > The file /etc/init.d/functions doesn't exist on SuSE platforms. > A possible fix would be to define a variable such as "FUNCTIONS_EXIST=true" inside the if statement and systems for which the functions do not exist could be lumped in with SunOS in the switch statements. > *** apacheds Thu Sep 7 14:39:26 2006 > --- apacheds.old Thu Sep 7 14:36:44 2006 > *************** > *** 11,20 **** > export DISPLAY > # Source function library. > - FUNCTIONS_EXIST=false > if [ -f /etc/init.d/functions ] ; then > . /etc/init.d/functions > - FUNCTIONS_EXIST=true > fi > # Source networking configuration. > --- 11,18 ---- > *************** > *** 150,156 **** > if [ `uname` = "Darwin" ] ; then > [ "$RETVAL" -eq 0 ] && echo successful apacheds server startup || \ > echo failed apacheds server start > ! elif [ `uname` = "SunOS" ] || ! $FUNCTIONS_EXIST; then > [ "$RETVAL" -eq 0 ] && echo success apacheds server startup || \ > echo failure apacheds server start > else > --- 148,154 ---- > if [ `uname` = "Darwin" ] ; then > [ "$RETVAL" -eq 0 ] && echo successful apacheds server startup || \ > echo failed apacheds server start > ! elif [ `uname` = "SunOS" ] ; then > [ "$RETVAL" -eq 0 ] && echo success apacheds server startup || \ > echo failure apacheds server start > else > *************** > *** 181,187 **** > if [ `uname` = "Darwin" ] ; then > [ "$RETVAL" -eq 0 ] && echo successful apacheds server shutdown || \ > echo failed apacheds server shutdown > ! elif [ `uname` = "SunOS" ] || ! $FUNCTIONS_EXIST; then > [ "$RETVAL" -eq 0 ] && echo success apacheds server shutdown || \ > echo failure apacheds server shutdown > else > --- 179,185 ---- > if [ `uname` = "Darwin" ] ; then > [ "$RETVAL" -eq 0 ] && echo successful apacheds server shutdown || \ > echo failed apacheds server shutdown > ! elif [ `uname` = "SunOS" ] ; then > [ "$RETVAL" -eq 0 ] && echo success apacheds server shutdown || \ > echo failure apacheds server shutdown > else > EOF -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.