mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
debian: Fix the usage server packaging
This commit is contained in:
parent
aee6fc3bce
commit
7a794519a2
3
debian/cloudstack-usage.install
vendored
3
debian/cloudstack-usage.install
vendored
@ -15,7 +15,8 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
|
||||
/usr/share/cloudstack-usage/lib/*
|
||||
/usr/share/cloudstack-usage/plugins
|
||||
/etc/init.d/cloudstack-usage
|
||||
/var/log/cloudstack/usage
|
||||
/etc/cloudstack/usage/*
|
||||
|
||||
3
debian/rules
vendored
3
debian/rules
vendored
@ -124,7 +124,10 @@ install:
|
||||
# cloudstack-usage
|
||||
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage
|
||||
mkdir $(DESTDIR)/var/log/$(PACKAGE)/usage
|
||||
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage
|
||||
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage/plugins
|
||||
install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
|
||||
install -D usage/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/
|
||||
cp usage/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
|
||||
ln -s ../management/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
|
||||
install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cloud usage
|
||||
# Provides: cloudstack usage
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop: $network $local_fs
|
||||
# Default-Start: 3 4 5
|
||||
@ -32,17 +32,15 @@
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SHORTNAME="cloud-usage"
|
||||
SHORTNAME="cloudstack-usage"
|
||||
PIDFILE=/var/run/"$SHORTNAME".pid
|
||||
LOGFILE=/var/log/cloud/usage/usage-server.log
|
||||
PROGNAME="CloudStack Usage Monitor"
|
||||
CLASS="com.cloud.usage.UsageServer"
|
||||
PROG="jsvc"
|
||||
DAEMON="/usr/bin/jsvc"
|
||||
USER=@MSUSER@
|
||||
|
||||
unset OPTIONS
|
||||
[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source @SYSCONFDIR@/default/"$SHORTNAME"
|
||||
[ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME"
|
||||
|
||||
# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
|
||||
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"
|
||||
@ -54,14 +52,12 @@ for jdir in $JDK_DIRS; do
|
||||
done
|
||||
export JAVA_HOME
|
||||
|
||||
SCP="@SYSTEMCLASSPATH@"
|
||||
DCP="@DEPSCLASSPATH@"
|
||||
UCP="@USAGECLASSPATH@"
|
||||
JCP="/usr/share/java/commons-daemon.jar"
|
||||
UCP=`ls /usr/share/cloudstack-usage/lib/*.jar | tr '\n' ':' | sed s'/.$//'`
|
||||
PCP=`ls /usr/share/cloudstack-usage/plugins/*.jar 2>/dev/null | tr '\n' ':' | sed s'/.$//'`
|
||||
|
||||
# We need to append the JSVC daemon JAR to the classpath
|
||||
# AgentShell implements the JSVC daemon methods
|
||||
export CLASSPATH="$SCP:$DCP:$UCP:$JCP:@USAGESYSCONFDIR@"
|
||||
export CLASSPATH="/usr/share/java/commons-daemon.jar:$UCP:$PCP:/etc/cloudstack/usage"
|
||||
|
||||
start() {
|
||||
if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
|
||||
@ -79,7 +75,7 @@ start() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -user "$USER" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
|
||||
if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
|
||||
RETVAL=$?
|
||||
then
|
||||
rc=0
|
||||
|
||||
@ -127,6 +127,24 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
|
||||
<includeScope>runtime</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user