## init.d 설정
* ln -s /daum/program/jenkins/jenkins.sh /etc/init.d/
* /sbin/chkconfig jenkins.sh on
logrotate 설정
/daum/program/jenkins/logs/jenkins.log {
weekly
copytruncate
missingok
rotate 12
# compress
# delaycompress
notifempty
}
jenkins 시작 종료 스크립트
#!/bin/sh
#
# Startup script for the Jenkins Continuous Integration server
#
# chkconfig: - 85 15
# description: Self contained jenkins server
# processname: jenkins
# pidfile: /daum/program/jenkins/jenkins.pid
# Set Jenkins environment.
RUN_USER=daumapp
PG_NAME=jenkins
BASEDIR=/daum/program/$PG_NAME
LOCKFILE=$BASEDIR/$PG_NAME.lock
PIDFILE=$BASEDIR/$PG_NAME.pid
WARFILE=$BASEDIR/jenkins-2.0_1.1.war
export PATH=/usr/local/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0
# Source function library.
. /etc/rc.d/init.d/functions
#export PATH=$PATH:/usr/bin:/usr/local/bin
PS_CMD="ps -ef | grep $WARFILE | grep -v grep"
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting Jenkins: "
su -s /bin/sh $RUN_USER -c "
$JAVA_HOME/bin/java -jar $WARFILE > $BASEDIR/logs/$PG_NAME.log 2>&1 &
"
RETVAL=$?
ps -ef | grep $WARFILE | grep -v grep | awk '{print $2}' > $PIDFILE
echo
[ $RETVAL = 0 ] && touch $LOCKFILE
;;
stop)
# Stop daemons.
echo "Shutting down Jenkins: PID=$(cat $PIDFILE)"
kill -TERM `cat $PIDFILE`
RETVAL=$?
echo $RETVAL
[ $RETVAL = 0 ] && rm -f $LOCKFILE $PIDFILE
;;
restart)
$0 stop
$0 start
;;
condrestart)
[ -e $LOCKFILE ] && $0 restart
;;
ps)
ps -ef | grep $(cat $PIDFILE)
;;
*)
echo "Usage: $0 {start|stop|ps|restart|condrestart}"
exit 1
esac
exit 0
작업 로그
# jenkins를 dw-hadoop-daumapp에 설치
* rpm은 proxy 설정 해줬음에도 실패
* => 이거 설정 잘못했었다..;;.. 제대로 설정하고 재시도는 안해봄..;;
* war 받아서 설치하기로 전향.
## java 1.7 runtime 설치
* yum install java7
* /usr/lib/jvm/java-1.7.0...
* rpm -ql java-1.7.0-openjdk
## jenkins war 설치
* Installing Jenkins as a Unix daemon
* https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Unix+daemon
* JenkinsLinuxStartupScript
* https://wiki.jenkins-ci.org/display/JENKINS/JenkinsLinuxStartupScript
* Starting and Accessing Jenkins
* https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins
* war로 실행하는 법과, war로 실행할때의 옵션들.
* jenkins 환경변수
* https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
* jenkins.war 실행
* /usr/lib/jvm/jre-1.7.0/bin/java -jar jenkins-2.0_1.1.war > /dev/null 2>&1 & echo $! > PID
* jenkins.sh 만듦.
* 시작하니 offline모드 어쩌구 뜨는데, proxy 설정해주니 잘 됨!
'SW-PRODUCT > 설치' 카테고리의 다른 글
[링크] for-loop를 forEach()로 바꾸지 밀아야 할 세가지 경우 (0) | 2016.06.27 |
---|---|
tomcat multi instance (0) | 2012.10.25 |