cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.9-systemdubuntupkging to 397cbdb [Forced Update!]
Date Thu, 25 Aug 2016 13:22:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.9-systemdubuntupkging 15af3a8dc -> 397cbdbd8 (forced update)


CLOUDSTACK-9462: Refactor systemd scripts

Refactors and unifies usage of systemd script and default files across
CentOS and Ubuntu/Debian packaging system.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.9-systemdubuntupkging
Commit: 397cbdbd8bef5bba14e951438fb1dd4f80f6a4a1
Parents: 142772d
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Wed Aug 24 13:36:07 2016 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Aug 25 18:47:13 2016 +0530

----------------------------------------------------------------------
 debian/cloudstack-agent.postinst                |  6 +++
 debian/cloudstack-usage.postinst                |  6 +++
 debian/control                                  |  8 ++--
 debian/rules                                    | 20 +++-----
 packaging/centos7/cloud-management.service      | 40 ----------------
 packaging/centos7/cloud-management.sysconfig    | 49 --------------------
 packaging/centos7/cloud.spec                    | 22 +++++----
 packaging/debian/cloudstack-agent.default       | 21 ---------
 packaging/debian/cloudstack-agent.service       | 35 --------------
 packaging/debian/cloudstack-usage.default       | 21 ---------
 packaging/debian/cloudstack-usage.service       | 35 --------------
 packaging/systemd/cloudstack-agent.default      | 21 +++++++++
 packaging/systemd/cloudstack-agent.service      |  2 +-
 packaging/systemd/cloudstack-agent.sysconfig    | 21 ---------
 packaging/systemd/cloudstack-management.default | 49 ++++++++++++++++++++
 packaging/systemd/cloudstack-management.service | 40 ++++++++++++++++
 packaging/systemd/cloudstack-usage.default      | 22 +++++++++
 packaging/systemd/cloudstack-usage.service      |  2 +-
 packaging/systemd/cloudstack-usage.sysconfig    | 22 ---------
 19 files changed, 171 insertions(+), 271 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/debian/cloudstack-agent.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-agent.postinst b/debian/cloudstack-agent.postinst
index 9cb178d..48ab968 100644
--- a/debian/cloudstack-agent.postinst
+++ b/debian/cloudstack-agent.postinst
@@ -41,6 +41,12 @@ case "$1" in
             mkdir /etc/libvirt/hooks
         fi
         cp -a /usr/share/cloudstack-agent/lib/libvirtqemuhook /etc/libvirt/hooks/qemu
