Attila Sasvari created OOZIE-3151:
-------------------------------------
Summary: PID file does not end with a new line
Key: OOZIE-3151
URL: https://issues.apache.org/jira/browse/OOZIE-3151
Project: Oozie
Issue Type: Bug
Components: scripts
Affects Versions: 5.0.0b1
Reporter: Attila Sasvari
Priority: Minor
Currently Oozie PID file [does not end with a new
line|http://github.mtv.cloudera.com/CDH/oozie/blob/1c8553f7d3fb31bef132bff334054a6d4f2cf919/distro/src/main/bin/oozie-jetty-server.sh#L137].
As a result {{read pid < /var/run/oozie/oozie.pid}} would return 1. It is not
desirable in certain situations. For example:
[Bigtop|https://github.com/apache/bigtop/blob/7007c026540d099ee32ec194163b3e4115540366/bigtop-packages/src/common/oozie/oozie.init#L42]
tries to determine whether Oozie is running in the following way:
{code}
is_oozie_alive() {
if [ ! -f "$OOZIE_PID" ]; then
#not running
STATUS=3
elif read pid < "$OOZIE_PID" && ps -p "$pid" > /dev/null 2>&1; then
#running
STATUS=0
else
#pid file but not running
STATUS=1
fi
}
{code}
In this case, the Oozie init script by bigtop would consider Oozie dead and
remove the PID file leaving the actual process running.
[Reading file
content|http://github.mtv.cloudera.com/CDH/oozie/blob/1c8553f7d3fb31bef132bff334054a6d4f2cf919/distro/src/main/bin/oozie-jetty-server.sh#L95]
in oozie-jetty-server.sh (like
[catalina.sh|https://github.com/apache/tomcat/blob/6952814e58620719693311339bb81faa577958bb/bin/catalina.sh#L410]
in Tomcat) with {{PID=$(cat "$\{JETTY_PID_FILE}")}} is also suboptimal; there
is no need to start a new process.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)