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
- Create a link in your init script folder (i.e. /etc/init.d):
ln \-s /opt/Bamboo/bamboo.sh /etc/init.d/bamboo
- Changes to the bamboo.sh script:
- 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
- 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` ;;
- Top of the script after #!/bin/bash include
- 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.