Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#50259 - [consul] consul agent should be gracefully stopped by SIGINT not SIGTERM

Attached to Project: Community Packages
Opened by Konstantin Gribov (gross) - Thursday, 04 August 2016, 15:30 GMT
Last edited by Thore Bödecker (foxxx0) - Tuesday, 16 January 2018, 12:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Thore Bödecker (foxxx0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
`consul agent` should be gracefully stopped by SIGINT not SIGTERM, see [1].
I suggest to add `ExecStop=/usr/bin/kill -INT $MAINPID` to `/usr/lib/systemd/system/consul.service`.

Additional info:
* community/consul 0.6.4-1

Steps to reproduce:
* create config at `/etc/consul.d` with `{"data_dir":"/tmp/consul-test","server":true,"bootstrap_expect":1,"bind_addr":"10.0.3.1"}`
* `systemctl start consul`
* `systemctl stop consul`
* see `journalctl -u consul -o short-iso | grep -A6 terminated`:
```
2016-08-04T18:08:58+0300 unterwelt consul[14836]: ==> Caught signal: terminated
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [INFO] agent: requesting shutdown
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [INFO] consul: shutting down server
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [WARN] serf: Shutdown without a Leave
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [ERR] dns: error starting tcp server: accept tcp 127.0.0.1:8600: use of closed network connection
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [WARN] serf: Shutdown without a Leave
2016-08-04T18:08:58+0300 unterwelt consul[14836]: 2016/08/04 18:08:58 [INFO] agent: shutdown complete
```
* Add suggested `ExecStop` directive to `/etc/systemd/system/consul.service.d/stop.conf`
* `systemctl daemon-reload`
* `systemctl start consul`
* `systemctl stop consul`
* `journalctl -u consul -o short-iso | grep -A9 interrupt`:
```
2016-08-04T18:11:07+0300 unterwelt consul[15075]: ==> Caught signal: interrupt
2016-08-04T18:11:07+0300 unterwelt consul[15075]: ==> Gracefully shutting down agent...
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] consul: server starting leave
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] serf: EventMemberLeave: unterwelt.dc1 10.0.3.1
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] agent: requesting shutdown
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] consul: shutting down server
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [WARN] serf: Shutdown without a Leave
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] serf: EventMemberLeave: unterwelt 10.0.3.1
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [ERR] dns: error starting tcp server: accept tcp 127.0.0.1:8600: use of closed network connection
2016-08-04T18:11:07+0300 unterwelt consul[15075]: 2016/08/04 18:11:07 [INFO] agent: shutdown complete
```
* ensure that `EventMemberLeave` is present in log
This task depends upon

Closed by  Thore Bödecker (foxxx0)
Tuesday, 16 January 2018, 12:01 GMT
Reason for closing:  Won't fix
Comment by Konstantin Gribov (gross) - Thursday, 04 August 2016, 15:31 GMT Comment by Thore Bödecker (foxxx0) - Tuesday, 16 January 2018, 12:01 GMT
This is considered bad practice and clients should not "leave" the cluster when doing a normal stop or restart.
They should only leave if you want to decomission the server.

Source: https://github.com/hashicorp/consul/issues/3764#issuecomment-353263493

Loading...