I've successfully installed TeamCity ib CentOS 6.2 Minimal. I'm stuck on trying to run a script automatically on system startup:
/opt/TeamCity/bin/teamcity-server.sh start
I've googled around and tried various methods all of which seems to fail. Most of the methods points to adding the startup script to one of the rc.local files:
/etc/rc.d/rc.local
/etc/rc.local
And the contents of rc.local contains the line:
/opt/TeamCity/bin/teamcity-server.sh start
None of which will start the teamcity server
There are no problems if i run the script manually.
Seems simple but how do i get a shell script to auto run?
If the teamcity start script is a LSB-compliant init script (that is, if it provides start, stop and other arguments), you can just copy the script to
/etc/init.d
folder and run (as root):A symbolic link for the file should be OK too. So try (as root):
If it doesn't start on initialization, but starting manually without problems, you should check:
To print the content of your PATH just run:
To check if the reason to the script not start is the PATH, try:
This command will temporary clear your PATH and run the command. If the command need some specific info on the PATH it will fail (be careful to run exactly as stated above, THERE IS a space between PATH= and the remaining of the command).
in Fedora 17 command
say: service teamcity-server does not support chkconfig you should add header like:
only after that run first command.
When the script is run manually, it works correctly. But, when run automatically it doesn't work.
I've found the culprit: TeamCity runs under the user
teamcity
. It must be present in the/etc/sudoers
file and you should add, usingvisudo
a line like this: