Updated Branches:
  refs/heads/4.1 9cf20ae38 -> 9d1649c76

debian: Various packaging fixes from master

This commit includes various packaging fixes already in master.


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

Branch: refs/heads/4.1
Commit: 11892d34d7ec0e37e3b5cf568a2a30d4be23590f
Parents: 9cf20ae
Author: Wido den Hollander <[email protected]>
Authored: Sun Mar 31 15:31:15 2013 +0200
Committer: Wido den Hollander <[email protected]>
Committed: Sun Mar 31 15:31:15 2013 +0200

----------------------------------------------------------------------
 debian/cloudstack-agent.postinst       |   40 +++++++++++++++++++++++++++
 debian/cloudstack-common.install       |    1 +
 debian/cloudstack-management.install   |    7 +++--
 debian/cloudstack-management.postinst  |   16 ++++++++++-
 debian/cloudstack-usage.postinst       |   37 +++++++++++++++++++++++++
 debian/rules                           |   17 +++++++++---
 packaging/debian/init/cloud-management |    8 +++---
 packaging/debian/replace.properties    |    2 +-
 server/conf/cloudstack-limits.conf.in  |   21 ++++++++++++++
 server/conf/cloudstack-sudoers.in      |   22 +++++++++++++++
 10 files changed, 158 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/cloudstack-agent.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-agent.postinst b/debian/cloudstack-agent.postinst
