gocd/go-cookbook

Additional agents don't get started on boot

Closed this issue · 3 comments

tomzo commented

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.

Will need to change documentation as well, then.

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

This was solved in gocd source