diff --git a/Changes.md b/Changes.md index 93154d5f..eb9ad604 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,7 @@ HEAD - A `USR2` signal will now reopen _all_ logs, using IO#reopen. Thus, instead of creating a new Logger object, Sidekiq will now just update the existing Logger's file descriptor [#1163]. +- Remove pidfile when shutting down if started with `-P` [#1470] 2.17.4 ----------- diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index a5761060..398efb5f 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -179,7 +179,7 @@ module Sidekiq cfile = opts[:config_file] opts = parse_config(cfile).merge(opts) if cfile - + opts[:strict] = true if opts[:strict].nil? options.merge!(opts) @@ -314,6 +314,9 @@ module Sidekiq f.puts Process.pid end end + at_exit do + FileUtils.rm_f path + end end def parse_config(cfile) diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index 01462d7f..eed4f4c0 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "2.17.4" + VERSION = "2.17.5" end