Atlassian FishEye & Crucible startup script

Posted on 14 Oct, 2012 | 0 comments

Atlassian FishEye & Crucible startup script

 

Pentru cei interesati de o solutie pentru sisteme de operare care ruleaza CentOS, RHEL, Fedora, mai jos sunt citiva pasi:

 

1. Drepturile de acces la anumite fisiere si directoare trebuiesc actualizate

 

2. Creati in /etc/init.d un fisier “atlassian-fecru” in care puneti, folosind un editor, urmatorul continut:


#!/bin/sh
#
# atlassian-fecru Start/Stop the Atlassian Crucible & FishEye Server
# chkconfig: 2345 80 05
# description: Atlassian Crucible & Fisheye Server
# Peer code review & Browse and search code
#
# Written by Vasile Strugaru
# Inspired by Atlassian documentation
#
# contact@vasile.strugaru.ro
# http://vasile.strugaru.ro
#
# Please check your install folders and change accordingly the necessary info
#
# processname: java
# config: /home/fisheye/fisheyecrucible/config.xml
#
# Usage:
# /etc/init.d/atlassian-fecru {start|stop|help}

#
# Variables
#
FECRU_USER="fisheye"
FECRU_INSTALL="/opt/FECRU"
FECRU_HOME="/home/fisheye/fisheyecrucible"

#
# FishEye & Crucible sepcific ENV variable for INSTANCE home path
#
FISHEYE_INST=$FECRU_HOME

# JAVA_HOME Must point at your Java Development Kit installation.
# Required to run the with the "debug" argument.
#
# JRE_HOME Must point at your Java Development Kit installation.
# Defaults to JAVA_HOME if empty.
JAVA_HOME=/opt/jdk1.6.0_30

#
# Functions
#
start_fecru() {
echo "Starting Atlassian FishEye & Crucible Server: "
su - $FECRU_USER -c "cd ${FECRU_HOME}; export FISHEYE_INST=${FISHEYE_INST}; export JAVA_HOME=${JAVA_HOME}; ${FECRU_INSTALL}/bin/fisheyectl.sh start"
echo -e "\tDone."
echo -e "\tYou can check the log file ${FECRU_HOME}/var/log/fisheye.out for application startup details"
}
stop_fecru() {
echo "Shutting down FishEye & Crucible: "
su - $FECRU_USER -c "cd ${FECRU_HOME}; export FISHEYE_INST=${FISHEYE_INST}; export JAVA_HOME=${JAVA_HOME}; ${FECRU_INSTALL}/bin/fisheyectl.sh stop"
echo -e "\tDone."
echo -e "\tYou can check the log file ${FECRU_HOME}/var/log/fisheye.out for application shutdown details"
}
help_fecru() {
clear
echo "Atlassian FECRU rc-script"
echo -e "/etc/init.d/atlassian-fecru {start|stop|help}\n"
echo "Options:"
echo "--------"
echo -e "start\tStarts the Atlassian FishEye & Crucible server."
echo -e "stop\tStops the Atlassian FishEye & CRucible server."
echo -e "help\tShow this message.\n"
}
case "$1" in
start)
start_fecru
;;
stop)
stop_fecru
;;
help)
help_fecru
exit 0
;;
*)
echo "Usage: /etc/init.d/atlassian-fecru {start|stop|help}"
exit 1
;;
esac

 

3. Legaturile simbolice pentru rularea automata la pornirea si oprirea sistemului se fac prin comanda:


>sudo /sbin/chkconfig --add atlassian-fecru

 

Informatiile necesare pentru chkconfig se afla la inceputul scriptului.

 

Info

Pentru un sistem ce utilizeaza “System V”avem:

Runlevel 0: Shuts down the system (Halt)

Runlevel 1: Single user mode (super user)

Runlevel 2: Multi user

Runlevel 3: Multi user + network

Runlevel 4: Not used/User-definable

Runlevel 5: As runlevel 3 + display manager

Runlevel 6: Reboots the system

 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.