Bamboo startup linux with chkconfig service

Atlassian provides with Bamboo a good start for an autostart procedure, however you need to make slight changes to get it working with the "chkconfig" or "service" commands.

Expected Directories:
#Init Script Folder: /etc/init.d
#Bamboo Install Folder: /opt/Bamboo
#Java Home: /usr/java

  1. Create a link in your init script folder (i.e. /etc/init.d):
    ln \-s /opt/Bamboo/bamboo.sh /etc/init.d/bamboo
    
  2. Changes to the bamboo.sh script:
    1. Top of the script after #!/bin/bash include
      #
      # ------------------------------------------------------
      # Bamboo Startup Script for Unix
      # ------------------------------------------------------
      # bamboo	This shell script takes care of starting and stopping
      #               bamboo.
      #
      # chkconfig: 2345 80 30
      # description: bamboo is a daemon for a build server
      # processname: bamboo
      
      cd /opt/Bamboo
      export JAVA_HOME=/usr/java
      export PATH=$PATH:$JAVA_HOME/bin
      
      
    2. start section you should include an autokill, as the shutdown seems not to go clean all the time! This is the new start section
        start)
              echo "Starting Bamboo: "
      
              if [ -f $BAMBOO_PID ]
              then
                  echo "Already Running!!"
                  PID=`cat $BAMBOO_PID 2>/dev/null`
                  echo "Shutting down Bamboo: $PID"
                  kill $PID 2>/dev/null
                  sleep 2
                  kill -9 $PID 2>/dev/null
                  rm -f $BAMBOO_PID
              fi
      
              echo "STARTED Bamboo `date`" >> $BAMBOO_CONSOLE
      
              cd $BAMBOO_INSTALL
              nohup sh -c "exec $RUN_CMD 2>&1" >$BAMBOO_INSTALL/logs/bamboo.log &
              echo $! > $BAMBOO_PID
              echo "Bamboo running pid="`cat $BAMBOO_PID`
              ;;
      
  3. Integrate with chkconfig and startup on level 345:
    cd /etc/init.d
    chkconfig --add bamboo
    chkconfig --level 345 bamboo on
    

That should be it, once done you should be able to autostart the Bamboo server on every startup.

I would suggest a reboot to check your success.

Labels

build build Delete
bamboo bamboo Delete
atlassian atlassian Delete
chkconfig chkconfig Delete
service service Delete
linux linux Delete
startup startup Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.