I'm starting my TeamCity agent on Ubuntu 15.10 via an init.d
script like so:
#!/bin/sh
### BEGIN INIT INFO
# Provides: TeamCity Build Agent
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start build agent daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
USER="myuser"
case "$1" in
start)
su - $USER -c "/home/myuser/BuildAgent/bin/agent.sh start"
;;
stop)
su - $USER -c "/home/myuser/BuildAgent/bin/agent.sh stop"
;;
*)
echo "usage start/stop"
exit 1
;;
esac
exit 0
The script starts the agent on reboot without problems.
However, my TeamCity build steps (Command Line Runners specifically) cannot find my executables, instead i get node: command not found
. Curiously, if I start the agent from the command line as myuser
, the exact same build step works fine.
I'm trying to avoid having to prefix my build script with #!/bin/bash
every time. Is there a way to specify a default shell when using the Command Line runner?