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 2018/04/06 10:17:22 UTC

[cloudstack] branch master updated: Create an easy way to enable the Java remote Debug for ACS (#2535)

This is an automated email from the ASF dual-hosted git repository.

rafael pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new e198ff2  Create an easy way to enable the Java remote Debug for ACS (#2535)
e198ff2 is described below

commit e198ff21b380f7813772bfd7446385eec883aa03
Author: Rafael Weingärtner <ra...@gmail.com>
AuthorDate: Fri Apr 6 07:17:17 2018 -0300

    Create an easy way to enable the Java remote Debug for ACS (#2535)
    
    The idea is to create a property in /etc/defaults/cloudstack-management that can be enabled/disabled (uncommented/commented) to control the enabling of Java remote debug in CloudStack's JVM.
---
 packaging/systemd/cloudstack-management.default | 4 ++++
 packaging/systemd/cloudstack-management.service | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/packaging/systemd/cloudstack-management.default b/packaging/systemd/cloudstack-management.default
index fbdb256..05f4a50 100644
--- a/packaging/systemd/cloudstack-management.default
+++ b/packaging/systemd/cloudstack-management.default
@@ -33,3 +33,7 @@ LOGDIR="/var/log/cloudstack/management"
 CLASSPATH="/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup:/usr/share/cloudstack-management:/usr/share/java/mysql-connector-java.jar:/usr/share/java/commons-daemon.jar"
 
 BOOTSTRAP_CLASS=org.apache.cloudstack.ServerDaemon
+
+#You can uncomment this if you want to enable Java remote debugging.
+#You can change the parameters at your will. The 'address' field defines the port to be used. 
+#JAVA_DEBUG="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
\ No newline at end of file
diff --git a/packaging/systemd/cloudstack-management.service b/packaging/systemd/cloudstack-management.service
index afcea8c..28eedef 100644
--- a/packaging/systemd/cloudstack-management.service
+++ b/packaging/systemd/cloudstack-management.service
@@ -28,7 +28,7 @@ Environment="NAME=cloudstack-management"
 EnvironmentFile=/etc/default/cloudstack-management
 ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JAVA_HOME=$( readlink -f $( which java ) | sed s:bin/.*$:: )"
 ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JARS=$(ls /usr/share/cloudstack-management/lib/*.jar | tr '\n' ':' | sed s'/.$//')"
-ExecStart=/usr/bin/jsvc -home "${JAVA_HOME}" -user "${CLOUDSTACK_USER}" -cp "${JARS}:${CLASSPATH}" -errfile ${LOGDIR}/${NAME}.err -cwd ${LOGDIR} -pidfile "${CLOUDSTACK_PID}" ${JAVA_OPTS} "${BOOTSTRAP_CLASS}"
+ExecStart=/usr/bin/jsvc $JAVA_DEBUG -home "${JAVA_HOME}" -user "${CLOUDSTACK_USER}" -cp "${JARS}:${CLASSPATH}" -errfile ${LOGDIR}/${NAME}.err -cwd ${LOGDIR} -pidfile "${CLOUDSTACK_PID}" ${JAVA_OPTS} "${BOOTSTRAP_CLASS}"
 ExecStop=/usr/bin/jsvc -cp "$JARS:$CLASSPATH" -pidfile "$CLOUDSTACK_PID" -stop "$BOOTSTRAP_CLASS"
 SuccessExitStatus=143
 

-- 
To stop receiving notification emails like this one, please contact
rafael@apache.org.