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
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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
|
/etc/init.d/cloudstack-usage
|
||||||
/var/log/cloudstack/usage
|
/var/log/cloudstack/usage
|
||||||
/etc/cloudstack/usage/*
|
/etc/cloudstack/usage/*
|
||||||
|
|||||||
3
debian/rules
vendored
3
debian/rules
vendored
@ -124,7 +124,10 @@ install:
|
|||||||
# cloudstack-usage
|
# cloudstack-usage
|
||||||
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage
|
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage
|
||||||
mkdir $(DESTDIR)/var/log/$(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/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/
|
cp usage/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
|
||||||
ln -s ../management/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
|
ln -s ../management/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
|
||||||
install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
|
install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: cloud usage
|
# Provides: cloudstack usage
|
||||||
# Required-Start: $network $local_fs
|
# Required-Start: $network $local_fs
|
||||||
# Required-Stop: $network $local_fs
|
# Required-Stop: $network $local_fs
|
||||||
# Default-Start: 3 4 5
|
# Default-Start: 3 4 5
|
||||||
@ -32,17 +32,15 @@
|
|||||||
|
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
SHORTNAME="cloud-usage"
|
SHORTNAME="cloudstack-usage"
|
||||||
PIDFILE=/var/run/"$SHORTNAME".pid
|
PIDFILE=/var/run/"$SHORTNAME".pid
|
||||||
LOGFILE=/var/log/cloud/usage/usage-server.log
|
|
||||||
PROGNAME="CloudStack Usage Monitor"
|
PROGNAME="CloudStack Usage Monitor"
|
||||||
CLASS="com.cloud.usage.UsageServer"
|
CLASS="com.cloud.usage.UsageServer"
|
||||||
PROG="jsvc"
|
PROG="jsvc"
|
||||||
DAEMON="/usr/bin/jsvc"
|
DAEMON="/usr/bin/jsvc"
|
||||||
USER=@MSUSER@
|
|
||||||
|
|
||||||
unset OPTIONS
|
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)
|
# 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"
|
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
|
done
|
||||||
export JAVA_HOME
|
export JAVA_HOME
|
||||||
|
|
||||||
SCP="@SYSTEMCLASSPATH@"
|
UCP=`ls /usr/share/cloudstack-usage/lib/*.jar | tr '\n' ':' | sed s'/.$//'`
|
||||||
DCP="@DEPSCLASSPATH@"
|
PCP=`ls /usr/share/cloudstack-usage/plugins/*.jar 2>/dev/null | tr '\n' ':' | sed s'/.$//'`
|
||||||
UCP="@USAGECLASSPATH@"
|
|
||||||
JCP="/usr/share/java/commons-daemon.jar"
|
|
||||||
|
|
||||||
# We need to append the JSVC daemon JAR to the classpath
|
# We need to append the JSVC daemon JAR to the classpath
|
||||||
# AgentShell implements the JSVC daemon methods
|
# 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() {
|
start() {
|
||||||
if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
|
if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
|
||||||
@ -79,7 +75,7 @@ start() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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=$?
|
RETVAL=$?
|
||||||
then
|
then
|
||||||
rc=0
|
rc=0
|
||||||
|
|||||||
@ -127,6 +127,24 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user