cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] 03/03: packaging: refactor systemd scripts
Date Mon, 07 Aug 2017 14:45:31 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch CLOUDSTACK-10012
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 4f29cf1f3471779a558663587941651f337c885d
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Mon Aug 7 16:43:52 2017 +0200

    packaging: refactor systemd scripts
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 debian/rules                                       |  4 +-
 packaging/systemd/cloudstack-management.default    | 10 ++---
 .../systemd/cloudstack-management.default.ubuntu   | 50 ----------------------
 packaging/systemd/cloudstack-management.service    | 15 +++----
 .../systemd/cloudstack-management.service.ubuntu   | 40 -----------------
 5 files changed, 14 insertions(+), 105 deletions(-)

diff --git a/debian/rules b/debian/rules
index 6fc10ad..b250650 100755
--- a/debian/rules
+++ b/debian/rules
@@ -99,8 +99,8 @@ override_dh_auto_install:
 	ln -s ../../../var/cache/$(PACKAGE)/management/work $(DESTDIR)/usr/share/$(PACKAGE)-management/work
 
 	install -d -m0755 debian/$(PACKAGE)-management/lib/systemd/system
-	install -m0644 packaging/systemd/$(PACKAGE)-management.service.ubuntu debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service
-	install -m0644 packaging/systemd/$(PACKAGE)-management.default.ubuntu $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management
+	install -m0644 packaging/systemd/$(PACKAGE)-management.service debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service
+	install -m0644 packaging/systemd/$(PACKAGE)-management.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management
 
 	# cloudstack-common
 	mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
diff --git a/packaging/systemd/cloudstack-management.default b/packaging/systemd/cloudstack-management.default
index 6e5fcf9..809cbde 100644
--- a/packaging/systemd/cloudstack-management.default
+++ b/packaging/systemd/cloudstack-management.default
@@ -27,14 +27,14 @@ CATALINA_HOME="/usr/share/cloudstack-management"
 JASPER_HOME="/usr/share/cloudstack-management"
 CATALINA_TMPDIR="/usr/share/cloudstack-management/temp"
 
-
+# Setup Java OPTS
 if [ -r "/etc/cloudstack/management/cloudmanagementserver.keystore" ] ; then
   JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false -Xmx2g -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M -XX:MaxPermSize=800m -Djavax.net.ssl.trustStore=/etc/cloudstack/management/cloudmanagementserver.keystore
-Djavax.net.ssl.trustStorePassword=vmops.com "
 else
   JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false -Xmx2g -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M -XX:MaxPermSize=800m"
 fi
 
-TOMCAT_USER="cloud"
+CLOUDSTACK_USER="cloud"
 
 SECURITY_MANAGER="false"
 
@@ -42,8 +42,8 @@ SHUTDOWN_WAIT="30"
 
 SHUTDOWN_VERBOSE="false"
 
-# Set the TOMCAT_PID location
-CATALINA_PID="/var/run/cloudstack-management.pid"
+CLOUDSTACK_PID="/var/run/cloudstack-management.pid"
 
-CLASSPATH=/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup
+CLASSPATH=/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup:/usr/share/cloudstack-management:/usr/share/cloudstack-management/bcprov-jdk15on-1.55.jar:/usr/share/cloudstack-management/cloud-management-server.jar
 
