Created
December 14, 2013 14:34
-
-
Save lichengwu/7959859 to your computer and use it in GitHub Desktop.
run jenkins shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DESC="Jenkins CI Server" | |
NAME=jenkins | |
PIDFILE=/var/run/$NAME.pid | |
RUN_AS=admin | |
COMMAND=JAVA_TOOL_OPTIONS=-Dfile.encoding=GBK /opt/taobao/java64/bin/java -jar -server -Xms2048m -Xmx2048m -XX:NewSize=320m -XX:MaxNewS | |
ize=320m -XX:PermSize=128m -XX:MaxPermSize=256m /usr/lib/jenkins/jenkins.war --httpPort=9000 | |
#COMMAND=/opt/taobao/java/bin/java -jar /home/jenkins/jenkins.war | |
d_start() { | |
start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND | |
} | |
d_stop() { | |
start-stop-daemon --stop --quiet --pidfile $PIDFILE | |
if [ -e $PIDFILE ] | |
then rm $PIDFILE | |
fi | |
} | |
case $1 in | |
start) | |
echo -n "Starting $DESC: $NAME" | |
d_start | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping $DESC: $NAME" | |
d_stop | |
echo "." | |
;; | |
restart) | |
echo -n "Restarting $DESC: $NAME" | |
d_stop | |
sleep 1 | |
d_start | |
echo "." | |
;; | |
*) | |
echo "usage: $NAME {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment