Skip to content

Instantly share code, notes, and snippets.

@asangal
Last active March 3, 2017 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asangal/2759ba203323b036ebcf3dd56eb82376 to your computer and use it in GitHub Desktop.
Save asangal/2759ba203323b036ebcf3dd56eb82376 to your computer and use it in GitHub Desktop.
#!/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
"$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" 2>/dev/null | sed "s/^/ /")";
else
echo "$(find "${FISHEYE_HOME}/var/log" 2>/dev/null | sed "s/^/ /")"
fi
echo
exit 0
@mzeier
Copy link

mzeier commented Mar 2, 2017

I don't know enough but if the existing process is running as root, might keep it that way only because there's probably some file that you'd lose read/write access to.

Unless you can do testing of this instance elsewhere with a different user?

@asangal
Copy link
Author

asangal commented Mar 3, 2017

Updated /etc/init.d/fisheye file. Yea, without root user it was having some perm issues. The new version worked fine.

vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (4243)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/data/crudb/crucible.log
  /mnt/fecru-3.9.1_fisheye_data/analytics-logs/44549429a0e34feeba92311c77fdc451.atlassian-analytics.log

vagrant@myubuntuvagrant:~$ sudo service fisheye stop
INFO  - Using log4j configuration file: /mnt/fecru-3.9.1/log4j-client.xml
INFO  - FishEye arguments: []
FishEye Shutdown successfully
vagrant@myubuntuvagrant:~$ 
vagrant@myubuntuvagrant:~$ sudo service fisheye start
Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
root


vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (4639)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/data/crudb/crucible.log
  /mnt/fecru-3.9.1_fisheye_data/analytics-logs/44549429a0e34feeba92311c77fdc451.atlassian-analytics.log

Fisheye Login page on my Mac machine: http://192.168.0.60:8160/setup/FishEyeLicense-view.do
Port 8060 (Fisheye's port on guest VM is mapped to port 8160 on my Host Mac machine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment