You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2014/09/05 13:10:02 UTC

git commit: updated refs/heads/master to 0ec36e1

Repository: cloudstack
Updated Branches:
  refs/heads/master 5d389b1a7 -> 0ec36e128


Fix CLOUDSTACK-7476: always pass along $JAVA_HOME

On a secured environment (selinux w/ env_reset enabled in sudoers), the
runuser command that is invoked by the daemon() function does not pass
along environment variables, so $JAVA_HOME is empty, and JSVC falls
back to its default behavior, which may not find java or may not find
the intended java.

This fix simply passes $JAVA_HOME explicitly using the -home argument to
JSVC.

Signed-off-by: Rajani Karuturi <ra...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0ec36e12
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0ec36e12
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0ec36e12

Branch: refs/heads/master
Commit: 0ec36e128bb06704bfe4e9b115aaf4680ee61a43
Parents: 5d389b1
Author: Leo Simons <ls...@schubergphilis.com>
Authored: Wed Sep 3 09:32:32 2014 +0200
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Fri Sep 5 16:39:34 2014 +0530

----------------------------------------------------------------------
 packaging/centos63/cloud-usage.rc | 2 +-
 packaging/debian/init/cloud-usage | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ec36e12/packaging/centos63/cloud-usage.rc
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud-usage.rc b/packaging/centos63/cloud-usage.rc
index 8434e4d..ce44333 100755
--- a/packaging/centos63/cloud-usage.rc
+++ b/packaging/centos63/cloud-usage.rc
@@ -96,7 +96,7 @@ start() {
 
     echo -n "Starting $PROGNAME" "$SHORTNAME"
 
-    if daemon --pidfile $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -user "$USER" \
+    if daemon --pidfile $PIDFILE $DAEMON -home "$JAVA_HOME" -cp "$CLASSPATH" -pidfile "$PIDFILE" -user "$USER" \
       -errfile $LOGDIR/cloudstack-usage.err -outfile $LOGDIR/cloudstack-usage.out -Dpid=$$ $CLASS
         RETVAL=$?
     then

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ec36e12/packaging/debian/init/cloud-usage
----------------------------------------------------------------------
diff --git a/packaging/debian/init/cloud-usage b/packaging/debian/init/cloud-usage
index 06b1142..fcede4f 100755
--- a/packaging/debian/init/cloud-usage
+++ b/packaging/debian/init/cloud-usage
@@ -102,7 +102,7 @@ start() {
         exit 1
     fi
 
-    if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
+    if start_daemon -p $PIDFILE $DAEMON -home "$JAVA_HOME" -cp "$CLASSPATH" -pidfile "$PIDFILE" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
         RETVAL=$?
     then
         rc=0