How to start Fisheye and Crucible at boot time
Purpose
Fisheye and Crucible do not ship with scripts to start the instance at system boot time.
System Administration tasks are not supported by Atlassian. These instructions are only provided as a guide and may not be up to date with the latest version of your operating system.
Windows
With a system administrator user, configure a scheduled task to start the instance when the server starts. When prompted to browse for a program, select <FishEye Home Directory>\bin\start.bat
.
Linux
A clarification may be necessary here:
As can be seen in the Crucible and Fisheye document, even though both of these products can run in complete isolation of each other, they are distributed together and both start together at the same time, as a single instance, in a single process.
The difference between the two installers is just which license you are required to input. So for example, if you run the Fisheye installer you will need to have a Fisheye license and you will be given the option to also input (or not) a Crucible license after that (and vice versa for the Crucible installer). Both products are installed together regardless of which installer you use.
Due to that, the environment variables from the Linux script below are recognized regardless if you are using just Fisheye, just Crucible, or both of them.
You can choose init or systemd method to boot the service:
init file
Create a new file
/etc/init.d/fisheye
with the following contents:/etc/init.d/fisheye#!/bin/bash ### BEGIN INIT INFO # Provides: Fisheye # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start Fisheye daemon at boot time # Description: Start Fisheye daemon at boot time ### END INIT INFO # RUN_AS: The user to run fisheye as. Its recommended that you create a separate user account for security reasons RUN_AS=fisheye # 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="/usr/local/atlassian/applications/fisheye/latest" # FISHEYE_INST: The path to store Fisheye data. # The line below should be uncommented only if you don't have the environment variables set in /etc/environment file. # export FISHEYE_INST="/path/to/fisheye_inst" fisheyectl() { if [ "x$USER" != "x$RUN_AS" ]; then su - "$RUN_AS" -c "$FISHEYE_HOME/bin/fisheyectl.sh $1" else "$FISHEYE_HOME/bin/fisheyectl.sh" "$1" fi } case "$1" in start) fisheyectl start ;; stop) fisheyectl stop ;; restart) fisheyectl stop sleep 10 fisheyectl start ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0
Change the permissions as follows:
sudo chmod 755 /etc/init.d/fisheye
- Add the script to the start up process:
Ubuntu (and other Debian derivatives):
sudo update-rc.d fisheye defaults Adding system startup for /etc/init.d/Fisheye ... /etc/rc0.d/K20FishEye -> ../init.d/Fisheye /etc/rc1.d/K20FishEye -> ../init.d/Fisheye /etc/rc6.d/K20FishEye -> ../init.d/Fisheye /etc/rc2.d/S20FishEye -> ../init.d/Fisheye /etc/rc3.d/S20FishEye -> ../init.d/Fisheye /etc/rc4.d/S20FishEye -> ../init.d/Fisheye /etc/rc5.d/S20FishEye -> ../init.d/Fisheye
RHEL and derivates:
chkconfig --add fisheye --level 0356
This will make the instance start automatically when the server is started.
This script has three usage options: Start, Stop and Restart.
- Start is executed by default on server boot, but can also be executed manually if the instance is not running.
- Stop will shutdown the instance.
- Restart will shutdown and start the instance immediately after shutdown.
systemd
You can follow the steps in the How to create a service for Fisheye/Crucible in Linux document under RHEL 8 & Ubuntu in order to set the service via systemd method.
Did it work?
To double check if this worked, after rebooting the server, wait a few seconds / minutes to give the Fisheye instance enough time to start and try to reach the instance using a browser from another computer.
Notes
This was tested with Ubuntu 20.04.