+
+        # Update JAVA_HOME in /etc/default/cloudstack-agent if only CentOS default has been
set
+        JAVA_HOME=$(update-alternatives --query java | grep ^Value | head -1 | sed 's/^Value:
//g' | sed 's/\/jre.*java//g')
+        if [ -d "$JAVA_HOME" ] && grep -Fqx "JAVA_HOME=/usr/lib/jvm/jre" /etc/default/cloudstack-agent;
then
+            sed -i "s:^JAVA_HOME=/usr/lib/jvm/jre:JAVA_HOME=${JAVA_HOME}:" /etc/default/cloudstack-agent
&& echo "JAVA_HOME has been set to $JAVA_HOME in /etc/default/cloudstack-agent"
+        fi
         ;;
 esac
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/debian/cloudstack-usage.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-usage.postinst b/debian/cloudstack-usage.postinst
index 9529711..6c35951 100644
--- a/debian/cloudstack-usage.postinst
+++ b/debian/cloudstack-usage.postinst
@@ -43,6 +43,12 @@ case "$1" in
             rm -rf /etc/cloudstack/usage/key
             ln -s /etc/cloudstack/management/key /etc/cloudstack/usage/key
         fi
+
+        # Update JAVA_HOME in /etc/default/cloudstack-usage if only CentOS default has been
set
+        JAVA_HOME=$(update-alternatives --query java | grep ^Value | head -1 | sed 's/^Value:
//g' | sed 's/\/jre.*java//g')
+        if [ -d "$JAVA_HOME" ] && grep -Fqx "JAVA_HOME=/usr/lib/jvm/jre" /etc/default/cloudstack-usage;
then
+            sed -i "s:^JAVA_HOME=/usr/lib/jvm/jre:JAVA_HOME=${JAVA_HOME}:" /etc/default/cloudstack-usage
&& echo "JAVA_HOME has been set to $JAVA_HOME in /etc/default/cloudstack-usage"
+        fi
         ;;
 esac
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index d7c7928..9855bed 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: cloudstack
 Section: libs
 Priority: extra
 Maintainer: Wido den Hollander <wido@widodh.nl>
-Build-Depends: debhelper (>= 9), openjdk-8-jdk | openjdk-7-jdk, genisoimage,
+Build-Depends: debhelper (>= 9), openjdk-8-jdk | java8-sdk | java8-jdk | openjdk-7-jdk,
genisoimage,
  python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, dh-systemd
 Standards-Version: 3.8.1
 Homepage: http://www.cloudstack.org/
@@ -22,7 +22,8 @@ Description: CloudStack server library
 
 Package: cloudstack-agent
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, ${jre:Depends}, cloudstack-common (= ${source:Version}),
lsb-base (>= 4.0), libcommons-daemon-java, openssh-client, qemu-kvm (>= 1.0), libvirt-bin
(>= 0.9.8), uuid-runtime, iproute, ebtables, vlan, ${init:Depends}, ipset, python-libvirt,
ethtool, iptables, lsb-release
+Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime
| openjdk-7-jre-headless, cloudstack-common (= ${source:Version}), lsb-base (>= 4.0), libcommons-daemon-java,
openssh-client, qemu-kvm (>= 1.0), libvirt-bin (>= 0.9.8), uuid-runtime, iproute, ebtables,
vlan, jsvc, ipset, python-libvirt, ethtool, iptables, lsb-release
+Recommends: init-system-helpers
 Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
 Description: CloudStack agent
  The CloudStack agent is in charge of managing shared computing resources in
@@ -31,7 +32,8 @@ Description: CloudStack agent
 
 Package: cloudstack-usage
 Architecture: all
-Depends: ${misc:Depends}, ${jre:Depends}, cloudstack-common (= ${source:Version}), jsvc,
libmysql-java
+Depends: openjdk-8-jre-headless | java8-runtime-headless | java8-runtime | openjdk-7-jre-headless,
cloudstack-common (= ${source:Version}), jsvc, libmysql-java
+Recommends: init-system-helpers
 Description: CloudStack usage monitor
  The CloudStack usage monitor provides usage accounting across the entire cloud for
  cloud operators to charge based on usage parameters.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index 32216ff..cfe7514 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,18 +5,9 @@ PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1)
 SYSCONFDIR = "/etc"
 DESTDIR = "debian/tmp"
 
-ifeq ($(shell lsb_release -sr), 14.04)
-        SUBSTVARS = -Vjre:Depends="openjdk-7-jre-headless" -Vjdk:Depends="openjdk-7-jdk"
-Vinit:"Depends:jsvc"
-else
-        SUBSTVARS = -Vjre:Depends="openjdk-8-jre-headless" -Vjdk:Depends="openjdk-8-jdk"
-Vinit:"Depends:systemd"
-endif
-
 %:
 	dh $@ --with python2,systemd
 
-override_dh_gencontrol:
-	dh_gencontrol -- $(SUBSTVARS)
-
 override_dh_auto_configure:
 	cp packaging/debian/replace.properties replace.properties.tmp
 	echo VERSION=${VERSION} >> replace.properties.tmp
@@ -54,8 +45,11 @@ override_dh_auto_install:
 
 	install -m0755 packaging/debian/$(PACKAGE)-agent.init $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-agent
 	install -d -m0755 debian/$(PACKAGE)-agent/lib/systemd/system
-	install -m0644 packaging/debian/$(PACKAGE)-agent.service debian/$(PACKAGE)-agent/lib/systemd/system/$(PACKAGE)-agent.service
-	install -m0644 packaging/debian/$(PACKAGE)-agent.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-agent
+	# Fix libvirt service name for Debian/Ubuntu
+	sed -i 's/Requires=libvirtd.service/Requires=libvirt-bin.service/g' packaging/systemd/$(PACKAGE)-agent.service
+	sed -i 's/After=libvirtd.service/After=libvirt-bin.service/g' packaging/systemd/$(PACKAGE)-agent.service
+	install -m0644 packaging/systemd/$(PACKAGE)-agent.service debian/$(PACKAGE)-agent/lib/systemd/system/$(PACKAGE)-agent.service
+	install -m0644 packaging/systemd/$(PACKAGE)-agent.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-agent
 
 	install -D agent/target/transformed/cloud-setup-agent $(DESTDIR)/usr/bin/cloudstack-setup-agent
 	install -D agent/target/transformed/cloud-ssh $(DESTDIR)/usr/bin/cloudstack-ssh
@@ -140,8 +134,8 @@ override_dh_auto_install:
 
 	install -D -m0755 packaging/debian/$(PACKAGE)-usage.init $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
 	install -d -m0755 debian/$(PACKAGE)-usage/lib/systemd/system
-	install -m0644 packaging/debian/$(PACKAGE)-usage.service debian/$(PACKAGE)-usage/lib/systemd/system/$(PACKAGE)-usage.service
-	install -m0644 packaging/debian/$(PACKAGE)-usage.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-usage
+	install -m0644 packaging/systemd/$(PACKAGE)-usage.service debian/$(PACKAGE)-usage/lib/systemd/system/$(PACKAGE)-usage.service
+	install -m0644 packaging/systemd/$(PACKAGE)-usage.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-usage
 
 	# cloudstack-marvin
 	mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-marvin

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/centos7/cloud-management.service
----------------------------------------------------------------------
diff --git a/packaging/centos7/cloud-management.service b/packaging/centos7/cloud-management.service
deleted file mode 100644
index db52dcf..0000000
--- a/packaging/centos7/cloud-management.service
+++ /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=simple
-EnvironmentFile=/etc/tomcat/tomcat.conf
-Environment="NAME=cloudstack-management"
-EnvironmentFile=-/etc/sysconfig/cloudstack-management
-ExecStart=/usr/libexec/tomcat/server start
-ExecStop=/usr/libexec/tomcat/server stop
-SuccessExitStatus=143
-User=cloud
-Group=cloud
-
-[Install]
-WantedBy=multi-user.target
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/centos7/cloud-management.sysconfig
----------------------------------------------------------------------
diff --git a/packaging/centos7/cloud-management.sysconfig b/packaging/centos7/cloud-management.sysconfig
deleted file mode 100644
index 6e5fcf9..0000000
--- a/packaging/centos7/cloud-management.sysconfig
+++ /dev/null
@@ -1,49 +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=/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/centos7/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 04315f8..3e5a660 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -210,7 +210,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}/management/temp
 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/%{name}/mnt
 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/%{name}/management
 mkdir -p ${RPM_BUILD_ROOT}%{_initrddir}
-mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
+mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/default
 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/profile.d
 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d
 
@@ -285,10 +285,10 @@ install python/bindir/cloud-external-ipallocator.py ${RPM_BUILD_ROOT}%{_bindir}/
 install -D client/target/pythonlibs/jasypt-1.9.2.jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-common/lib/jasypt-1.9.2.jar
 
 install -D packaging/centos7/cloud-ipallocator.rc ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-ipallocator
-install -D packaging/centos7/cloud-management.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-management
-install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
-install -D packaging/centos7/cloud-management.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-management.service
 install -D packaging/centos7/cloud.limits ${RPM_BUILD_ROOT}%{_sysconfdir}/security/limits.d/cloud
+install -D packaging/systemd/cloudstack-management.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-management.service
+install -D packaging/systemd/cloudstack-management.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-management
+install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
 touch ${RPM_BUILD_ROOT}%{_localstatedir}/run/%{name}-management.pid
 install -D server/target/conf/cloudstack-catalina.logrotate ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}-catalina
 
@@ -309,7 +309,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/agent
 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/plugins
 install -D packaging/systemd/cloudstack-agent.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-agent.service
-install -D packaging/systemd/cloudstack-agent.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-agent
+install -D packaging/systemd/cloudstack-agent.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-agent
 install -D agent/target/transformed/agent.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/agent.properties
 install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/environment.properties
 install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/log4j-cloud.xml
@@ -330,7 +330,7 @@ install -D usage/target/transformed/db.properties ${RPM_BUILD_ROOT}%{_sysconfdir
 install -D usage/target/transformed/log4j-cloud_usage.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage/log4j-cloud.xml
 cp usage/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-usage/lib/
 install -D packaging/systemd/cloudstack-usage.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-usage.service
-install -D packaging/systemd/cloudstack-usage.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-usage
+install -D packaging/systemd/cloudstack-usage.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-usage
 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/usage/
 
 # CLI
@@ -405,6 +405,10 @@ if [ ! -f %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util
     echo %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/
 fi
 
+if [ -f %{_sysconfdir}/sysconfig/%{name}-management ] ; then
+    mv %{_sysconfdir}/sysconfig/%{name}-management  %{_sysconfdir}/default/%{name}-management
+fi
+
 %preun agent
 /sbin/service cloudstack-agent stop || true
 if [ "$1" == "0" ] ; then
@@ -484,7 +488,7 @@ pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
 %dir %attr(0770,root,cloud) %{_localstatedir}/cache/%{name}/management/work
 %dir %attr(0770,root,cloud) %{_localstatedir}/cache/%{name}/management/temp
 %dir %attr(0770,root,cloud) %{_localstatedir}/log/%{name}/management
-%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-management
+%config(noreplace) %{_sysconfdir}/default/%{name}-management
 %config(noreplace) %{_sysconfdir}/sudoers.d/%{name}-management
 %config(noreplace) %{_sysconfdir}/security/limits.d/cloud
 %config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/db.properties
@@ -535,7 +539,7 @@ pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
 %attr(0755,root,root) %{_bindir}/%{name}-agent-upgrade
 %attr(0755,root,root) %{_bindir}/%{name}-ssh
 %attr(0644,root,root) %{_unitdir}/%{name}-agent.service
-%attr(0644,root,root) %{_sysconfdir}/sysconfig/%{name}-agent
+%attr(0644,root,root) %{_sysconfdir}/default/%{name}-agent
 %attr(0644,root,root) %{_sysconfdir}/profile.d/%{name}-agent-profile.sh
 %attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name}-agent
 %attr(0755,root,root) %{_datadir}/%{name}-common/scripts/network/cisco
@@ -562,7 +566,7 @@ pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
 
 %files usage
 %attr(0644,root,root) %{_unitdir}/%{name}-usage.service
-%attr(0644,root,root) %{_sysconfdir}/sysconfig/%{name}-usage
+%attr(0644,root,root) %{_sysconfdir}/default/%{name}-usage
 %attr(0644,root,root) %{_datadir}/%{name}-usage/*.jar
 %attr(0644,root,root) %{_datadir}/%{name}-usage/lib/*.jar
 %dir %attr(0770,root,cloud) %{_localstatedir}/log/%{name}/usage

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/debian/cloudstack-agent.default
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-agent.default b/packaging/debian/cloudstack-agent.default
deleted file mode 100644
index 16a0306..0000000
--- a/packaging/debian/cloudstack-agent.default
+++ /dev/null
@@ -1,21 +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.
-
-JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
-JAVA_HEAP_INITIAL=256m
-JAVA_HEAP_MAX=2048m
-JAVA_CLASS=com.cloud.agent.AgentShell

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/debian/cloudstack-agent.service
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-agent.service b/packaging/debian/cloudstack-agent.service
deleted file mode 100644
index d3080c7..0000000
--- a/packaging/debian/cloudstack-agent.service
+++ /dev/null
@@ -1,35 +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.
-
-[Unit]
-Description=CloudStack Agent
-Documentation=http://www.cloudstack.org/
-Requires=libvirt-bin.service
-After=libvirt-bin.service
-
-[Service]
-Type=simple
-EnvironmentFile=-/etc/default/cloudstack-agent
-ExecStart=/bin/sh -ec '\
-    export ACP=`ls /usr/share/cloudstack-agent/lib/*.jar /usr/share/cloudstack-agent/plugins/*.jar
2>/dev/null|tr "\\n" ":"`; \
-    export CLASSPATH="$ACP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"; \
-    ${JAVA_HOME}/bin/java -Xms${JAVA_HEAP_INITIAL} -Xmx${JAVA_HEAP_MAX} -cp "$CLASSPATH"
$JAVA_CLASS'
-Restart=always
-RestartSec=10s
-
-[Install]
-WantedBy=multi-user.target

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/debian/cloudstack-usage.default
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-usage.default b/packaging/debian/cloudstack-usage.default
deleted file mode 100644
index 1fa328c..0000000
--- a/packaging/debian/cloudstack-usage.default
+++ /dev/null
@@ -1,21 +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.
-
-JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
-JAVA_HEAP_INITIAL=256m
-JAVA_HEAP_MAX=2048m
-JAVA_CLASS=com.cloud.usage.UsageServer

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/debian/cloudstack-usage.service
----------------------------------------------------------------------
diff --git a/packaging/debian/cloudstack-usage.service b/packaging/debian/cloudstack-usage.service
deleted file mode 100644
index c36224e..0000000
--- a/packaging/debian/cloudstack-usage.service
+++ /dev/null
@@ -1,35 +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.
-
-[Unit]
-Description=CloudStack Usage Server
-Documentation=http://www.cloudstack.org/
-Wants=network.target network-online.target
-After=network.target network-online.target
-
-[Service]
-Type=simple
-EnvironmentFile=-/etc/default/cloudstack-usage
-ExecStart=/bin/sh -ec '\
-    export UCP=`ls /usr/share/cloudstack-usage/cloud-usage-*.jar /usr/share/cloudstack-usage/lib/*.jar
| tr "\\n" ":"`; \
-    export CLASSPATH="$UCP:/etc/cloudstack/usage:/usr/share/java/mysql-connector-java.jar";
\
-    ${JAVA_HOME}/bin/java -Xms${JAVA_HEAP_INITIAL} -Xmx${JAVA_HEAP_MAX} -cp "$CLASSPATH"
$JAVA_CLASS'
-Restart=always
-RestartSec=10s
-
-[Install]
-WantedBy=multi-user.target

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-agent.default
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-agent.default b/packaging/systemd/cloudstack-agent.default
new file mode 100644
index 0000000..9b4750f
--- /dev/null
+++ b/packaging/systemd/cloudstack-agent.default
@@ -0,0 +1,21 @@
+# 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.
+
+JAVA_HOME=/usr/lib/jvm/jre
+JAVA_HEAP_INITIAL=256m
+JAVA_HEAP_MAX=2048m
+JAVA_CLASS=com.cloud.agent.AgentShell

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-agent.service
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-agent.service b/packaging/systemd/cloudstack-agent.service
index 31d0246..4106e42 100644
--- a/packaging/systemd/cloudstack-agent.service
+++ b/packaging/systemd/cloudstack-agent.service
@@ -23,7 +23,7 @@ After=libvirtd.service
 
 [Service]
 Type=simple
-EnvironmentFile=-/etc/sysconfig/cloudstack-agent
+EnvironmentFile=-/etc/default/cloudstack-agent
 ExecStart=/bin/sh -ec '\
     export ACP=`ls /usr/share/cloudstack-agent/lib/*.jar /usr/share/cloudstack-agent/plugins/*.jar
2>/dev/null|tr "\\n" ":"`; \
     export CLASSPATH="$ACP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"; \

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-agent.sysconfig
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-agent.sysconfig b/packaging/systemd/cloudstack-agent.sysconfig
deleted file mode 100644
index 9b4750f..0000000
--- a/packaging/systemd/cloudstack-agent.sysconfig
+++ /dev/null
@@ -1,21 +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.
-
-JAVA_HOME=/usr/lib/jvm/jre
-JAVA_HEAP_INITIAL=256m
-JAVA_HEAP_MAX=2048m
-JAVA_CLASS=com.cloud.agent.AgentShell

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-management.default
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-management.default b/packaging/systemd/cloudstack-management.default
new file mode 100644
index 0000000..6e5fcf9
--- /dev/null
+++ b/packaging/systemd/cloudstack-management.default
@@ -0,0 +1,49 @@
+# 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=/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-management.service
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-management.service b/packaging/systemd/cloudstack-management.service
new file mode 100644
index 0000000..c1ede4b
--- /dev/null
+++ b/packaging/systemd/cloudstack-management.service
@@ -0,0 +1,40 @@
+# 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=simple
+EnvironmentFile=/etc/tomcat/tomcat.conf
+Environment="NAME=cloudstack-management"
+EnvironmentFile=-/etc/default/cloudstack-management
+ExecStart=/usr/libexec/tomcat/server start
+ExecStop=/usr/libexec/tomcat/server stop
+SuccessExitStatus=143
+User=cloud
+Group=cloud
+
+[Install]
+WantedBy=multi-user.target
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-usage.default
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-usage.default b/packaging/systemd/cloudstack-usage.default
new file mode 100644
index 0000000..dcf746a
--- /dev/null
+++ b/packaging/systemd/cloudstack-usage.default
@@ -0,0 +1,22 @@
+# 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.
+
+JAVA_HOME=/usr/lib/jvm/jre
+JAVA_HEAP_INITIAL=256m
+JAVA_HEAP_MAX=2048m
+JAVA_CLASS=com.cloud.usage.UsageServer
+JAVA_PID=$$

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-usage.service
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-usage.service b/packaging/systemd/cloudstack-usage.service
index a59f41d..8053034 100644
--- a/packaging/systemd/cloudstack-usage.service
+++ b/packaging/systemd/cloudstack-usage.service
@@ -23,7 +23,7 @@ After=network.target network-online.target
 
 [Service]
 Type=simple
-EnvironmentFile=-/etc/sysconfig/cloudstack-usage
+EnvironmentFile=-/etc/default/cloudstack-usage
 ExecStart=/bin/sh -ec '\
     export UCP=`ls /usr/share/cloudstack-usage/cloud-usage-*.jar /usr/share/cloudstack-usage/lib/*.jar
/usr/share/cloudstack-mysql-ha/lib/*.jar | tr "\\n" ":"`; \
     export CLASSPATH="$UCP:/etc/cloudstack/usage:/usr/share/java/mysql-connector-java.jar";
\

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/397cbdbd/packaging/systemd/cloudstack-usage.sysconfig
----------------------------------------------------------------------
diff --git a/packaging/systemd/cloudstack-usage.sysconfig b/packaging/systemd/cloudstack-usage.sysconfig
deleted file mode 100644
index dcf746a..0000000
--- a/packaging/systemd/cloudstack-usage.sysconfig
+++ /dev/null
@@ -1,22 +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.
-
-JAVA_HOME=/usr/lib/jvm/jre
-JAVA_HEAP_INITIAL=256m
-JAVA_HEAP_MAX=2048m
-JAVA_CLASS=com.cloud.usage.UsageServer
-JAVA_PID=$$


Mime
View raw message