Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0C00EF9F for ; Thu, 6 Dec 2012 14:31:11 +0000 (UTC) Received: (qmail 16472 invoked by uid 500); 6 Dec 2012 14:31:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 15888 invoked by uid 500); 6 Dec 2012 14:31:10 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 15554 invoked by uid 99); 6 Dec 2012 14:31:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 14:31:10 +0000 Date: Thu, 6 Dec 2012 14:31:09 +0000 (UTC) From: "Alexey Zotov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-5035) Init script exits with wrong code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13511414#comment-13511414 ] Alexey Zotov commented on CASSANDRA-5035: ----------------------------------------- Thanks! > Init script exits with wrong code > --------------------------------- > > Key: CASSANDRA-5035 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5035 > Project: Cassandra > Issue Type: Bug > Components: Packaging > Affects Versions: 1.1.6 > Environment: Centos 6.2, Cassandra 1.1.6 (DataStax distribution) > Reporter: Alexey Zotov > Priority: Minor > > According to LSB specification (http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html) 'status' command should return 3 code if service is not running. > How it works now?: > {code} > [root@node azotov]# /sbin/service cassandra status ; echo $? > cassandra (pid 2924) is running... > 0 > [root@node azotov]# /sbin/service cassandra stop > Shutdown Cassandra: OK > [root@node azotov]# /sbin/service cassandra status ; echo $? > cassandra is stopped > 0 > {code} > I suggest to add the following line to the init script: > {code} > status) > status -p $pid_file cassandra > + exit $? > ;; > *) > {code} > What we will have?: > {code} > [root@node azotov]# /sbin/service cassandra status ; echo $? > cassandra (pid 2924) is running... > 0 > [root@node azotov]# /sbin/service cassandra stop > Shutdown Cassandra: OK > [root@node azotov]# /sbin/service cassandra status ; echo $? > cassandra is stopped > 3 > {code} > Note: > I've found this bug during puppet scripts writing. It affects 'service' definition. As a workaround I used 'hasstatus => false,' option. Hope this will help someone. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira