Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

systemd reload not working #250

Open
mr-miles opened this issue Jun 27, 2022 · 0 comments · May be fixed by #251
Open

systemd reload not working #250

mr-miles opened this issue Jun 27, 2022 · 0 comments · May be fixed by #251
Labels

Comments

@mr-miles
Copy link
Contributor

mr-miles commented Jun 27, 2022

Describe the bug
The "reload" operation set up for systemd by run_consul does not work
https://github.com/hashicorp/terraform-aws-consul/blob/master/modules/run-consul/run-consul#L376

As set up, the reload operation called here cannot succeed unless it has access to the full set of environment variables including a valid acl token. If any items are missing there will be an error.

Log file entries

Running systemctl restart consul.service fails with the following entries:

Jun 27 19:35:42 ip-10-142-24-123 systemd[1]: Reloading "HashiCorp Consul - A service mesh solution".
Jun 27 19:35:47 ip-10-142-24-123 consul[2511144]: Error reloading: Put "http://127.0.0.1:8500/v1/agent/reload": dial tcp 127.0.0.1:8500: connect: connection refused
Jun 27 19:35:47 ip-10-142-24-123 systemd[1]: consul.service: Control process exited, code=exited, status=1/FAILURE
Jun 27 19:35:47 ip-10-142-24-123 systemd[1]: Reload failed for "HashiCorp Consul - A service mesh solution".

Suggested fix
Systemd can send a signal to the process which causes it to reload
The unit config looks like this (with escaping so it pastes directly into run-consul L376)

ExecReload=/bin/kill -HUP \$MAINPID

First question was - has this been considered already? It works fine for me but maybe there was a reason for using the consul binary directly?

@mr-miles mr-miles added the bug label Jun 27, 2022
@mr-miles mr-miles linked a pull request Aug 1, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant