gocd / go-cookbook

Cookbook that installs and configures the open-source ThoughtWorks Studios GoCD product
http://www.gocd.org/
Apache License 2.0
45 stars 66 forks source link

Additional agents don't get started on boot #59

Closed tomzo closed 8 years ago

tomzo commented 8 years ago

go-agents setup with LWRP are created like here

The extra init.d scripts are created as symlinks /etc/init.d/go-agent-1 -> /etc/init.d/go-agent

The service is not enabled in /etc/rc2.d/ and trying to enable will fail:

sudo insserv /etc/init.d/go-agent-1
insserv: script go-agent-1: service go-agent already provided!
insserv: exiting now!

Reason is that go-agent is provided now by every go-agent-* instance.

# Provides: go-agent
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the Go Agent
### END INIT INFO

When copied cp /etc/init.d/go-agent /etc/init.d/go-agent-1 and replaced Provides: go-agent with Provides: go-agent-1 then it works.

Probably cookbook should do copy and then replace service name instead of just creating links.

arvindsv commented 8 years ago

Will need to change documentation as well, then.

arvindsv commented 8 years ago

Copying makes sense to me. There's no way I can think of to parameterize that. Unless $(basename $0) somehow works. Can't see that happening. It's in a comment.

tomzo commented 8 years ago

This was solved in gocd source