Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
CLOUDSTACK-10012: Embedded Jetty for CloudStack#2197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| <!-- | ||
| 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. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <groupId>org.apache.cloudstack</groupId> | ||
| <artifactId>cloudstack-jetty</artifactId> | ||
| <parent> | ||
| <groupId>org.apache.cloudstack</groupId> | ||
| <artifactId>cloudstack</artifactId> | ||
| <version>4.9.0-SNAPSHOT</version> | ||
| <relativePath>../../pom.xml</relativePath> | ||
| </parent> | ||
| <name>Apache CloudStack Jetty</name> | ||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| </properties> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.eclipse.jetty</groupId> | ||
| <artifactId>jetty-runner</artifactId> | ||
| <version>${cs.jetty.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| <build> | ||
| <finalName>${project.artifactId}</finalName> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-checkstyle-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>cloudstack-checkstyle</id> | ||
| <phase>none</phase> | ||
| <inherited>false</inherited> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
| <configuration> | ||
| <descriptors> | ||
| <descriptor>standalone.xml</descriptor> | ||
| </descriptors> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <id>make-assembly</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>single</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <assembly> | ||
| <id>standalone</id> | ||
| <formats> | ||
| <format>dir</format> | ||
| </formats> | ||
| <includeBaseDirectory>true</includeBaseDirectory> | ||
| <baseDirectory></baseDirectory> | ||
| <fileSets> | ||
| <fileSet> | ||
| <directory>src/main/jetty/bin</directory> | ||
| <outputDirectory>/bin</outputDirectory> | ||
| <fileMode>755</fileMode> | ||
| </fileSet> | ||
| </fileSets> | ||
| <dependencySets> | ||
| <dependencySet> | ||
| <useProjectArtifact>false</useProjectArtifact> | ||
| <outputDirectory>/lib</outputDirectory> | ||
| <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping> | ||
| </dependencySet> | ||
| <dependencySet> | ||
| <useProjectArtifact>true</useProjectArtifact> | ||
| <scope>runtime</scope> | ||
| <includes> | ||
| <include>org.eclipse.jetty:jetty-start:*</include> | ||
| </includes> | ||
| <outputDirectory>/bin</outputDirectory> | ||
| <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping> | ||
| </dependencySet> | ||
| </dependencySets> | ||
| </assembly> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/bin/bash | ||
| . /etc/cloudstack/management/tomcat6.conf | ||
| SERVLETENGINE='jetty' | ||
| # For SELinux we need to use 'runuser' not 'su' | ||
| if [ -x "/sbin/runuser" ]; then | ||
| SU="/sbin/runuser -s /bin/sh" | ||
| else | ||
| SU="/bin/su -s /bin/sh" | ||
| fi | ||
| touch $CLOUD_PID; | ||
| chown $CLOUD_USER. $CLOUD_PID | ||
| # CLASSPATH munging | ||
| if [ -n "$JSSE_HOME" ]; then | ||
| CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)" | ||
| fi | ||
| CLASSPATH="${CLASSPATH}:$(build-classpath commons-daemon 2>/dev/null)" | ||
| CLOUD_HOME="/usr/share/cloudstack-management/" | ||
| CLOUD_BASE=$CLOUD_HOME | ||
| NAME="cloudstack-management" | ||
| # Define the tomcat username | ||
| CLOUD_USER="${CLOUD_USER:-cloud}" | ||
| # Define the tomcat group | ||
| CLOUD_GROUP="${CLOUD_GROUP:-`id -gn $CLOUD_USER`}" | ||
| # Define the tomcat log file | ||
| CLOUD_LOG="${CLOUD_LOG:-/var/log/${NAME}-initd.log}" | ||
| # Define the pid file name | ||
| # If change is needed, use sysconfig instead of here | ||
| export CLOUD_PID="${CLOUD_PID:-/var/run/${NAME}.pid}" | ||
| CLASSPATH="${CLASSPATH}:${CLOUD_HOME}/lib/jetty-runner.jar" | ||
| CLASS="org.eclipse.jetty.runner.Runner --classes /etc/cloudstack/management --path /client $CLOUD_HOME/webapps/client --stop-port 8888 --stop-key monkeystop" | ||
| if [ "$1" = "start" ]; then | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this just be a wrapper script that systemd can execute? As we want to start/stop everything through systemd | ||
| java $JAVA_OPTS $CLOUD_OPTS \ | ||
| -classpath "$CLASSPATH" \ | ||
| -D"$SERVLETENGINE".base="$CLOUD_BASE" \ | ||
| -D"$SERVLETENGINE".home="$CLOUD_HOME" \ | ||
| -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ | ||
| -Djava.io.tmpdir="$CLOUD_TMPDIR" \ | ||
| $CLASS \ | ||
| >> ${CLOUD_BASE}/logs/servlet-engine.out 2>&1 & | ||
| if [ ! -z "$CLOUD_PID" ]; then | ||
| echo $! > $CLOUD_PID | ||
| fi | ||
| elif [ "$1" = "stop" ]; then | ||
| echo Stopping server | ||
| java -jar ${CLOUD_HOME}/start.jar --stop -DSTOP.PORT=8888 -DSTOP.KEY=monkeystop | ||
| else | ||
| echo "Usage: $0 {start|stop}" | ||
| exit 1 | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't seem to use this?