Skip to content

Commit

Permalink
Merge branch 'release-1.0' of github.com:dtolabs/rundeck into release…
Browse files Browse the repository at this point in the history
…-1.0
  • Loading branch information
ahonor committed Dec 21, 2010
2 parents 14d8275 + 5ec74f4 commit 51195b7
Show file tree
Hide file tree
Showing 19 changed files with 133 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ rundeckapp/env.bash
rundeckapp/work
rundeckapp/web-app/plugins
packaging/dist
core/junit*.properties
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -14,7 +14,7 @@ GARGS += -Dgrails.project.work.dir=${PWD}/rundeckapp/work
GRAILS=$(GRAILS_HOME)/bin/grails $(GARGS)

RUNDECK_FILES=$(shell find rundeckapp/{src,test,grails-app,scripts} -name "*.java" -o -name "*.groovy" -o -name "*.gsp")
CORE_FILES=$(shell find core/src -name "*.java" -o -path "*/src/sh/*")
CORE_FILES=$(shell find core/src -name "*.java" -o name "*.templates" -o -path "*/src/sh/*")

core = core/target/rundeck-core-$(VERSION).jar
war = rundeckapp/target/rundeck-$(VERSION).war
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/dispatch
Expand Up @@ -35,7 +35,7 @@ fi
#
# Launch the cmdline tool
#
exec $JAVA_HOME/bin/java ${RDECK_JVM} -classpath ${CLI_CP} \
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
$RDECK_SSL_OPTS \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/rd-check
Expand Up @@ -57,7 +57,7 @@ done
PATH=$JAVA_HOME/bin:$RDECK_HOME/bin:/usr/bin:/bin:/usr/sbin:/sbin
export PATH

$JAVA_HOME/bin/java -Duser.java_home=$JAVA_HOME \
exec ${JAVA_CMD:-java} -Duser.java_home=$JAVA_HOME \
-Drdeck.home=$RDECK_HOME \
-Drdeck.base=$RDECK_BASE \
-cp $cp \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/rd-jobs
Expand Up @@ -35,7 +35,7 @@ fi
#
# Launch the cmdline tool
#
exec $JAVA_HOME/bin/java ${RDECK_JVM} -classpath ${CLI_CP} \
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Duser.java_home=$JAVA_HOME \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/rd-project
Expand Up @@ -35,7 +35,7 @@ fi
#
# Launch the cmdline tool
#
exec $JAVA_HOME/bin/java ${RDECK_JVM} -classpath ${CLI_CP} \
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
-Drdeck.traceExceptions=$RUNDECK_TRACE_EXCEPTIONS \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/rd-queue
Expand Up @@ -35,7 +35,7 @@ fi
#
# Launch the cmdline tool
#
exec $JAVA_HOME/bin/java ${RDECK_JVM} -classpath ${CLI_CP} \
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Duser.java_home=$JAVA_HOME \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/rd-setup
Expand Up @@ -70,7 +70,7 @@ done
PATH=$JAVA_HOME/bin:$RDECK_HOME/bin:/usr/bin:/bin:/usr/sbin:/sbin
export PATH

$JAVA_HOME/bin/java -Dant.home=$ANT_HOME \
exec ${JAVA_CMD:-java} -Dant.home=$ANT_HOME \
-Duser.java_home=$JAVA_HOME \
-Drdeck.home=$RDECK_HOME \
-Drdeck.base=$RDECK_BASE \
Expand Down
2 changes: 1 addition & 1 deletion core/src/sh/run
Expand Up @@ -35,7 +35,7 @@ fi
#
# Launch the cmdline tool
#
exec $JAVA_HOME/bin/java ${RDECK_JVM} -classpath ${CLI_CP} \
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Duser.java_home=$JAVA_HOME \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
Expand Down
2 changes: 1 addition & 1 deletion core/src/templates/etc/profile.bat.template
Expand Up @@ -7,6 +7,6 @@ set JAVA_HOME=@user.java_home@
:: Unsetting JRE_HOME to ensure there is no conflict with JAVA_HOME
(set JRE_HOME=)

set Path=%JAVA_HOME%\bin;%RDECK_HOME%\bin;%Path%
set Path=%JAVA_HOME%\bin;%RDECK_HOME%\tools\bin;%Path%

set RDECK_SSL_OPTS="-Djavax.net.ssl.trustStore=%RDECK_BASE%\etc\truststore -Djavax.net.ssl.trustStoreType=jks -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol"
4 changes: 3 additions & 1 deletion core/src/templates/etc/profile.template
Expand Up @@ -7,9 +7,11 @@ export RDECK_BASE
JAVA_HOME=@user.java_home@
export JAVA_HOME

PATH=$JAVA_HOME/bin:$RDECK_HOME/bin:$PATH
PATH=$JAVA_HOME/bin:$RDECK_HOME/tools/bin:$PATH
export PATH

export JAVA_CMD=$JAVA_HOME/bin/java

if test -t 0 -a -z "$RUNDECK_CLI_TERSE"
then
RUNDECK_CLI_TERSE=true
Expand Down
2 changes: 1 addition & 1 deletion docs/en/01-getting-started/01-chapter1.md
Expand Up @@ -106,7 +106,7 @@ runtime.
The install process requires that the latest version of Java 1.6
be installed. Both the [Open JDK](http://openjdk.java.net/) and [Sun/Oracle](http://java.com/) JVMs can be used.
You must have the JAVA_HOME environment variable defined
in your environment before running the installation.
in your environment before running the launcher. The RPM will use the java found on your path. See [Setting JAVA_HOME](#setting-java_home) if you want to run a different version of java.

Verify your Java version to check it meets the requirement:

Expand Down
11 changes: 11 additions & 0 deletions docs/en/07-administration/07-chapter1.md
Expand Up @@ -23,6 +23,17 @@ The script is located here: `/etc/init.d/rundeckd`

/etc/initd./rundeckd stop

#### Setting JAVA_HOME

When using the RPM, by default rundeck will use _java_ found in your path. Various RPM based
distributions provide ways of managing which version of java is found. CentOS uses
_/usr/sbin/alternatives_ and the processing of setting alternatives can be found here: http://wiki.centos.org/HowTos/JavaOnCentOS

If you have installed a JDK or JRE in a unique directory and do not want to alter the global system
configuration, then simply setting JAVA_HOME before running any command will use the version of java
found in JAVA_HOME/bin. Updating /etc/rundeck/client/profile with JAVA_HOME is another option as
well.

### Launcher

The Launcher installation generates the script into the RDECK_BASE directory.
Expand Down
17 changes: 13 additions & 4 deletions packaging/root/etc/rundeck/client/profile
Expand Up @@ -4,11 +4,20 @@ export RDECK_HOME
RDECK_BASE=/etc/rundeck/client
export RDECK_BASE

JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
export JAVA_HOME
JAVA_CMD=java

#
# If JAVA_HOME is set, then add it to home and set JAVA_CMD to use the version specified in that
# path. JAVA_HOME can be set in the rundeck profile. Or set in this file.
#JAVA_HOME=<path/to/JDK or JRE/install>

if [ ! -z $JAVA_HOME ]; then
PATH=$PATH:$JAVA_HOME/bin
export PATH
JAVA_CMD=$JAVA_HOME/bin/java
fi


PATH=$PATH:$JAVA_HOME/bin
export PATH

export CLI_CP=$(find /var/lib/rundeck/cli -name \*.jar -printf %p:)
export BOOTSTRAP_CP=$(find /var/lib/rundeck/bootstrap -name \*.jar -printf %p:)
Expand Down
35 changes: 26 additions & 9 deletions rundeckapp/grails-app/controllers/ExecutionController.groovy
Expand Up @@ -190,7 +190,7 @@ class ExecutionController {
isFormatted = "true"==params.formatted
}

def Map result = parseOutput(file,0,-1){ Map msgbuf ->
def Map result = parseOutput(file,0,-1,null){ Map msgbuf ->
response.outputStream << (isFormatted?"${msgbuf.time} [${msgbuf.user}@${msgbuf.node} ${msgbuf.context} ${msgbuf.command}][${msgbuf.level}] ${msgbuf.mesg}" : msgbuf.mesg)
true
}
Expand Down Expand Up @@ -337,7 +337,7 @@ class ExecutionController {
if(bufsize<(25*1024)){
bufsize=25*1024
}
def Map result = parseOutput(file,offset,bufsize){ data ->
def Map result = parseOutput(file,offset,bufsize,null){ data ->
entry << data
(0==max || entry.size()<max)
}
Expand Down Expand Up @@ -390,7 +390,7 @@ class ExecutionController {
* @param callback a closure that has 1 parameter, the map of data to read. if it returns false, reading will stop
* @return Map containing two keys, 'storeoffset': next offset to start at, if buffersize is defined, and 'completed': boolean value if the log file has been completely read
*/
public Map parseOutput ( File file, Long offset, Long bufsize = -1 , Closure callback){
public Map parseOutput ( File file, Long offset, Long bufsize = -1 ,def String encoding=null, Closure callback){


def initoffset=offset
Expand All @@ -405,16 +405,32 @@ class ExecutionController {
def chars=0;
def tot=file.length()
//start at offset byte.
RandomAccessFile raf = new RandomAccessFile(file,"r")
def totsize = raf.getChannel().size()
def size = raf.getChannel().size()

//we use RandomAccessFile to call readLine and record the byte-oriented offset
RandomAccessFile raf = new RandomAccessFile(file,'r')

//we use InputStreamReader to read bytes to chars given encoding option
//in this case readLine may buffer bytes for decoding purposes, so the offset is not correct
final FileInputStream stream = new FileInputStream(file)
InputStreamReader fr
if(null!=encoding){
fr= new InputStreamReader(stream,encoding)
}else{
//use default encoding
fr= new InputStreamReader(stream)
}

def totsize = stream.getChannel().size()
def size = stream.getChannel().size()
if(offset>0){
stream.getChannel().position(offset)
raf.seek(offset)
}
// log.info("starting tailExecutionOutput: offset: "+offset+", completed: "+completed)
def String lSep = System.getProperty("line.separator");
def tstart=System.currentTimeMillis();
def String line = raf.readLine()
def String line = fr.readLine()
def oline=raf.readLine() //discarded content
def diff = System.currentTimeMillis()-tstart;

if(bufsize > 0 && size-offset > bufsize){
Expand Down Expand Up @@ -518,11 +534,12 @@ class ExecutionController {
buf << line + lSep
}
tstart=System.currentTimeMillis();
line = raf.readLine()
line = fr.readLine()//kept
oline=raf.readLine()//discarded
diff=System.currentTimeMillis()-tstart;
}
fr.close()
raf.close()

if(msgbuf){
//incomplete message entry. We leave it until next time unless completed==true
if(completed){
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/i18n/messages.properties
Expand Up @@ -31,7 +31,7 @@ default.paginate.next=next&raquo;
gui.menu.Workflows=Jobs
gui.menu.Events=History
gui.menu.Nodes=Nodes
gui.menu.Resources=Resources
gui.menu.Run=Run
gui.menu.Admin=Admin

domain.ScheduledExecution.title=Job
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/views/common/_topbar.gsp
Expand Up @@ -121,7 +121,7 @@ function createProject(value){
</g:ifPageProperty>
</g:ifPageProperty>
<g:link controller="framework" action="nodes" class=" toptab ${resselected}" style="height:29px">
<g:message code="gui.menu.Resources"/>
<g:message code="gui.menu.Run"/>
</g:link>

<g:set var="eventsselected" value=""/>
Expand Down
Expand Up @@ -133,7 +133,7 @@
</div>
<div class="foot">
Run Deck:
<g:link absolute="true" controller="framework" action="nodes"><g:message code="gui.menu.Resources"/> &raquo;</g:link>
<g:link absolute="true" controller="framework" action="nodes"><g:message code="gui.menu.Run"/> &raquo;</g:link>
<g:link absolute="true" controller="reports" action="index"><g:message code="gui.menu.Events"/> &raquo;</g:link>
<g:link absolute="true" controller="menu" action="jobs"><g:message code="gui.menu.Workflows"/> &raquo;</g:link>
</div>
Expand Down

0 comments on commit 51195b7

Please sign in to comment.