Updated Branches: refs/heads/master c522543f2 -> 06c13330f
BIGTOP-988. HCatalog does not launch daemon process in a known directory. Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/67e0e85e Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/67e0e85e Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/67e0e85e Branch: refs/heads/master Commit: 67e0e85ecb8b32c67f86d5f8b28ce76487ceb607 Parents: c522543 Author: Sean Mackrory <[email protected]> Authored: Mon May 13 17:44:55 2013 -0700 Committer: Roman Shaposhnik <[email protected]> Committed: Tue May 28 14:09:33 2013 -0700 ---------------------------------------------------------------------- .../src/common/hcatalog/hcatalog-server.svc | 1 + .../src/common/hcatalog/webhcat-server.svc | 1 + bigtop-packages/src/templates/init.d.tmpl | 3 ++- 3 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/67e0e85e/bigtop-packages/src/common/hcatalog/hcatalog-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/hcatalog-server.svc b/bigtop-packages/src/common/hcatalog/hcatalog-server.svc index cd6d2b7..2b67904 100644 --- a/bigtop-packages/src/common/hcatalog/hcatalog-server.svc +++ b/bigtop-packages/src/common/hcatalog/hcatalog-server.svc @@ -20,3 +20,4 @@ DAEMON_FLAGS="" CONF_DIR="/etc/hcatalog/conf" # FIXME: HCATALOG-636 PIDFILE="/var/run/hcatalog/hcat.pid" +WORKING_DIR="/var/run/hcatalog" http://git-wip-us.apache.org/repos/asf/bigtop/blob/67e0e85e/bigtop-packages/src/common/hcatalog/webhcat-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/webhcat-server.svc b/bigtop-packages/src/common/hcatalog/webhcat-server.svc index aff2a4d..6e54c55 100644 --- a/bigtop-packages/src/common/hcatalog/webhcat-server.svc +++ b/bigtop-packages/src/common/hcatalog/webhcat-server.svc @@ -20,3 +20,4 @@ DAEMON_FLAGS="" CONF_DIR="/etc/webhcat/conf" # FIXME: HCATALOG-636 PIDFILE="/var/run/hcatalog/webhcat.pid" +WORKING_DIR="/var/run/hcatalog" http://git-wip-us.apache.org/repos/asf/bigtop/blob/67e0e85e/bigtop-packages/src/templates/init.d.tmpl ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/templates/init.d.tmpl b/bigtop-packages/src/templates/init.d.tmpl index 4801326..037b3ed 100644 --- a/bigtop-packages/src/templates/init.d.tmpl +++ b/bigtop-packages/src/templates/init.d.tmpl @@ -83,7 +83,7 @@ start() { [ -d $CONF_DIR ] || exit $ERROR_PROGRAM_NOT_CONFIGURED log_success_msg "Starting ${DESC}: " - su -s /bin/bash $SVC_USER -c "$EXEC_PATH --config '$CONF_DIR' start $DAEMON_FLAGS" + su -s /bin/bash $SVC_USER -c "cd $WORKING_DIR && $EXEC_PATH --config '$CONF_DIR' start $DAEMON_FLAGS" # Some processes are slow to start sleep $SLEEP_TIME @@ -218,6 +218,7 @@ CONF_DIR="$CONF_DIR" PIDFILE="$PIDFILE" LOCKDIR="/var/lock/subsys" LOCKFILE="\$LOCKDIR/$DAEMON" +WORKING_DIR="${WORKING_DIR:-~/}" install -d -m 0755 -o $SVC_USER -g $SVC_USER $(dirname $PIDFILE) 1>/dev/null 2>&1 || : [ -d "\$LOCKDIR" ] || install -d -m 0755 \$LOCKDIR 1>/dev/null 2>&1 || :
