[
https://issues.apache.org/jira/browse/BIGTOP-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557654#comment-13557654
]
Mark Grover commented on BIGTOP-829:
------------------------------------
Roman, thanks for the feedback.
The reason I used the {{pidofproc}} (from patch1 of BIGTOP-782) instead of
{{kill -0}} approach (from patch 2) was because pidofproc's exit code is one of
the LSB defined exit status codes for "status".
Consequently, the exit code for {{pidofproc}} can be:
{code}
0 program is running or service is OK
1 program is dead and /var/run pid file exists
2 program is dead and /var/lock lock file exists
3 program is not running
4 program or service status is unknown
5-99 reserved for future LSB use
100-149 reserved for distribution use
150-199 reserved for application use
200-254 reserved
{code}
If we use {{kill -0}} for status, I wasn't able to find concrete documentation
as to what the exit code would be. The best I could find was "0" if process is
running and "1" if it wasn't. So, the non-success error codes wouldn't have
been compatible with pidofproc.
Moreover, other components (I looked at common/flume/flume-agent.init) seem to
doing similar things, using {{kill}} commands for stopping but {{pidofproc}}
for status.
For stopping the process, {{kill}} commands are ok because we explicitly return
0 but to me it seemed like we should continue to use {{pidofproc}} for status.
What do you think?
References:
http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
> Hue status returned wrong information on SLES
> ---------------------------------------------
>
> Key: BIGTOP-829
> URL: https://issues.apache.org/jira/browse/BIGTOP-829
> Project: Bigtop
> Issue Type: Bug
> Components: RPM
> Affects Versions: 0.5.0
> Reporter: Mark Grover
> Assignee: Mark Grover
> Fix For: 0.6.0
>
> Attachments: BIGTOP-829.1.patch
>
>
> BIGTOP-782 fixed the stop functionality for hue on SLES. We still need to fix
> the status functionality for SLES.
> Presently, the wrong status is reported.
--
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