diff options
5 files changed, 110 insertions, 5 deletions
diff --git a/jenkins-server-slave-setup/scripts/jabot-initd-debian b/jenkins-server-slave-setup/scripts/jabot-initd-debian new file mode 100755 index 0000000..a2fcdef --- /dev/null +++ b/jenkins-server-slave-setup/scripts/jabot-initd-debian @@ -0,0 +1,81 @@ +#! /bin/bash +### BEGIN INIT INFO +# Provides: jabot +# Required-Start: $local_fs $remote_fs $network $syslog $time +# Required-Stop: $local_fs $remote_fs $network $syslog +# Should-Start: apache2 +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: IRC JABot init script +# Description: Init script for jabot services +### END INIT INFO + +# +# jabot Start/Stop the IRC JABot +# +# chkconfig: 345 91 10 +# description: IRC JABot. \ +# processname: jabot + + +# Source function library. +. /lib/lsb/init-functions + +# Check that networking is up. +# [ "${NETWORKING}" = "no" ] && exit 0 + +JABOT_USER=jabot +JABOT_HOME=/srv/$JABOT_USER/jabot +startup=$JABOT_HOME/scripts/start.jabot-jogamp.sh +shutdown=$JABOT_HOME/scripts/stop.jabot.sh + +start(){ + echo -n $"Starting Jabot service: " + su - $JABOT_USER -c $startup + RETVAL=$? + echo +} + +stop(){ + echo -n $"Stopping Jabot service: " + su - $JABOT_USER -c $shutdown + RETVAL=$? + echo +} + +status(){ + numproc=`ps -ef | grep jabot.rar | grep -v "grep jabot.rar" | wc -l` + if [ $numproc -gt 0 ]; then + echo "Jabot is running..." + else + echo "Jabot is stopped..." + fi +} + +restart(){ + stop + start +} + + +# See how we were called. +case "$1" in +start) + start + ;; +stop) + stop + ;; +status) + status + ;; +restart) + restart + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + exit 1 +esac + +exit 0 diff --git a/jenkins-server-slave-setup/scripts/jenkins-initd-debian b/jenkins-server-slave-setup/scripts/jenkins-initd-debian index 5f66d99..a2797ce 100755 --- a/jenkins-server-slave-setup/scripts/jenkins-initd-debian +++ b/jenkins-server-slave-setup/scripts/jenkins-initd-debian @@ -17,7 +17,6 @@ # chkconfig: 345 91 10 # description: Jenkins is a Continuous Integration server. \ # processname: jenkins -# pidfile: /var/run/jenkins.pid # Source function library. diff --git a/jenkins-server-slave-setup/scripts/start.jabot.sh b/jenkins-server-slave-setup/scripts/start.jabot.sh new file mode 100755 index 0000000..9c485e5 --- /dev/null +++ b/jenkins-server-slave-setup/scripts/start.jabot.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +export JABOT_HOME=/srv/jabot/jabot +export JABOT_LOG=$JABOT_HOME/irc_jogamp_CatOut_`date -u +%Y%m%d%H%M`.log +# export JRE_HOME=/opt-linux-x86_64/jre8 +export JRE_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::") + +# -testPongTO +# -verbose + +JAVA=$JRE_HOME/bin/java +nohup nice $JAVA \ + -cp $JABOT_HOME/build/jabot.jar org.jogamp.jabot.irc.CatOut \ + -login srvlogin -nick ircnickname -nickpwd nickserv_id_password \ + -server irc.freenode.net -channel jogamp \ + -logrotate 86400000 \ + -logrotateStart 0505 \ + -logprefix "/srv/www/jogamp.org/log/irc/" \ + -urlprefix "http://jogamp.org/log/irc/" \ + -htmlHeader $JABOT_HOME/assets/header.html \ + -htmlFooter $JABOT_HOME/assets/footer.html \ + > $JABOT_LOG 2>&1 & + +# 1day = 24 * 60 * 60 * 1000 = 86400000 diff --git a/jenkins-server-slave-setup/scripts/start.jenkins.sh b/jenkins-server-slave-setup/scripts/start.jenkins.sh index 390775a..63cd3c3 100755 --- a/jenkins-server-slave-setup/scripts/start.jenkins.sh +++ b/jenkins-server-slave-setup/scripts/start.jenkins.sh @@ -3,9 +3,10 @@ export JENKINS_HOME=/srv/jenkins export JENKINS_WAR=$JENKINS_HOME/jenkins.war export JENKINS_LOG=$JENKINS_HOME/jenkins.log -#export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::") -export JAVA_HOME=/opt-linux-x86_64/jre7 -JAVA=$JAVA_HOME/bin/java +#export JAVAC_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") +export JRE_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::") +#export JRE_HOME=/opt-linux-x86_64/jre8 +JAVA=$JRE_HOME/bin/java cd $JENKINS_HOME rm -rf war diff --git a/jenkins-server-slave-setup/scripts/stop.jenkins.sh b/jenkins-server-slave-setup/scripts/stop.jenkins.sh index fbf8454..5246a60 100755 --- a/jenkins-server-slave-setup/scripts/stop.jenkins.sh +++ b/jenkins-server-slave-setup/scripts/stop.jenkins.sh @@ -1,3 +1,3 @@ #!/bin/bash -kill `ps -ef | grep jenkins.war | grep -v grep | awk '{ print $2 }'` +kill -9 `ps -ef | grep jenkins.war | grep -v grep | awk '{ print $2 }'` |