its been a pretty frustrating few days trying to get this working. I want to deploy to heroku via a git push. This works fine if I push the code logged into the linux server with my account but not via bamboo I suspect this is because bamboo is running as root. Also if I run bamboo with ./start-bamboo.sh logged in as that user my deploy works as expected. The problem is trying to get the linux service to run as the bamboo user. I have followed atlassians guide on running bamboo as a linux service. The init.d script they provide doesn't seem to work at all. Bamboo never starts up. Then I tried copying how JIRA does it. So basically copy the JIRA init.d script that the JIRA installer created (the installers for JIRA and stash are a life saver) this is a very simple script, obviously I update it to point to my bamboo install and not JIRA but it works great. Unfortunately that still runs as root. So I also made some minor changes to the start-bamboo.sh script in the /opt/bamboo/bin install dir. as such
JIRA_USER="bamboo"
echo executing using dedicated user: $JIRA_USER
if [ -x "/sbin/runuser" ]; then
sucmd="/sbin/runuser"
else
sucmd="su"
fi
if [ "$PRGRUNMODE" == "true" ] ; then
$sucmd -m $JIRA_USER -c "$PRGDIR/catalina.sh run $@"
else
$sucmd -m $JIRA_USER -c "$PRGDIR/startup.sh $@"
fi
This SEEMS to work tomcat starts according to the output. However when I do this bamboo NEVER responds and I get no log details.
Has someone successfully configured their bamboo service to run under a different user?
Hi Paul,
i start bamboo as user bamboo5 on a Debian linux host with this script:
#!/bin/sh ### BEGIN INIT INFO # Provides: bamboo5 # Required-Start: $local_fs $remote_fs $network $syslog nginx # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts bamboo5 ci server # Description: starts bamboo5 using start-stop-daemon ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin BAMBOO_PATH=/opt/atlassian/bamboo BAMBOO_HOME=/var/lib/bamboo DAEMON_DIR=$BAMBOO_PATH/bin START_BIN=$DAEMON_DIR/start-bamboo.sh STOP_BIN=$DAEMON_DIR/stop-bamboo.sh NAME=bamboo5 DESC="Atlassian Bamboo 5 CI Server" RUN_AS=bamboo5 PIDFILE=/var/run/bamboo/bamboo5.pid export BAMBOO_PID=$BAMBOO_HOME/bamboo.pid test -x $DAEMON || exit 0 set -e . /lib/lsb/init-functions case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --chuid $RUN_AS --quiet --pidfile $PIDFILE \ --exec $START_BIN -- start || true echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --chuid $RUN_AS --quiet --pidfile $PIDFILE \ --exec $STOP_BIN -- stop || true echo "$NAME." ;; *) echo "Usage: $NAME {start|stop}" >&2 exit 1 ;; esac exit 0
This works without problems. Have you changed the ownership of all bamboo files to the bamboo user? When you run the server as root than lot's of files are created as root and only the root user can write to these files.
Maybe another problem is your bamboo user has the shell /bin/false - try to change this to another shell.
Cheers
Reinhard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.