Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9678C200CDD for ; Mon, 7 Aug 2017 16:45:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 94EA01656BA; Mon, 7 Aug 2017 14:45:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BB59E1656B8 for ; Mon, 7 Aug 2017 16:45:32 +0200 (CEST) Received: (qmail 96633 invoked by uid 500); 7 Aug 2017 14:45:31 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 96615 invoked by uid 99); 7 Aug 2017 14:45:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 14:45:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 825898118D; Mon, 7 Aug 2017 14:45:28 +0000 (UTC) Date: Mon, 07 Aug 2017 14:45:31 +0000 To: "commits@cloudstack.apache.org" Subject: [cloudstack] 03/03: packaging: refactor systemd scripts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: bhaisaab@apache.org Reply-To: "commits@cloudstack.apache.org" In-Reply-To: <150211712781.20397.9654985489599077991@gitbox.apache.org> References: <150211712781.20397.9654985489599077991@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cloudstack X-Git-Refname: refs/heads/CLOUDSTACK-10012 X-Git-Reftype: branch X-Git-Rev: 4f29cf1f3471779a558663587941651f337c885d X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20170807144529.825898118D@gitbox.apache.org> archived-at: Mon, 07 Aug 2017 14:45:33 -0000 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 AuthorDate: Mon Aug 7 16:43:52 2017 +0200 packaging: refactor systemd scripts Signed-off-by: Rohit Yadav --- 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" .