Skip to content

Instantly share code, notes, and snippets.

@dportabella
Last active March 28, 2018 17:45
Show Gist options
  • Save dportabella/7714449 to your computer and use it in GitHub Desktop.
Save dportabella/7714449 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>david.rundeck</string>
<key>ProgramArguments</key>
<array>
<string>/Users/david/bin/rundeck/server/sbin/rundeck_launchd</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>david</string>
<key>Debug</key>
<true/>
</dict>
</plist>
#!/bin/bash
#
# rundeck_launchd Startup script for the RunDeck Launcher install
# paramaters:
# - env vars: [RDECK_BASE, RDECK_PORT, RDECK_LAUNCHER]
# - standard RDECK_PORT values: [http: 4440, https: 4443]
export RDECK_BASE=${0%/*/*/*}
# RDECK_BASE must be set and exist
[ -z "$RDECK_BASE" -o ! -d "$RDECK_BASE" ] && {
echo "RDECK_BASE not set or does not exist" ;
exit 1 ;
}
# Source installation profile
. $RDECK_BASE/etc/profile
# Get the Launcher Jar path
[ -z "$RDECK_LAUNCHER" ] && {
# Defaults to location of first startup
RDECK_LAUNCHER=$(ls $RDECK_BASE/rundeck-launcher-*.jar)
}
[ -r "$RDECK_LAUNCHER" ] || {
echo "RDECK_LAUNCHER not found: $RDECK_LAUNCHER"
exit 1;
}
# lookup the server port from the tools config file
RDECK_PORT=`awk '/framework.server.port/ {print $3}' $RDECK_BASE/etc/framework.properties`
# set the ssl opts if https is configured
SSL_OPTS=
proto=$(awk '/framework.server.url = / {split($3, a, ":"); print a[1]}' $RDECK_BASE/etc/framework.properties)
[ "${proto:-http}" == "https" ] && {
SSL_OPTS="-Drundeck.ssl.config=$RDECK_BASE/server/config/ssl.properties"
}
rundeckd="${JAVA_HOME}/bin/java ${RDECK_JVM} -Dserver.http.port=${RDECK_PORT:=4440} $SSL_OPTS -jar ${RDECK_LAUNCHER}"
[ -w $RDECK_BASE/var ] || {
echo "RDECK_BASE dir not writable: $RDECK_BASE"
exit 1 ;
}
mkdir -p $RDECK_BASE/var/run
mkdir -p $RDECK_BASE/var/log
mkdir -p $RDECK_BASE/var/lock/subsys
$rundeckd 2>&1 >>$RDECK_BASE/var/log/service.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment