GeezerVison is showing github.com — CLOUDSTACK-9462: Build packages on Ubuntu 14.04/16.04 and support tom… · atrocitytheme/cloudstack@4a77a79
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .gitignore -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,6 @@ tools/cli/build/ | 51 | 51 | *.jar | 52 | 52 | *.war | 53 | 53 | *.mar | 54 | | -*.zip | 55 | 54 | *.iso | 56 | 55 | *.tar.gz | 57 | 56 | *.tgz | |
Collapse file Copy file name to clipboardExpand all lines: debian/cloudstack-management.install +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | /etc/cloudstack/management/ehcache.xml | 22 | 22 | /etc/cloudstack/management/server-ssl.xml | 23 | 23 | /etc/cloudstack/management/server-nonssl.xml | 24 | | -/etc/cloudstack/management/server.xml | | 24 | +/etc/cloudstack/management/server7-ssl.xml | | 25 | +/etc/cloudstack/management/server7-nonssl.xml | 25 | 26 | /etc/cloudstack/management/classpath.conf | 26 | 27 | /etc/cloudstack/management/db.properties | 27 | 28 | /etc/cloudstack/management/tomcat6-ssl.conf | | 33 | 34 | /etc/cloudstack/management/log4j-cloud.xml | 34 | 35 | /etc/cloudstack/management/tomcat-users.xml | 35 | 36 | /etc/cloudstack/management/context.xml | | 37 | +/etc/default/cloudstack-management | 36 | 38 | /etc/init.d/cloudstack-management | 37 | 39 | /etc/security/limits.d/cloudstack-limits.conf | 38 | 40 | /etc/sudoers.d/cloudstack | |
Collapse file Copy file name to clipboardExpand all lines: debian/cloudstack-management.postinst +20-1Lines changed: 20 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -60,7 +60,26 @@ if [ "$1" = configure ]; then | 60 | 60 |
| 61 | 61 | chmod 0640 ${CONFDIR}/${DBPROPS} | 62 | 62 | chgrp cloud ${CONFDIR}/${DBPROPS} | 63 | | - invoke-rc.d tomcat6 stop || true | | 63 | + | | 64 | + if [ -d "/usr/share/tomcat7" ]; then | | 65 | + rm -f /usr/share/cloudstack-management/bin | | 66 | + rm -f /usr/share/cloudstack-management/lib | | 67 | + ln -s /usr/share/tomcat7/bin /usr/share/cloudstack-management/bin | | 68 | + ln -s /usr/share/tomcat7/lib /usr/share/cloudstack-management/lib | | 69 | + invoke-rc.d tomcat7 stop || true | | 70 | + if [ ! -f "/etc/cloudstack/management/server.xml" ]; then | | 71 | + ln -s /etc/cloudstack/management/server7-nonssl.xml /etc/cloudstack/management/server.xml | | 72 | + fi | | 73 | + elif [ -d "/usr/share/tomcat6" ]; then | | 74 | + rm -f /usr/share/cloudstack-management/bin | | 75 | + rm -f /usr/share/cloudstack-management/lib | | 76 | + ln -s /usr/share/tomcat6/bin /usr/share/cloudstack-management/bin | | 77 | + ln -s /usr/share/tomcat6/lib /usr/share/cloudstack-management/lib | | 78 | + invoke-rc.d tomcat6 stop || true | | 79 | + if [ ! -f "/etc/cloudstack/management/server.xml" ]; then | | 80 | + ln -s /etc/cloudstack/management/server-nonssl.xml /etc/cloudstack/management/server.xml | | 81 | + fi | | 82 | + fi | 64 | 83 |
| 65 | 84 | # Add jdbc MySQL driver settings to db.properties if not present | 66 | 85 | grep -s -q "db.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} | |
Collapse file Copy file name to clipboardExpand all lines: debian/control +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ Section: libs | 3 | 3 | Priority: extra | 4 | 4 | | 5 | 5 | Build-Depends: debhelper (>= 9), openjdk-8-jdk | java8-sdk | java8-jdk, genisoimage, | 6 | | - python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, dh-systemd | | 6 | + python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, dh-systemd, python-setuptools | 7 | 7 | Standards-Version: 3.8.1 | 8 | 8 | Homepage: http://www.cloudstack.org/ | 9 | 9 |
| @@ -15,15 +15,14 @@ Description: A common package which contains files which are shared by several C | 15 | 15 |
| 16 | 16 | Package: cloudstack-management | 17 | 17 | Architecture: all | 18 | | -Depends: ${misc:Depends}, ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release | | 18 | +Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime | openjdk-7-jre-headless, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release, init-system-helpers (>= 1.14~) | 19 | 19 | Conflicts: cloud-server, cloud-client, cloud-client-ui | 20 | 20 | Description: CloudStack server library | 21 | 21 | The CloudStack management server | 22 | 22 |
| 23 | 23 | Package: cloudstack-agent | 24 | 24 | Architecture: all | 25 | | -Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, 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 | 26 | | -Recommends: init-system-helpers | | 25 | +Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, 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, init-system-helpers (>= 1.14~) | 27 | 26 | Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts | 28 | 27 | Description: CloudStack agent | 29 | 28 | The CloudStack agent is in charge of managing shared computing resources in | @@ -32,8 +31,7 @@ Description: CloudStack agent | 32 | 31 |
| 33 | 32 | Package: cloudstack-usage | 34 | 33 | Architecture: all | 35 | | -Depends: openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), jsvc, libmysql-java | 36 | | -Recommends: init-system-helpers | | 34 | +Depends: openjdk-8-jre-headless | java8-runtime-headless | java8-runtime, cloudstack-common (= ${source:Version}), jsvc, libmysql-java, init-system-helpers (>= 1.14~) | 37 | 35 | Description: CloudStack usage monitor | 38 | 36 | The CloudStack usage monitor provides usage accounting across the entire cloud for | 39 | 37 | cloud operators to charge based on usage parameters. | |
Collapse file Copy file name to clipboardExpand all lines: debian/rules +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -85,19 +85,20 @@ override_dh_auto_install: | 85 | 85 | chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE) | 86 | 86 |
| 87 | 87 | ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf | 88 | | - ln -s server-nonssl.xml $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/server.xml | 89 | 88 | install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management | 90 | 89 | install -D client/target/utilities/bin/cloud-update-xenserver-licenses $(DESTDIR)/usr/bin/cloudstack-update-xenserver-licenses | 91 | | - ln -s /usr/share/tomcat6/bin $(DESTDIR)/usr/share/$(PACKAGE)-management/bin | 92 | 90 | # Remove configuration in /ur/share/cloudstack-management/webapps/client/WEB-INF | 93 | 91 | # This should all be in /etc/cloudstack/management | 94 | 92 | rm $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/WEB-INF/classes/*.* | 95 | 93 | ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/conf | 96 | | - ln -s ../../../usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib | 97 | 94 | ln -s ../../../var/log/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/logs | 98 | 95 | ln -s ../../../var/cache/$(PACKAGE)/management/temp $(DESTDIR)/usr/share/$(PACKAGE)-management/temp | 99 | 96 | ln -s ../../../var/cache/$(PACKAGE)/management/work $(DESTDIR)/usr/share/$(PACKAGE)-management/work | 100 | 97 |
| | 98 | + install -d -m0755 debian/$(PACKAGE)-management/lib/systemd/system | | 99 | + install -m0644 packaging/systemd/$(PACKAGE)-management.service.ubuntu debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service | | 100 | + install -m0644 packaging/systemd/$(PACKAGE)-management.default.ubuntu $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management | | 101 | + | 101 | 102 | # cloudstack-common | 102 | 103 | mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common | 103 | 104 | mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts | @@ -149,7 +150,7 @@ override_dh_installinit: | 149 | 150 | dh_installinit -pcloudstack-management -pcloudstack-agent -pcloudstack-usage --onlyscripts --no-start | 150 | 151 |
| 151 | 152 | override_dh_systemd_enable: | 152 | | - dh_systemd_enable -pcloudstack-agent -pcloudstack-usage | | 153 | + dh_systemd_enable -pcloudstack-management -pcloudstack-agent -pcloudstack-usage | 153 | 154 |
| 154 | 155 | override_dh_installdocs: | 155 | 156 | dh_installdocs -A tools/whisker/LICENSE tools/whisker/NOTICE INSTALL.md |
Collapse file Copy file name to clipboardExpand all lines: packaging/build-deb.sh +14-4Lines changed: 14 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | # specific language governing permissions and limitations | 17 | 17 | # under the License. | 18 | 18 |
| 19 | | -set -e | | 19 | +#set -e | 20 | 20 |
| 21 | 21 | # | 22 | 22 | # This script builds Debian packages for CloudStack and does | @@ -43,11 +43,21 @@ set -e | 43 | 43 | cd `dirname $0` | 44 | 44 | cd .. | 45 | 45 |
| 46 | | -dpkg-checkbuilddeps | | 46 | +DCH=$(which dch) | | 47 | +if [ -z "$DCH" ] ; then | | 48 | + echo -e "dch not found, please install devscripts at first. \nDEB Build Failed" | | 49 | + exit | | 50 | +fi | 47 | 51 |
| 48 | | -VERSION=$(grep '^ <version>' pom.xml| cut -d'>' -f2 |cut -d'<' -f1) | | 52 | +VERSION=$(head -n1 debian/changelog |awk -F [\(\)] '{print $2}') | 49 | 53 | DISTCODE=$(lsb_release -sc) | 50 | 54 |
| | 55 | +/bin/cp debian/changelog /tmp/changelog.orig | | 56 | + | 51 | 57 | dch -b -v "${VERSION}~${DISTCODE}" -u low -m "Apache CloudStack Release ${VERSION}" | | 58 | +sed -i '0,/ UNRELEASED;/s// unstable;/g' debian/changelog | | 59 | + | | 60 | +dpkg-checkbuilddeps | | 61 | +dpkg-buildpackage -uc -us | 52 | 62 |
| 53 | | -dpkg-buildpackage -j2 -b -uc -us | | 63 | +/bin/mv /tmp/changelog.orig debian/changelog |
Collapse file Copy file name to clipboard +50Lines changed: 50 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# Licensed to the Apache Software Foundation (ASF) under one | | 2 | +# or more contributor license agreements. See the NOTICE file | | 3 | +# distributed with this work for additional information | | 4 | +# regarding copyright ownership. The ASF licenses this file | | 5 | +# to you under the Apache License, Version 2.0 (the | | 6 | +# "License"); you may not use this file except in compliance | | 7 | +# with the License. You may obtain a copy of the License at | | 8 | +# | | 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | | 10 | +# | | 11 | +# Unless required by applicable law or agreed to in writing, | | 12 | +# software distributed under the License is distributed on an | | 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | | 14 | +# KIND, either express or implied. See the License for the | | 15 | +# specific language governing permissions and limitations | | 16 | +# under the License. | | 17 | + | | 18 | +# Required for a tocmat cloned service | | 19 | +SERVICE_NAME=cloudstack-management | | 20 | + | | 21 | +# Where your java installation lives | | 22 | +#JAVA_HOME="/usr/lib/jvm/java" | | 23 | + | | 24 | +# Where your cloudstack-management installation lives | | 25 | +CATALINA_BASE="/usr/share/cloudstack-management" | | 26 | +CATALINA_HOME="/usr/share/cloudstack-management" | | 27 | +JASPER_HOME="/usr/share/cloudstack-management" | | 28 | +CATALINA_TMPDIR="/usr/share/cloudstack-management/temp" | | 29 | + | | 30 | + | | 31 | +if [ -r "/etc/cloudstack/management/cloudmanagementserver.keystore" ] ; then | | 32 | + 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 " | | 33 | +else | | 34 | + 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" | | 35 | +fi | | 36 | + | | 37 | +TOMCAT_USER="cloud" | | 38 | + | | 39 | +SECURITY_MANAGER="false" | | 40 | + | | 41 | +SHUTDOWN_WAIT="30" | | 42 | + | | 43 | +SHUTDOWN_VERBOSE="false" | | 44 | + | | 45 | +# Set the TOMCAT_PID location | | 46 | +CATALINA_PID="/var/run/cloudstack-management.pid" | | 47 | + | | 48 | +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 | | 49 | + | | 50 | +BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap |
Collapse file Copy file name to clipboard +40Lines changed: 40 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# Licensed to the Apache Software Foundation (ASF) under one | | 2 | +# or more contributor license agreements. See the NOTICE file | | 3 | +# distributed with this work for additional information | | 4 | +# regarding copyright ownership. The ASF licenses this file | | 5 | +# to you under the Apache License, Version 2.0 (the | | 6 | +# "License"); you may not use this file except in compliance | | 7 | +# with the License. You may obtain a copy of the License at | | 8 | +# | | 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | | 10 | +# | | 11 | +# Unless required by applicable law or agreed to in writing, | | 12 | +# software distributed under the License is distributed on an | | 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | | 14 | +# KIND, either express or implied. See the License for the | | 15 | +# specific language governing permissions and limitations | | 16 | +# under the License. | | 17 | + | | 18 | +# Systemd unit file for CloudStack Management server | | 19 | +# | | 20 | +# clone tomcat service, see /usr/lib/systemd/system/tomcat.service | | 21 | + | | 22 | +[Unit] | | 23 | +Description=CloudStack Management Server | | 24 | +After=syslog.target network.target | | 25 | + | | 26 | +[Service] | | 27 | +UMask=0022 | | 28 | +Type=forking | | 29 | +Environment="NAME=cloudstack-management" | | 30 | +EnvironmentFile=-/etc/default/cloudstack-management | | 31 | +ExecStartPre=/bin/bash -c "/bin/systemctl set-environment JAVA_HOME=$( readlink -f $( which java ) | sed s:bin/.*$:: )" | | 32 | +ExecStart=/usr/bin/jsvc -user "${TOMCAT_USER}" -cp "$CLASSPATH" \ | | 33 | + -outfile SYSLOG -errfile SYSLOG \ | | 34 | + -pidfile "${CATALINA_PID}" ${JAVA_OPTS} \ | | 35 | + -Dcatalina.base="${CATALINA_BASE}" -Dcatalina.home="${CATALINA_HOME}" -Djava.io.tmpdir="${CATALINA_TMPDIR}" "${BOOTSTRAP_CLASS}" | | 36 | +ExecStop=/usr/bin/jsvc -cp "$CLASSPATH" -pidfile "$CATALINA_PID" \ | | 37 | + -stop "$BOOTSTRAP_CLASS" | | 38 | + | | 39 | +[Install] | | 40 | +WantedBy=multi-user.target |
Collapse file Copy file name to clipboardExpand all lines: python/lib/cloudutils/serviceConfigServer.py +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -89,6 +89,10 @@ def checkHostName(): | 89 | 89 | if os.path.exists("/etc/cloudstack/management/server.xml"): | 90 | 90 | bash("rm -f /etc/cloudstack/management/server.xml") | 91 | 91 | bash("ln -s /etc/cloudstack/management/server7-ssl.xml /etc/cloudstack/management/server.xml") | | 92 | + bash("rm -f /usr/share/cloudstack-management/bin") | | 93 | + bash("rm -f /usr/share/cloudstack-management/lib") | | 94 | + bash("ln -s /usr/share/tomcat7/bin /usr/share/cloudstack-management/bin") | | 95 | + bash("ln -s /usr/share/tomcat7/lib /usr/share/cloudstack-management/lib") | 92 | 96 | else: | 93 | 97 | if not os.path.exists("/etc/cloudstack/management/server-ssl.xml") or not os.path.exists("/etc/cloudstack/management/tomcat6-ssl.conf"): | 94 | 98 | raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-ssl.xml or /etc/cloudstack/management/tomcat6-ssl.conf, https enable failed") | @@ -98,6 +102,10 @@ def checkHostName(): | 98 | 102 | bash("rm -f /etc/cloudstack/management/tomcat6.conf") | 99 | 103 | bash("ln -s /etc/cloudstack/management/server-ssl.xml /etc/cloudstack/management/server.xml") | 100 | 104 | bash("ln -s /etc/cloudstack/management/tomcat6-ssl.conf /etc/cloudstack/management/tomcat6.conf") | | 105 | + bash("rm -f /usr/share/cloudstack-management/bin") | | 106 | + bash("rm -f /usr/share/cloudstack-management/lib") | | 107 | + bash("ln -s /usr/share/tomcat6/bin /usr/share/cloudstack-management/bin") | | 108 | + bash("ln -s /usr/share/tomcat6/lib /usr/share/cloudstack-management/lib") | 101 | 109 | if not bash("iptables-save |grep PREROUTING | grep 6443").isSuccess(): | 102 | 110 | bash("iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 6443") | 103 | 111 | else: | @@ -107,6 +115,10 @@ def checkHostName(): | 107 | 115 | if os.path.exists("/etc/cloudstack/management/server.xml"): | 108 | 116 | bash("rm -f /etc/cloudstack/management/server.xml") | 109 | 117 | bash("ln -s /etc/cloudstack/management/server7-nonssl.xml /etc/cloudstack/management/server.xml") | | 118 | + bash("rm -f /usr/share/cloudstack-management/bin") | | 119 | + bash("rm -f /usr/share/cloudstack-management/lib") | | 120 | + bash("ln -s /usr/share/tomcat7/bin /usr/share/cloudstack-management/bin") | | 121 | + bash("ln -s /usr/share/tomcat7/lib /usr/share/cloudstack-management/lib") | 110 | 122 | else: | 111 | 123 | if not os.path.exists("/etc/cloudstack/management/server-nonssl.xml") or not os.path.exists("/etc/cloudstack/management/tomcat6-nonssl.conf"): | 112 | 124 | raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-nonssl.xml or /etc/cloudstack/management/tomcat6-nonssl.conf, https enable failed") | @@ -116,6 +128,10 @@ def checkHostName(): | 116 | 128 | bash("rm -f /etc/cloudstack/management/tomcat6.conf") | 117 | 129 | bash("ln -s /etc/cloudstack/management/server-nonssl.xml /etc/cloudstack/management/server.xml") | 118 | 130 | bash("ln -s /etc/cloudstack/management/tomcat6-nonssl.conf /etc/cloudstack/management/tomcat6.conf") | | 131 | + bash("rm -f /usr/share/cloudstack-management/bin") | | 132 | + bash("rm -f /usr/share/cloudstack-management/lib") | | 133 | + bash("ln -s /usr/share/tomcat6/bin /usr/share/cloudstack-management/bin") | | 134 | + bash("ln -s /usr/share/tomcat6/lib /usr/share/cloudstack-management/lib") | 119 | 135 | bash("touch /var/run/cloudstack-management.pid") | 120 | 136 | bash("chown cloud.cloud /var/run/cloudstack-management.pid") | 121 | 137 | #distro like sl 6.1 needs this folder, or tomcat6 failed to start | |
|