Skip to content

Commit

Permalink
Merge pull request #6477 from influxdata/er-influx-signals
Browse files Browse the repository at this point in the history
Don't catch SIGQUIT; safer close of Quit channel
  • Loading branch information
e-dard committed Apr 27, 2016
2 parents 33f1523 + 289fe5b commit 1d9919a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [#6462](https://github.com/influxdata/influxdb/pull/6462): Add safer locking to CreateFieldIfNotExists
- [#6361](https://github.com/influxdata/influxdb/pull/6361): Fix cluster/pool release of connection
- [#6470](https://github.com/influxdata/influxdb/pull/6470): Remove SHOW SERVERS & DROP SERVER support
- [#6477] (https://github.com/influxdata/influxdb/pull/6477): Don't catch SIGQUIT or SIGHUP signals.

## v0.12.2 [2016-04-20]

Expand Down
8 changes: 4 additions & 4 deletions cmd/influx/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func New(version string) *CommandLine {

// Run executes the CLI
func (c *CommandLine) Run() error {
// register OS signals for graceful termination
if !c.IgnoreSignals {
signal.Notify(c.osSignals, os.Kill, os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP)
// register OS signals for graceful termination
signal.Notify(c.osSignals, syscall.SIGINT, syscall.SIGTERM)
}

var promptForPassword bool
Expand Down Expand Up @@ -182,7 +182,8 @@ func (c *CommandLine) Run() error {
for {
select {
case <-c.osSignals:
close(c.Quit)
c.exit()
return nil
case <-c.Quit:
c.exit()
return nil
Expand Down Expand Up @@ -210,7 +211,6 @@ func (c *CommandLine) ParseCommand(cmd string) error {
if len(tokens) > 0 {
switch tokens[0] {
case "exit", "quit":
// signal the program to exit
close(c.Quit)
case "gopher":
c.gopher()
Expand Down

0 comments on commit 1d9919a

Please sign in to comment.