In case the consul server which is passed as the initialization option in $CONSUL_SERVER during other server startup is shutdown, there is no way for cleanup at this time.
Alternate approaches
Service dependency - s6 is planning to add service dependency which can be used to ensure that local servers are not shutdown before the cleanup has been performed and synchronized.
consul-template - add consul specific consul template which keeps track of all the available consul servers which can then be used by the other services for cleanup.
In case the consul server which is passed as the initialization option in $CONSUL_SERVER during other server startup is shutdown, there is no way for cleanup at this time. Alternate approaches