new file mode 100644
index 0000000..499ae6a
--- /dev/null
+++ b/debian/cloudstack-agent.postinst
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# 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.
+
+set -e
+
+case "$1" in
+    configure)
+        OLDCONFDIR="/etc/cloud/agent"
+        NEWCONFDIR="/etc/cloudstack/agent"
+        CONFFILES="agent.properties log4j.xml log4j-cloud.xml"
+
+        # Copy old configuration so the admin doesn't have to do that
+        # Only do so when we are installing for the first time
+        if [ -z "$2" ]; then
+            for FILE in $CONFFILES; do
+                if [ -f "$OLDCONFDIR/${FILE}" ]; then
+                    cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
+                fi
+            done
+        fi
+        ;;
+esac
+
+exit 0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/cloudstack-common.install
----------------------------------------------------------------------
diff --git a/debian/cloudstack-common.install b/debian/cloudstack-common.install
index 9677f87..021474e 100644
--- a/debian/cloudstack-common.install
+++ b/debian/cloudstack-common.install
@@ -26,6 +26,7 @@
 /usr/share/cloudstack-common/scripts/vm/hypervisor/kvm/*
 /usr/share/cloudstack-common/scripts/vm/hypervisor/versions.sh
 /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/*
+/usr/share/cloudstack-common/lib/*
 /usr/bin/cloud-set-guest-password
 /usr/bin/cloud-set-guest-sshkey
 /usr/lib/python2.?/*-packages/*

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/cloudstack-management.install
----------------------------------------------------------------------
diff --git a/debian/cloudstack-management.install 
b/debian/cloudstack-management.install
index a8a18b4..b42343a 100644
--- a/debian/cloudstack-management.install
+++ b/debian/cloudstack-management.install
@@ -5,9 +5,9 @@
 # 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
@@ -18,6 +18,8 @@
 /etc/cloudstack/server/*
 /etc/cloudstack/management/*
 /etc/init.d/cloudstack-management
+/etc/security/limits.d/cloudstack-limits.conf
+/etc/sudoers.d/cloudstack
 /var/cache/cloudstack/management
 /var/cache/cloudstack/management/work
 /var/cache/cloudstack/management/temp
@@ -29,5 +31,4 @@
 /usr/bin/cloud-setup-databases
 /usr/bin/cloud-migrate-databases
 /usr/share/cloudstack-management/*
-/usr/share/java/*
 /usr/share/tomcat6/lib/*

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/cloudstack-management.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-management.postinst 
b/debian/cloudstack-management.postinst
index 4e9b046..293810a 100644
--- a/debian/cloudstack-management.postinst
+++ b/debian/cloudstack-management.postinst
@@ -20,7 +20,7 @@ if [ "$1" = configure ]; then
     if ! getent passwd cloud >/dev/null; then
         adduser --quiet --system --group --no-create-home --home 
/var/lib/cloudstack/management cloud
     else
-        usermod -m -d /var/lib/cloudstack/management cloud
+        usermod -m -d /var/lib/cloudstack/management cloud || true
     fi
 
     for i in /var/cache/cloudstack/management \
@@ -36,6 +36,20 @@ if [ "$1" = configure ]; then
         chgrp cloud $i
     done
 
+    OLDCONFDIR="/etc/cloud/management"
+    NEWCONFDIR="/etc/cloudstack/management"
+    CONFFILES="db.properties db-enc.properties cloud.keystore key"
+
+    # Copy old configuration so the admin doesn't have to do that
+    # Only do so when we are installing for the first time
+    if [ -z "$2" ]; then
+        for FILE in $CONFFILES; do
+            if [ -f "$OLDCONFDIR/${FILE}" ]; then
+                cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
+            fi
+        done
+    fi
+
     chmod 0640 /etc/cloudstack/management/db.properties
     chgrp cloud /etc/cloudstack/management/db.properties
 fi

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/cloudstack-usage.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-usage.postinst b/debian/cloudstack-usage.postinst
new file mode 100644
index 0000000..2e15d5d
--- /dev/null
+++ b/debian/cloudstack-usage.postinst
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# 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.
+
+set -e
+
+case "$1" in
+    configure)
+        # We copy the db.properties file from the management server to the 
usage server
+        # This used to be a symlink, but we don't do that anymore
+        if [ -f "/etc/cloud/management/db.properties" ]; then
+            cp -a /etc/cloud/management/db.properties 
/etc/cloudstack/usage/db.properties
+        fi
+
+        # We also retain the log4j configuration
+        if [ -f "/etc/cloud/usage/log4j-cloud_usage.xml" ]; then
+            cp -a /etc/cloud/usage/log4j-cloud_usage.xml 
/etc/cloudstack/usage/log4j-cloud_usage.xml
+        fi
+        ;;
+esac
+
+exit 0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index d8e7880..55496e4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,12 +38,12 @@ build-indep-stamp: configure
         -Dcs.replace.properties=replace.properties.tmp
        touch $@
 
-clean: 
+clean:
        dh_testdir
        dh_testroot
        rm -f build-arch-stamp build-indep-stamp configure-stamp
        rm -f replace.properties.tmp
-       dh_clean 
+       dh_clean
 
 install:
        dh_testdir
@@ -75,6 +75,8 @@ install:
        # cloudstack-management
        mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server
        mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management
+       mkdir -p $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
+       mkdir -p $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/
        mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management
        mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client
        mkdir $(DESTDIR)/usr/share/$(PACKAGE)-management/setup
@@ -89,13 +91,17 @@ install:
        cp -r client/target/cloud-client-ui-$(VERSION)-SNAPSHOT/* 
$(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/
        cp server/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/
        cp client/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/
+
+       # nast hack for a couple of configuration files
+       mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-limits.conf 
$(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
+       mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-sudoers 
$(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
+       chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
+
        ln -s tomcat6-nonssl.conf 
$(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
        mkdir -p 
$(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/Catalina/localhost/client
        mkdir -p ${DESTDIR}/usr/share/tomcat6/lib
-       mkdir -p ${DESTDIR}/usr/share/java
        install -D packaging/debian/init/cloud-management 
$(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
        install -D client/bindir/cloud-update-xenserver-licenses.in 
$(DESTDIR)/usr/bin/cloud-update-xenserver-licenses
-       install -D server/target/cloud-server-$(VERSION)-SNAPSHOT.jar 
$(DESTDIR)/usr/share/java/$(PACKAGE)-server.jar
        ln -s /usr/share/tomcat6/bin 
$(DESTDIR)/usr/share/$(PACKAGE)-management/bin
        ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management 
$(DESTDIR)/usr/share/$(PACKAGE)-management/conf
        ln -s ../../../usr/share/tomcat6/lib 
$(DESTDIR)/usr/share/$(PACKAGE)-management/lib
@@ -108,6 +114,7 @@ install:
        mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
        mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
        mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/setup
+       mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/lib
        cp -r scripts/installer $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
        cp -r scripts/network $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
        cp -r scripts/storage $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
@@ -119,6 +126,8 @@ install:
        install -D client/target/utilities/bin/cloud-setup-databases 
$(DESTDIR)/usr/bin
        install -D client/target/utilities/bin/cloud-setup-management 
$(DESTDIR)/usr/bin
        install -D 
client/target/cloud-client-ui-$(VERSION)-SNAPSHOT/WEB-INF/classes/vms/systemvm.iso
 $(DESTDIR)/usr/share/$(PACKAGE)-common/vms/systemvm.iso
+       # We need jasypt for cloud-install-sys-tmplt, so this is a nasty hack 
to get it into the right place
+       install -D agent/target/dependencies/jasypt-1.9.0.jar 
$(DESTDIR)/usr/share/$(PACKAGE)-common/lib
 
        # cloudstack-python
        mkdir -p $(DESTDIR)/usr/lib/python2.7/dist-packages

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/packaging/debian/init/cloud-management
----------------------------------------------------------------------
diff --git a/packaging/debian/init/cloud-management 
b/packaging/debian/init/cloud-management
index 69a0428..3ebaa73 100755
--- a/packaging/debian/init/cloud-management
+++ b/packaging/debian/init/cloud-management
@@ -19,7 +19,7 @@
 # specific language governing permissions and limitations
 # under the License.
 ### BEGIN INIT INFO
-# Provides:          tomcat-vmops
+# Provides:          cloudstack-management
 # Required-Start:    $local_fs $remote_fs $network
 # Required-Stop:     $local_fs $remote_fs $network
 # Should-Start:      $named
@@ -34,7 +34,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 NAME=cloudstack-management
 DESC="CloudStack-specific Tomcat servlet engine"
 DAEMON=/usr/bin/jsvc
-CATALINA_HOME=/usr/share/cloudstack/management
+CATALINA_HOME=/usr/share/cloudstack-management
 DEFAULT=/etc/cloudstack/management/tomcat6.conf
 JVM_TMP=/tmp/$NAME-temp
 
@@ -65,7 +65,7 @@ TOMCAT6_USER=tomcat6
 
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
 # defined in $DEFAULT)
-JDK_DIRS="/usr/lib/jvm/java-1.6.0-openjdk-amd64/ 
/usr/lib/jvm/java-1.6.0-openjdk-i386/ /usr/lib/jvm/java-1.6.0-openjdk/ 
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun"
+JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 
/usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun"
 
 # Look for the right JVM to use
 for jdir in $JDK_DIRS; do
@@ -76,7 +76,7 @@ done
 export JAVA_HOME
 
 # Directory for per-instance configuration files and webapps
-CATALINA_BASE=/usr/share/cloudstack/management
+CATALINA_BASE=/usr/share/cloudstack-management
 
 # Use the Java security manager? (yes/no)
 TOMCAT6_SECURITY=no

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/packaging/debian/replace.properties
----------------------------------------------------------------------
diff --git a/packaging/debian/replace.properties 
b/packaging/debian/replace.properties
index 8705c78..8c85206 100644
--- a/packaging/debian/replace.properties
+++ b/packaging/debian/replace.properties
@@ -34,7 +34,7 @@ AWSAPILOG=/var/log/cloudstack/awsapi/awsapi.log
 BINDIR=/usr/bin
 COMMONLIBDIR=/usr/share/cloudstack-common
 CONFIGUREVARS=
-DEPSCLASSPATH=
+DEPSCLASSPATH=/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar
 DOCDIR=
 IPALOCATORLOG=/var/log/cloudstack/management/ipallocator.log
 JAVADIR=/usr/share/cloudstack-management/webapps/client/WEB-INF/lib

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/server/conf/cloudstack-limits.conf.in
----------------------------------------------------------------------
diff --git a/server/conf/cloudstack-limits.conf.in 
b/server/conf/cloudstack-limits.conf.in
new file mode 100644
index 0000000..c28ad8c
--- /dev/null
+++ b/server/conf/cloudstack-limits.conf.in
@@ -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.
+
+# Specific limits for the CloudStack management server which
+# runs under the user 'cloud' by default
+@MSUSER hard nofile 4096
+@MSUSER soft nofile 4096

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11892d34/server/conf/cloudstack-sudoers.in
----------------------------------------------------------------------
diff --git a/server/conf/cloudstack-sudoers.in 
b/server/conf/cloudstack-sudoers.in
new file mode 100644
index 0000000..c525d3c
--- /dev/null
+++ b/server/conf/cloudstack-sudoers.in
@@ -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.
+
+# The CloudStack management server needs sudo permissions
+# without a password.
+
+@MSUSER ALL =NOPASSWD : ALL
+

Reply via email to