+BOOTSTRAP_CLASS=org.apache.cloudstack.ServerDaemon
diff --git a/packaging/systemd/cloudstack-management.default.ubuntu b/packaging/systemd/cloudstack-management.default.ubuntu
deleted file mode 100644
index 0087495..0000000
--- a/packaging/systemd/cloudstack-management.default.ubuntu
+++ /dev/null
@@ -1,50 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Required for a tocmat cloned service
-SERVICE_NAME=cloudstack-management
-
-# Where your java installation lives
-#JAVA_HOME="/usr/lib/jvm/java"
-
-# Where your cloudstack-management installation lives
-CATALINA_BASE="/usr/share/cloudstack-management"
-CATALINA_HOME="/usr/share/cloudstack-management"
-JASPER_HOME="/usr/share/cloudstack-management"
-CATALINA_TMPDIR="/usr/share/cloudstack-management/temp"
-
-
-if [ -r "/etc/cloudstack/management/cloudmanagementserver.keystore" ] ; then
-  JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false -Xmx2g -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M -XX:MaxPermSize=800m -Djavax.net.ssl.trustStore=/etc/cloudstack/management/cloudmanagementserver.keystore
-Djavax.net.ssl.trustStorePassword=vmops.com "
-else
-  JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false -Xmx2g -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=512M -XX:MaxPermSize=800m"
-fi
-
-TOMCAT_USER="cloud"
-
-SECURITY_MANAGER="false"
-
-SHUTDOWN_WAIT="30"
-
-SHUTDOWN_VERBOSE="false"
-
-# Set the TOMCAT_PID location
-CATALINA_PID="/var/run/cloudstack-management.pid"
-
-CLASSPATH=/usr/share/java/commons-daemon.jar:/usr/share/cloudstack-management/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar:/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup
-
-BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap
diff --git a/packaging/systemd/cloudstack-management.service b/packaging/systemd/cloudstack-management.service
index c1ede4b..091cff3 100644
--- a/packaging/systemd/cloudstack-management.service
+++ b/packaging/systemd/cloudstack-management.service
@@ -16,8 +16,6 @@
 # under the License.
 
 # Systemd unit file for CloudStack Management server
-# 
-# clone tomcat service, see /usr/lib/systemd/system/tomcat.service
 
 [Unit]
 Description=CloudStack Management Server
@@ -25,16 +23,17 @@ After=syslog.target network.target
 
 [Service]
 UMask=0022
-Type=simple
-EnvironmentFile=/etc/tomcat/tomcat.conf
+Type=forking
 Environment="NAME=cloudstack-management"
-EnvironmentFile=-/etc/default/cloudstack-management
-ExecStart=/usr/libexec/tomcat/server start
-ExecStop=/usr/libexec/tomcat/server stop
+EnvironmentFile=/etc/default/cloudstack-management
+ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JAVA_HOME=$( readlink -f $( which
java ) | sed s:bin/.*$:: )"
+ExecStart=/usr/bin/jsvc -user "${CLOUDSTACK_USER}" -cp "$CLASSPATH" \
+    -outfile SYSLOG -errfile SYSLOG \
+    -pidfile "${CLOUDSTACK_PID}" ${JAVA_OPTS} "${BOOTSTRAP_CLASS}"
+ExecStop=/usr/bin/jsvc -cp "$CLASSPATH" -pidfile "$CLOUDSTACK_PID" -stop "$BOOTSTRAP_CLASS"
 SuccessExitStatus=143
 User=cloud
 Group=cloud
 
 [Install]
 WantedBy=multi-user.target
-
diff --git a/packaging/systemd/cloudstack-management.service.ubuntu b/packaging/systemd/cloudstack-management.service.ubuntu
deleted file mode 100644
index 2fd7767..0000000
--- a/packaging/systemd/cloudstack-management.service.ubuntu
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Systemd unit file for CloudStack Management server
-#
-# clone tomcat service, see /usr/lib/systemd/system/tomcat.service
-
-[Unit]
-Description=CloudStack Management Server
-After=syslog.target network.target
-
-[Service]
-UMask=0022
-Type=forking
-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/.*$:: )"
-ExecStart=/usr/bin/jsvc -user "${TOMCAT_USER}" -cp "$CLASSPATH" \
-    -outfile SYSLOG -errfile SYSLOG \
-    -pidfile "${CATALINA_PID}" ${JAVA_OPTS} \
-    -Dcatalina.base="${CATALINA_BASE}" -Dcatalina.home="${CATALINA_HOME}" -Djava.io.tmpdir="${CATALINA_TMPDIR}"
"${BOOTSTRAP_CLASS}"
-ExecStop=/usr/bin/jsvc -cp "$CLASSPATH" -pidfile "$CATALINA_PID" \
-    -stop "$BOOTSTRAP_CLASS"
-
-[Install]
-WantedBy=multi-user.target

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.

Mime
View raw message