Skip to content

Commit cd65d26

Browse files
committed
debian: Further improve the usage server package
We no longer symlink db.properties to the management server, but we create a own db.properties for the usage server. During a upgrade we copy the file to make the upgrade easier.
1 parent 97d2e3f commit cd65d26

3 files changed

Lines changed: 49 additions & 1 deletion

File tree

debian/cloudstack-usage.postinst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
22+
case "$1" in
23+
configure)
24+
# We copy the db.properties file from the management server to the usage server
25+
# This used to be a symlink, but we don't do that anymore
26+
if [ -f "/etc/cloud/management/db.properties" ]; then
27+
cp -a /etc/cloud/management/db.properties /etc/cloudstack/usage/db.properties
28+
fi
29+
30+
# We also retain the log4j configuration
31+
if [ -f "/etc/cloud/usage/log4j-cloud_usage.xml" ]; then
32+
cp -a /etc/cloud/usage/log4j-cloud_usage.xml /etc/cloudstack/usage/log4j-cloud_usage.xml
33+
fi
34+
;;
35+
esac
36+
37+
exit 0

debian/rules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ install:
129129
install -D usage/target/cloud-usage-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
130130
install -D usage/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/
131131
cp usage/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
132-
ln -s ../management/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
133132
install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
134133

135134
# cloudstack-awsapi

usage/conf/db.properties.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# usage database settings
2+
db.usage.username=@DBUSER@
3+
db.usage.password=@DBPW@
4+
db.usage.host=@DBHOST@
5+
db.usage.port=3306
6+
db.usage.name=cloud_usage
7+
8+
# usage database tuning parameters
9+
db.usage.maxActive=100
10+
db.usage.maxIdle=30
11+
db.usage.maxWait=10000
12+
db.usage.autoReconnect=true

0 commit comments

Comments
 (0)