Skip to end of metadata
Go to start of metadata


FishEye and Crucible do not ship with scripts to start FishEye 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.


  1. Create a new file /etc/init.d/fisheye with the following contents:

  2. Change the permissions as follows:

    sudo chmod 755 /etc/init.d/fisheye
  3. Add the script to the start up process:
    1. Ubuntu (and other Debian derivatives):

      sudo update-rc.d fisheye defaults
    2. RHEL and derivates:


This was tested with Ubuntu 8.10.


  1. On CentOS 5.3 I was getting an "At least one argument required." error.

    I fixed it by changing the following line


    1. I had the same problem with Ubuntu 10.04 I just did the same thing as Adam and moved the $1 into the same string

      I also had to add the fisheye user with a home directory so I didn't get any nohup.out permission problems (it otherwise it tries to make the file in /)

      sudo useradd -d /home/fisheye -m fisheye
    2. What are the strings? This site is blank.

    3. I had the same problem and solution with Red Hat Linux 6.5.

  2. Note, if you are following the Dragon tutorial, you need to account for FISHEYE_INST.  I made the following changes:

    # FISHEYE_HOME: The path to the FishEye installation. Its recommended to create a symbolic link to the latest version so
    # the process will still work after upgrades.
    # FISHEYE_INST: The path where the data itself will be stored.
    # See Dragons Stage 5 - Install FishEye and Crucible Step 3
    export FISHEYE_INST="/srv/fisheye/fisheyecrucible"
    fisheyectl() {
            if [ "x$USER" != "x$RUN_AS" ]; then
                    su - "$RUN_AS" -c "FISHEYE_INST=$FISHEYE_INST $FISHEYE_HOME/bin/ $1"
                    "$FISHEYE_HOME/bin/" "$1"

    Also, do not forget:

    chown -R fisheye /srv/fisheye



    1. Yes, it is crucial that the value of FISHEYE_INST be available inside, which it won't necessarily be if it's set in /etc/environment (I'm not sure all Linux distros actually use that, and even if they do, I doubt most of them will pick up on changes to it without a reboot). I used su -m as opposed to su -, so in my case setting it and exporting it in the init script was sufficient.


  3. Here is a slightly more complete init script for ubuntu/debian. Use it as you will but I make no guarantees. (smile)

    . /lib/lsb/init-functions
    if [ "${USER}" != "root" ]; then
    echo "try running again as root."
    exit 1
    FISHEYE_GROUP=`groups ${FISHEYE_USER} | cut -d: -f2 | awk '{ print $1 }'`
    cd ${FISHEYE_HOME}
    if [ -L ${FISHEYE_HOME} ]; then
    FISHEYE_HOME=`readlink -f ${FISHEYE_HOME}`
    # fix the permissions
    function fisheyectl() {
    if [ "$1" == "start" ] && `fisheye_started`; then return 0; fi
    if [ "$1" == "stop" ] && `fisheye_stopped`; then return 0; fi
    if [ "$USER" != "$FISHEYE_USER" ]; then
    su - "$FISHEYE_USER" -c "$FISHEYE_HOME/bin/ $1" &> /dev/null
    $FISHEYE_HOME/bin/ $1 &> /dev/null
    if [ "$1" == "start" ]; then 
    sleep_til started
    get_pid > ${FISHEYE_PID}
    if [ "$1" == "stop" ]; then
    sleep_til stopped
    rm ${FISHEYE_PID}
    function fisheye_started() {
    netstat -ln | grep -c '' &> /dev/null
    function fisheye_stopped() {
    ! fisheye_started
    function sleep_til() {
    while ! `fisheye_${1}`; do
    sleep 1
    if [ $x -eq 10 ]; then
    log_end_msg 1
    exit 1
    function get_pid() {
    ps -ef | grep -v "grep" | grep "java" | grep "fisheyeboot.jar" | awk '{ print $2 }'
    case "$1" in
    log_daemon_msg "Starting Fisheye" "fisheye"
    fisheyectl start
    log_end_msg 0
    log_daemon_msg "Stopping Fisheye" "fisheye"
    fisheyectl stop
    log_end_msg 0
    log_daemon_msg "Restarting Fisheye" "fisheye"
    fisheyectl stop
    fisheyectl start
    log_end_msg 0
    status_of_proc -p ${FISHEYE_PID} /usr/bin/java fisheye && exit 0 || exit $?
    echo "Usage: $0 {start|stop|restart|status}"
    exit 0
  4. These are wrong: 

    if [ "x$USER" != "x$RUN_AS" ]; then
                    su - "$RUN_AS" -c "$FISHEYE_HOME/bin/" "$1"
                    "$FISHEYE_HOME/bin/" "$1"
    These are correct for Ubuntu 12.04:
    if [ "x$USER" != "x$RUN_AS" ]; then
                    su - "$RUN_AS" -c "$FISHEYE_HOME/bin/ $1"
                    "$FISHEYE_HOME/bin/ $1"
    Carlitos Melgar
    1. Your first correction is correct (in most situations), the second is not. Technically, if one wants to be totally consistent, it should be something like:

      if [ "x$USER" != "x$RUN_AS" ]; then 
          su - "$RUN_AS" -c "\"$FISHEYE_HOME/bin/\" \"$1\""
          "$FISHEYE_HOME/bin/" "$1"


  5. There's a bug somewhere with args being passed on Linux systems ( FE-4639 - Command-line application start fails to pull $FISHEYE_ARGS (Linux only) Closed ) which the following script should fix


  6. chkconfig --add stash --level 0356

    Should be chkconfig --add fisheye --level 0356

  7. I created a system user in Ubuntu for the fisheye user (sudo useradd -r -s /bin/false USERNAME). In this case your "su" line needs to look like:

    su -m "$RUN_AS" -c "$FISHEYE_HOME/bin/ $1"

    Otherwise you'll get the error "No directory, logging in with HOME=/"

  8. I had to change that command to:

    sudo -u "$RUN_AS" "$FISHEYE_HOME/bin/" "$1"
    1. Thank you for this form - it's actually the only one which works on my Centos 6.7 box.

      Every other form listed on this page causes that service does not aware of my environments variables and cannot find FISHEYE_INST directory.

  9. if you got: "service fisheye does not support chkconfig" on redhat like distribs - add the following strings to the /etc/init.d/fisheye after #!/bin/bash:

    #Fisheye startup script
    #chkconfig: 2345 80 05
    #description: Fisheye

  10. I wrote an OpenRC initscript that does not use but instead creates the command on its own (by default it uses the same parameters that also uses)

    /etc/init.d/fisheye  Expand source
    /etc/conf.d/fisheye  Expand source
  11. On CentOS 6.5, the script fixes required before it will run are (1) the chkconfig headers by Chernosliv and (2) the script argument fix by Adam Crownoble.

    1. Same on Amazon Linux (which is basically CentOS), works great with these two changes.


  12. I'm on RHEL 5.6.

    I think the chkconfig header comments are only for completeness.  they're not required to function (though, i haven't exactly rebooted the server).

    i wasn't able to get it to find the fisheye_inst set in /etc/environment, so finally this seemed to get it to work.  Note, I also changed the to use /bin/bash instead of /bin/sh.  

     su "$RUN_AS" -c ". /etc/environment;$FISHEYE_HOME/bin/ $1"

    it took some good amounts of work to get this started as a service.

  13. I'm on CentOS machine and when I try to use add the service throws me this error:

    service fisheye does not support chkconfig

    What can I do?.



    1. per comment above, for RHEL, you must make sure you have:

      # confluence startup script
      #chkconfig: 2345 80 05
      #description: confluence

      the important part is the #chkconfig stuff which is needed for RHEL.  If centos is the same, it #ShouldJustWork (smile).


      1. Sorry I understand part of the solution (I'm a newbie in SysOp topics), the fact is I'm running the Confluence, Jira, Stash, Crowd on a VPS, where I've root access, and I've already running the instances as services. But Fisheye and Crucible are a little different about installation and config, so I've a little lost.

        If you don't mind could be a little more detailed about what I need to do to automatically run these as a service it will be great.



  14. Systemd service unit file (tried on Debian Jessie)