$RDECK_BASE/server/sbin/rundeck_launchd
é um script para iniciar o rundeck sem enviar o processo para o segundo plano (exigido pelo OSX Launchd).
/System/Library/LaunchAgents/david.rundeck.plist
é um arquivo de configuração para configurar o rundeck como um serviço launchd do Mac OSX. Você precisa modificar este arquivo de acordo com suas necessidades. neste exemplo, RDECK_BASE é / Users / david / bin / rundeck.
depois de instalar esses dois arquivos, reinicie o computador e o rundeck será iniciado no momento da inicialização.
você pode parar, iniciar e ver o status do serviço de renovação:
$ launchctl start david.rundeck
$ launchctl stop david.rundeck
$ launchctl list david.rundeck
(este script é baseado no script $ RDECK_BASE / server / sbin / rundeckd)
Arquivo $RDECK_BASE/server/sbin/rundeck_launchd
#!/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
Arquivo /System/Library/LaunchAgents/david.rundeck.plist
<?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>