cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Zotov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-5035) Init script exits with wrong code
Date Thu, 06 Dec 2012 14:31:09 GMT

    [ 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

Mime
View raw message