Ubuntu 14.04 (VirtualBox/Vagrant machine).
Fisheye artifact zip version: 3.9.1
As it doesn't come with a init.d level startup script, I created the following script /etc/init.d/fisheye:
#!/bin/bash
# FISHEYE_HOME: The path to the FishEye installation. It's recommended to create a symbolic link to the latest version so
# the process will still work after upgrades. Be sure to update the symlink itself when upgrading.
# Example: ln -s /usr/local/atlassian/applications/fisheye/4.2.0 /usr/local/atlassian/applications/fisheye/latest
FISHEYE_HOME="/mnt/fecru-3.9.1"
# FISHEYE_INST: The path to store Fisheye data.
# The 2 lines below should be uncommented only if you don't have the environment variables set in /etc/environment file.
#export FISHEYE_INST="/mnt/fecru-3.9.1_fisheye_data"
#mkdir -p $FISHEYE_INST || sudo mkdir -p $FISHEYE_INST
fisheyectl() {
if [ ! -f "$FISHEYE_HOME/fisheyeboot.jar" ] ; then
echo "Error: Could not find $FISHEYE_HOME/fisheyeboot.jar"
exit 1
fi
#exec "$FISHEYE_HOME/bin/fisheyectl.sh" "$1"
"$FISHEYE_HOME/bin/fisheyectl.sh" "$1"
}
case "$1" in
start)
fisheyectl start
;;
stop)
fisheyectl stop
;;
restart)
fisheyectl stop
sleep 10
fisheyectl start
;;
status)
fecru_pid=$(ps -eAf|grep fecru|grep -v grep|sed "s/[ \t][ \t]*/ /g"|cut -d" " -f2|head -1)
if [[ -n "${fecru_pid}" ]];
then
echo "Process 'fecru' fisheye/crucible is running. PID (${fecru_pid})"
else
echo "Process 'fecru' fisheye/crucible is NOT running."
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
esac
echo "- Log files are available here:"
if [[ -n "${FISHEYE_INST}" ]];
then
echo "$(find "${FISHEYE_INST}/var/log" | sed "s/^/ /")";
else
echo "$(find "${FISHEYE_HOME}/var/log" | sed "s/^/ /")"
fi
echo
exit 0
As a root user, when I'm trying to run service fisheye start, I see it's starts the process but fails at the end showing the following main error.
2017-03-03 19:59:30,586 ERROR - No default permission scheme exists
2017-03-03 19:59:30,743 ERROR - The Web context could not be started
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultMentionParserListener' defined in URL
Full log: /mnt/fecru-3.9.1/var/log/fisheye.out file: download here
How can I get this resolve and get fisheye started?
Folder /mnt/fecru-3.9.1 has valid 775 permissions (recursively set) for the user root.
Turning the debug (shell / bash -x) option on fisheyectl.sh file, shows:
+ CMD=/usr/bin/java -Xmx1024m -Dfisheye.library.path= -Dfisheye.inst=/mnt/fecru-3.9.1 -Djava.awt.headless=true -Djava.endorsed.dirs=/mnt/fecru-3.9.1/lib/endorsed -jar /mnt/fecru-3.9.1/fisheyeboot.jar start
+ echo Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1/var/log/fisheye.out
Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1/var/log/fisheye.out
+ whoami
root
+ echo
+ echo
+ nohup sh -c exec /usr/bin/java -Xmx1024m -Dfisheye.library.path= -Dfisheye.inst=/mnt/fecru-3.9.1 -Djava.awt.headless=true -Djava.endorsed.dirs=/mnt/fecru-3.9.1/lib/endorsed -jar /mnt/fecru-3.9.1/fisheyeboot.jar start
I didn't have to be
root. I turned torootuser as I was getting those weird permission issues even though both vagrant/root user had 775 (vagrant:root as chown) set recursively on/mnt/fecru-3.9.1folder.Solution was: 1) I changed the init.d level script to set FISHEYE_INST folder (which was different than
/mnt/fecru-3.9.1folder.2) Note:
/mnt/fecru-3.9.1folder I got from unzipping the artifact which I placed under/mntfolder. 3) As I setFISHEYE_INSTvariable, what the process would do is it'll use that folder (for running Fisheye/Crucible) process and will store it's data/log inside/mnt/fecru-3.9.1_fisheye_data4) Now I can be any user with valid
sudoaccess (and don't have to beroot).5) So I ran:
sudo service fisheye start,sudo service fisheye status, this start step started Fisheye portal on port 8060 (default).This time log file (as per the new location FISHEYE_INST based) was:
/mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.outand it showed the following:NOTE: As I was using a Vagrant machine, in my vagrant file's configuration
Vagrantfile, I had the following port mapping on my Guest VM (ubuntu) and my Host machine (Mac OS).This means, I can access an application/portal running in the Guest VM on port 8060 on my Host Mac machine as port 8160.
Thus, doing http://localhost:8160 -OR- http://10.20.30.40:8160 (IP of my Mac machine) will show Fisheye portal running which I can easily configure.
I don't know why when the default installation folder was
/mnt/fecru-3.9.1as I hadFISHEYE_INSTvarible commented out, then I got those errors even though user/owner and group was set tovagrant/rootand with775permission in the whole path.Setting
FISHEYE_INSTsolved the issue.This init.d script can be enhanced by adding a little logic to create a PID file as well.
Actions
start,stop,restart,statusall worked as expected.6) Portal (per the mapped port 8160) was like:
NOTE: For a machine to auto start
fisheyeservice/process at reboot/boot time, I ran the following:sudo update-rc.d fisheye defaultsand made sure/etc/init.d/fisheyefile had valid755executable permissions.To test that, after I did the above, I logged out of my Ubuntu vagrant machine, went to the the folder where I had my
Vagrantfileplace, and ran the following commands:vagrant halt; vagrant up; vagrant ssh. I was again, logged into my vagrant machine, where I ran the following to make sure Fisheye/Crucible service/process was running by running: