You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alexey Zotov (JIRA)" <ji...@apache.org> on 2012/12/06 12:48:59 UTC

[jira] [Created] (CASSANDRA-5035) Init script exits with wrong code

Alexey Zotov created CASSANDRA-5035:
---------------------------------------

             Summary: 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 0 code if service is 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