Skip to content

Unclean shutdown on SIGINT / SIGTERM #3238

@mdyring

Description

@mdyring

Seems this wasn't moved over from cosmos/cosmos-sdk#2136, so here goes.

Summary of Bug

gaiad returns a non-zero exit code (1) after receiving SIGINT as well as SIGTERM.

This is problematic, as this is interpreted as an unclean shutdown (especially for the systemd crowd).

Not being able to differentiate between an intentional service stop or a real problem/unclean shutdown complicates monitoring and alerting on the service.

Steps to Reproduce

Dummy gaia.service file:

[Unit]
Description=Gaia Service
Requires=network-online.target
After=network-online.target

[Service]
User=gaia-daemon
Type=simple
RootDirectory=/opt/gaia
WorkingDirectory=/
ExecStart=/bin/gaiad start --home /
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Notice the 1/FAILURE after starting and stopping the service:

systemctl status gaia
* gaia.service - Gaia Service
   Loaded: loaded (/etc/systemd/system/gaia.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2018-08-23 17:10:43 CEST; 4min 57s ago
  Process: 53832 ExecStart=/bin/gaiad start --home / (code=exited, status=1/FAILURE)
 Main PID: 53832 (code=exited, status=1/FAILURE)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Assignees

Labels

T:bugType Bug (Confirmed)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions