Skip to content

After terminating god, restart it using Upstart#11

Open
mhaylock wants to merge 1 commit intorailsmachine:masterfrom
resolve:restart_using_upstart
Open

After terminating god, restart it using Upstart#11
mhaylock wants to merge 1 commit intorailsmachine:masterfrom
resolve:restart_using_upstart

Conversation

@mhaylock
Copy link
Copy Markdown

@mhaylock mhaylock commented Aug 6, 2015

During the 'god:restart' task god terminate is run - when this completes Upstart will detect this and restart god automatically. The current implementation then tries to start a non-daemonized god process (i.e. runs god -c /etc/god/god.conf) which then conflicts with the socket already reserved by the daemonized process started by Upstart.

Due to this my log file would have entries like:

Socket drbunix:///tmp/god.17165.sock already in use by another instance of god

In this PR I've change it to use start god || true which instructs Upstart to start the process if it hasn't already, and ignore it if it has already started it. With this fix in place god restart cleanly without any error messages.

This avoids Upstart trying to restart god after the `god terminate` then conflicting with the previously used direct instantiation of god (which wasn't daemonized anyway).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant