cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [2/6] git commit: updated refs/heads/master to 0a2798c
Date Wed, 02 Nov 2016 17:43:14 GMT
CLOUDSTACK-9551: Move java tmp dir to cloudstack-agent's path to avoid
noexec on /tmp


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

Branch: refs/heads/master
Commit: bd85e5b4da0be5177f7fd766641c75dabaf9c45d
Parents: 9a8841d
Author: Abhinandan Prateek <abhinandan.prateek@shapeblue.com>
Authored: Thu Oct 20 11:07:52 2016 +0530
Committer: Abhinandan Prateek <aprateek@apache.org>
Committed: Tue Oct 25 10:55:56 2016 +0530

----------------------------------------------------------------------
 packaging/centos63/cloud-agent.rc      | 6 +++++-
 packaging/debian/cloudstack-agent.init | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd85e5b4/packaging/centos63/cloud-agent.rc
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc
index 6cc6abc..aad9582 100755
--- a/packaging/centos63/cloud-agent.rc
+++ b/packaging/centos63/cloud-agent.rc
@@ -26,6 +26,7 @@
 
 # set environment variables
 
+TMP=/usr/share/cloudstack-agent/tmp
 SHORTNAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//')
 PIDFILE=/var/run/"$SHORTNAME".pid
 LOCKFILE=/var/lock/subsys/"$SHORTNAME"
@@ -41,6 +42,9 @@ if [ -z "$JSVC" ]; then
     exit 1;
 fi
 
+# create java tmp dir if not found
+mkdir -m 0755 -p "$TMP"
+
 unset OPTIONS
 [ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"
 
@@ -64,7 +68,7 @@ export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/a
 start() {
     echo -n $"Starting $PROGNAME: "
     if hostname --fqdn >/dev/null 2>&1 ; then
-        $JSVC -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
+        $JSVC -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE"
\
             -errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
         RETVAL=$?
         echo

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bd85e5b4/packaging/debian/cloudstack-agent.init
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-agent.init b/packaging/debian/cloudstack-agent.init
index a3f2ae9..0cae5f5 100755
--- a/packaging/debian/cloudstack-agent.init
+++ b/packaging/debian/cloudstack-agent.init
@@ -33,6 +33,7 @@
 
 . /lib/lsb/init-functions
 
+TMP=/usr/share/cloudstack-agent/tmp
 SHORTNAME="cloudstack-agent"
 PIDFILE=/var/run/"$SHORTNAME".pid
 LOCKFILE=/var/lock/subsys/"$SHORTNAME"
@@ -45,6 +46,9 @@ SHUTDOWN_WAIT="30"
 unset OPTIONS
 [ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME"
 
+# create java tmp dir if not found
+mkdir -m 0755 -p "$TMP"
+
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
 JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-oracle
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64
/usr/lib/jvm/java-6-sun"
 
@@ -96,7 +100,7 @@ start() {
 
     wait_for_network
 
-    if start_daemon -p $PIDFILE $DAEMON -Xms256m -Xmx2048m -cp "$CLASSPATH" -Djna.nosys=true
-pidfile "$PIDFILE" -errfile SYSLOG $CLASS
+    if start_daemon -p $PIDFILE $DAEMON -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH"
-Djna.nosys=true -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
         RETVAL=$?
     then
         rc=0


Mime
View raw message